SQL Server 2008 :: Test If Each Subset Meets Requirements

Feb 25, 2015

CREATE TABLE #tblTemplateBlocks
(
TemplateID int,
BlockID int,
OrderID int

[Code] ....

I have a table called TemplateBlocks which contains which Blocks are on a Template. In this example - just one template - with three Blocks.

Table tblFields contains a list of Fields that are on each TemplateID/BlockID. In this example there are 3 fields on each TemplateID/BlockID pair.

Before I can use a template, I have to check that, in tblFields, for each Template/BlockID pairing - one of the fields must be set as the Stage Base (I cannot have 2 fields as StageBase or no fields as StageBase). In the example data above, the data would be okay as each Template/BlockID pairing has one row where StageBase is true.

Having checked that each Template/BlockID pairing has a StageBase, I need to check that each row where StageBase is true has a value for the WeekStart column and that, taking into account the order of the Blocks in tblTemplateBlocks, the values in WeekStart for each TemplateID/BlockID pairing are getting progressively bigger.

So, for example, the example data above would fail because the third TemplateID/BlockID pairing has no value for the WeekStart column in the row where StageBase is true.

If I added a value of 2 for WeekStart in the row for the third TemplateID/Block that has a StageBase of true - again the data would fail because, taking into account the order of the Blocks - the values for WeekStart would be 0,3,2 and these numbers need to increase.

0,3,4 would be fine.
0,3,10 would be fine.
0,3,3 would fail.

I can do this easily using a cursor or two - but how to do this without cursors.

View 9 Replies


ADVERTISEMENT

Move A Subset Of Data From Production To Test

Nov 18, 2005

Here is my requirement.

There is a production database which has ever increasing data. For testing purposes though, I would like to build a test database with exactly the same schema but only a subset of data copied from the production database . I'll specify the criteria (something like a where clause in select query) for copying the data from the production database.

Is there a tool that anyone has come across to do this job ?

View 2 Replies View Related

SQL Server 2008 :: How To Generate Test Data Using Only VS 2013

Sep 29, 2015

I've been tasked to generate some test data (a few thousand rows) into a new table in a new database. This database is a whole new idea, so I can't write a query to pull pieces of data from other databases. I cannot consider any third party tools, such as what Redgate or Idera has to offer. I can't consider free tools such as what I've found on GitHub. I've been instructed to restrict myself to Visual Studio 2013 and whatever I can get that works within that.

View 5 Replies View Related

SQL Server 2008 :: Create Test Portfolio Data Summing To 100%?

Feb 5, 2015

I'm building a proc to generate fake stock portfolios for testing. I have a list of thousands of symbols, and I want the tester to be able to select how many symbols they want in their fake portfolio, and then give each symbol a random weighting (i.e. percentage held in that security) which, across all the symbols, sums to 100%. The securities here are not the part I care about, it's the weightings summing to 100 that's important.

So test data would look something like this:

/*
--This is the repository of potential symbols I can add to a fake portfolio.
-- So the simple part is basically select top (@symbolCt) from #PossibleSymbols, plus some magic I have yet to determine
if object_id('tempdb.dbo.#PossibleSymbols') is not null drop table #PossibleSymbols
create table #PossibleSymbols
(
SymbolID int
)
insert into #PossibleSymbols (SymbolID)

[code]....

View 0 Replies View Related

SQL Server 2008 :: Test Backup Restores (full And Log) - Restore Databases Automatically?

Apr 4, 2015

I am working towards automating the process of testing our backups. For the meantime, I do it all manually - I copy the backup files (full + transaction logs) to our test server and then run the restore script. Once database restored I run the DBCC CheckDB. The results of checkdb I manually upload to our Sharepoint portal as proof that the backup file is intact with no errors.

here are some ideas I have but have not yet tested:

Create a maintenance plan with each 3 jobs:

--> Powershell script to copy the files from Prod server to Test server - add this scrip to Job1
--> Powershell script to restore databases files - add this script to Job2
--> Run the DBCC in powershell (yet to find if possible in PS) - add this script to Job3

I would like to use seperate jobs as to get a report on the duration and status of each job

Would also like to get the results of the DBCC Checkdb as proof that no errors were found for upload to our Sharepoint portal. Dont know if possible via the job.

View 8 Replies View Related

Bcp Meets Dr. Watson

Sep 29, 1999

I'm trying to use bcp to move a table into SQL Server 6.5. The command I am using is bcp CCI..contacts in A:Contacts.txt -fC:contacts.fmt -Usa -P -eC:errors.txt. When executing, I receive the Dr. Watson error message shown here:
Exception: access violation (0xc0000005), Address: 0x77f64d28
If I run DRWTSN32.log it shows the application error to be the following:
c0000005 RtlFreeHeap(77f64d28)

Any ideas why??

View 2 Replies View Related

Selecting Lowest DateTime If It Meets Some Conditions

Dec 6, 2012

ID (PK), userID (FK), from [Datetime], to[datetime], type [int] , value [nvarchar]

Conditions
I want to select the column "to" which is a datetime-column for all users within the table.

One user can have multiple registered rows in "mytable", so I want to select the row that contains the newest "from" date.The newest "from"-column for a specific user is where I am struggling... Because if the "to"-column of any of the registered rows by the current user is equal to the newest "from -1 day" column for the user, I want to select the second newest from-date.

Code:
//Handwritten
DECLARE @from DATETIME //Current Selected datetime [the newest of the current user doing the query]
DECLARE @id INT //userID
DECLARE @tbl TABLE (from datetime, userid int)

[code]....

But for user ID 201 [all users with Type = 1], I need to run through some more code, to figure out which date we want... Which date do I want? The "from"-date that is the newest, but if "to" is just 1 day before "from", I want to select the "from" at that row instead... Example with numbers [integers] instead of Date:

Code:
From - To
5 8
10 15
16 20

I want to select "10" in the from column as the maximum "from"-integer, and not 16. Because in the "To" column we have a match in the "from" column on the condition "To + 1" [15+ 1 == 16], so then I want the "from" value where "To" equals 15, which is 10. The top row I do not want, because the difference between From and To [10 - 8 is larger than 1]...

This means that the Image shown... I am first selecting the "1", then I do some checks, if the "to" for the user is 1 day earlier than the MAX(from) I grab a new "from" value...

Code:
SELECT MIN (t1.from) FROM table as t1
WHERE
t1.from IN
(
SELECT t2.to+ 1 FROM table as t2
WHERE t2.userID = @id
)

View 4 Replies View Related

SQL Server On A Subset Of Processors

Jul 10, 2006

Can I install SQL Server on a machine and use less than the # of processor on the machine. In a UNIX world, I'd call it LPARing with Oracle and AIX, and they only let me do this with Enterprise Edition. With Windows, I think the only way is using virtual machines and attaching processors to them? Do any vendors offering LPARing? Can I take any edition of SQL Server and subcapacity price so that I only pay for the processors I'm using?



What about SS Express? It only scheds to a single core - so could I put that on a larger machine?



Thanks!

View 5 Replies View Related

SQL Server 2012 :: Find Subset Of Records From A Table - Multiple Except Statements

May 13, 2015

I created a CTE which finds a subset of records from a table

I then ran a SELECT statement against the same table as

SELECT * FROM TABLE
EXCEPT (SELECT * FROM CTE)

Is it possible to add another EXCEPT statement after the CTE EXCEPT statement to cover a condition not incorporated in the CTE definition?

View 9 Replies View Related

SQL Server Requirements - Can I Get Away With Using SQL2000?

Feb 13, 2007

I recently was moved into an applications developers position here at the lawfirm I work at.
Thusfar, its been alot of straight ASP, SQL2000, and Access.
I know the need for me to know .Net is coming, and Ive decided to start playing with ASP.net so I can look a bit proactive..
Ive looked over what I need to get started, in liu of Visual Studio I know of the VS Express options. However, I currently have SQL Server 2000 installed locally on my machine along with IIS 5.1.   All the VS Express information Ive found keeps referencing SQL2005 express.  Can I get away with using what I already have with 2000? Or if not, can SQL2005 express be run alongside with SQL2000?
Any assistance would be greatly appreciated.
Brian

View 2 Replies View Related

SQL-Server Hardware Requirements

Nov 21, 2000

Hello!

Does anyone know where can i find an information about hardware requirements for SQL-Server 2000. I mean information of different kind of cases (amount of users and transactions etc).

thanks!

Juise K.

View 1 Replies View Related

SQL Server Login Requirements

Dec 26, 2006

We need to create a SQL server login that should not be having permissions to do any changes (CREATE/ALTER/DROP) on database objects like (Tables, views).But should be able to (CREATE/ALTER/DROP) stored procedures. Also using this login they should not be able to (CREATE/ALTER/DROP) databases.

Please let me if this is feasible in SQL Server 2005.





View 6 Replies View Related

Sql Server Password Policy Requirements

May 30, 2007

Hi!



I am installing SQL Server 2005 Express as part of my setup. On Windows 2003 Servers with password policy enabled, the SQL Server 2005 Express installation fails. Here is the error I am getting - "the sa password must meet SQL Server password policy requirements. For strong password guidelines, see Authentication Mode, in SQL Server Books Online.". If I disable the password policy, the SQL Server 2005 Express installation is OK.



Is there a parameter that I can pass to the command line to get around this?



Thanks!

View 3 Replies View Related

Server Side Requirements For SSIS

Jul 20, 2006

Is it necessary to have SSIS installed on the Server (SQL Server) in order to run SSIS programs? Or is SSIS just a client-side, developer tool that can create and test programs against various remote data sources (SQL, Oracle, flat files, etc.)?

What must be installed on the server in order to run SSIS programs?

View 1 Replies View Related

DB Engine :: Replicate A Master Test Database To 100 Test Environments?

Oct 12, 2015

We are setting up a test lab environment with 100 machines.  We want one master testing db that gets replicated to each to run scripted application tests nightly.  

My goal is to minimize the amount of work to move this thing to each of the 100 test machines.  I am wondering if we need to even have the sql local and invest in a monster db server with 100 copies of the db we restore and each test machine point to their own db on that server, or if I should use db mirroring or something to get the master test db to each of those machines instead.

View 6 Replies View Related

SQL Server Sizing - Hardware Requirements For SQL Server 2005

Oct 24, 2006

Hi allI am having a SQL Server database of arround 110GB and 250 Users. Whatis best suited hardware requirements for handling of such a database. Iam having following requirements from the server:1. Feeding purpose : On which continously feeding is done by average200 users.2. Reporting purpose : on which average hundred of repords are runningat a time.Right now i am having two servers for both of the above said purposeswith the following configuration.Feeding ServerHPSERVER 370G43.2 Xeon Single processor3GB RAM1 SCSI 73GB 15000 RPM(OS & Transaction Log), 4 SCSI * 73GB with RAID 0(Data Files) and 2 IDE * 300GB (Backups)Reporting ServerBoard SE7520BD2V2 x XEON 3.2 GHz CPU 800 FSB with 2MB Cache4GB RAM3 SCSI * 73GB with RAID 0 (Data Files and Transaction Log), 2 SATA *300GB (Backups) , 1 80GB IDE(OS)I want to fullfill both of my requirements from a single . I want toknow what upgrades or changes I need to do in the configurationaccording to the load and performence on existing servers. Here is thetable of performence counters along with their values to show the loadand performence for both of the servers.ReportServer ValueFeedingServer ValueCounter Instance Avg. Min. Max. Avg.Min. Max.Pages/sec 0.081 0 8.001 0.020 1.993Avg. Disc Queue length _Total 18.658 13.592 51.89634.421 0 175.783% Processor Time _Total 36.841 5.469 64.45379.837 54.688 100Buffer Cache hit ratio 97.702 93.595 99.46397.41 77.261 99.989Checkpoint pages/sec 0 0 00 0 0Lazy writes/sec 1.243 0 30.003 14.2630 97.194Page life expectancy 17 4 8110 6 14Avg. DiskBytes/transfer _Total 37934.133 7903.004128427.747 53806.538 8025.801 141750.562Avg. DiskBytes/Read _Total 16737.419 8192 42895.86254228.822 8170.499 143489.965Avg. Disk Bytes/Write _Total 12298.494 0 6553611708.014 0 92842.667% Disk Time _Total 77.555 49.976 261.966 760.35612.534 4890.383Users Connections 17 17 18195 185 212Batch Requests/sec 0.859 0 2373.215 0 205.009Transactions/sec _Total 1.768 0 18.00159.314 3 241.814Page splits/sec 0 0 0 1.030 5.007Please suggest what should be the configuration for my new server.Should I consider buying an Dual Itanium Processor based system with 16Gigs of Ram and 8 Hard Disks in Raid 0. Or Should I consider buying aQuad Xeon Dual Core Processor based system. Or may be my existing HPserver can be upgraded to dual processor and 8 Gigs of Ram and 2-3 morehard disks? Pls recommend what should be the factors that sould beconsidered, guiding priciples and my approact to reach a decision.With Best RegardsParveen Beniwal

View 2 Replies View Related

Estimating Hardware Requirements For A SQL Server 2005 Installation

Jun 21, 2007

Is there any good online documentation describing rules of thumb for estimating and planning a SQL Server 2005 deployment in support of a Windows rich client/WCF services architecture?

TIA,

Ian

View 3 Replies View Related

Space Requirements For Mirrored Server In A Terabyte Environment

Dec 13, 2006

Hi,

We are migrating all dbs to SQL2005 one by one and now planning for a database mirroring. I would like to know the following:

1. My database(one main production) size on the primary is around 1TB. So having said that we are goin to have a db mirroring, do i need to have the same hardware requirements on the mirror also?? do i need 1TB space on the mirror server also? is there anyway it can use the same hardware that primary is using?

2. For the high availability configuration in mirroring, we are prefering to have a witness server too. Does the mirror server need to have same h/w configuration as the primary(64 bit, AWE, etc). Can the witness be a 32bit, 4 Gigs RAM?

Could anyone please answer the above and that will be very helpful. This is a bit urgent.

thks,

Mani

View 2 Replies View Related

SQL Server 2005 Upgrade Failure - Password Requirements

Oct 20, 2006

I am trying to do an upgrade in place from SQL Server 2000 SP3a to SQL Server 2005. I am encountering the following error. SQL Server Setup has encountered the following problem:[Microsoft][SQL Native Client][SQL Server] Password validation failed. The password does not meet Windows policy requirements because it is too short...To continue, correct the problem and then SQL Server setup again. I read the other posting and it mentioned that the sa account needs to be changed. I have changed the sa account to meet the passowrd requirements for our system and have changed the following services I could find over to my domain account which I know meets the password restrictions. If I do a new install, everything seems to load correctly. What options do I have to do this upgrade in place?

Thanks for your help,

Bill

View 5 Replies View Related

Unit Testing For SSIS - To Test Or Not To Test?

Oct 17, 2006

Now that we have a good programming model in SSIS - the question is whether to write automated unit tests for your packages, and would it generally be a good idea for packages?

Also - if yes to write tests - then where to find more informations regarding How to accomplish that?

View 1 Replies View Related

How To Test SSis Package And What Are The Things I Need To Test It ?

Nov 27, 2007



hi every one,
i need to test SSIS pacakge which will import data from different database where record count is around 5 millions.
iam planning to test it through c# code as well as manually also.
SSIS source : consist of 7 tables
SSIS destination :consist of 7 tables
Using c# code iam trying to run ssis package through batch file.
i am putting expected rowcount, column count in an excel file and comparing same with destination tables by writing query implementing ADO.Net concept.
am i going right way ,can any one suggest best and productive way to test the ssis package .
what are the other things i need to test it.
do any one can add test cases to it.






S.No

Test Case


1

Verify all the tables have been imported.



2

Verify all the rows in each table have been imported.



3

Verify all the columns specified in source query for each table have been imported


4

Verify all the data has been received without any truncation for each column.



5

Verify the schema at source and destination



6

Verify the time taken /speed for data transfer


7

Fields truncated due to difference in length of the field at destination.
Regards
Arif shareef

View 9 Replies View Related

Cannot Install SQL Server 2005 Developer Edition - Minimum Requirements

Jul 13, 2006

I do get the warning about Minimum Hardware Requirement, but can
find nothing in the detail requirements to exclude my PCs configuration.

I have installed:

IE 6.0 sp1

IIS as a part of Win 2000 Professional Edition SP4

I have also used ..aspnet_regiis -r to register ASP.NET 2.0

.NET Framework 2.0

SQL Server Native Client

SQL Server Setup support files

PC includes:

Pentium III 800 MHz

512 MB memory

HardDrive C: 5.92 GB (1.37 GB free)

HardDrive D: 13.1 GB (9.11 GB free)



I have tried several times to install SQL Server 2005 Developer Edition
(most recently from MSDN Disk 3097.1) I have tried to
complete an uninstall before each attempt.



I am, successfully, running Visual Studio 2005.



Any suggestions will be appreciated.

View 5 Replies View Related

Programming SSIS - Minimum Runtime Requirements On The Application Server

Dec 21, 2007

Hi,

I have a VB.NET program which creates a Job (Microsoft.SqlServer.Management.Smo.Agent.Job) and schedules it, to load and run a existing SSIS package, which is on a different server.

I'm using the following assemblies for this purpose.

Microsoft.SqlServer.ConnectionInfo.dll
Microsoft.SqlServer.Smo.dll
Microsoft.SqlServer.SqlEnum.dll

To make this application run in my application server, do i have to install any SQL server components or SSIS rumtime components? Or Is it enough if i copy only the above mentioned dlls to my applications bin directory, in my application?

Note: I have the enterprise edition of SQL Server 2005 installed on my database server.

Thanks in advance.

Karthik

View 4 Replies View Related

SQL Server 2012 :: SELECT Qualified Employees Based On Program Requirements

Jul 31, 2015

Basically I'm trying to produce a report that shows qualified employees for each program. Each employee can possess many qualifications. There will be no programID parameter submitted by the user. I just want to produce the report which shows the programs and the qualified employees for each. I thought I had a query that was working but once I added a different ProgramID into the ProgramModules table things went south.

Here are my tables:

tblEmployees (table of employees)
- EmployeeID
- EmployeeName

tblQualifications (table of qualifications)
- Qualification_ID
- QualificationTitle

tblEmployeeQualification (table of all employees qualifications)
-EmpQualificationID
-EmployeeID (fk for tblEmployees)
-QualificationID (fk for tblQualifications)

tblPrograms (table of programs)
-ProgramID
-ProgramTitle

tblProgramModules (table of qualifications required by each program)
-ProgramModuleID
-ProgramID (fk for tblPrograms)
-QualificationID (fk for tblQualifications)

Here is the query I was working with that works when there are only records in the ProgramModules table that use the same ProgramID

SELECT
tblProgramModules.TrainingProgramID,
tblEmployees.EmployeeID,
tblEmployees.EmployeeName

FROM
tblEmployees

[Code] .....

View 6 Replies View Related

SQL Server 2005 Incorrectly Claims I Don't Meet Minimum Service Pack Level Requirements?

Feb 10, 2006

This doesn't make any sense. I am trying to install SQL Server 2005 on SBS 2003 with Service Pack 1. According to Windows Update, there is nothing left for me to install. However, I am getting this error (while installing SQL Server Express and the Developer Edition):

"Your operating system does not meet Service Pack level requirements for this SQL Server release. Install the Service Pack from the Microsoft Download Center at http://go.microsoft.com/fwlink/?LinkId=50380, and then run SQL Server setup again."

When I go to the link, there is nothing there to download (it takes me to the main Microsoft download page). I meet all the requirements that I have found. What gives?

Thanks,

Scott

View 36 Replies View Related

How Would I Get A Subset Of This?

Apr 30, 2008

I have an employee table (empl), and a labor table (lab). The labor table is populated whenever an employee clocks in/out. If an employee does not clock in, they do not appear in the labor table.

I need to capture employees whose time is less than 8 hours, or whoever did not log in at all that date. If I run the following query without a WHERE clause, I get all of my employees, with NULL data in the labor table if they did not log in that day. This is good.

However, if I add

WHERE (DATEDIFF(s, tt.StartTime, tt.EndTime) < 28800) OR (tt.StartTime = NULL)

I get all employees whose time is less than 8 hours, but do not get any of the employees who did not work at all that date, and that's expected... there should NEVER be a NULL in the labor table - it is populated whenever somebody clocks in/out.

So, how would I query the resulting table to get those that worked less than 8 hours, and those that did not?


select
et.EmpNo
et.FirstName,
et.LastName,
tt.StartTime,
tt.EndTime,
DATEDIFF(s, tt.StartTime, tt.EndTime) as Seconds

FROM (select
empl.EmpNum as EmpNo,
empl.FFName as FirstName,
empl.FLName as LastName
from
empl where empl.ftermdate IN ('1900-01-01 00:00:00.000') AS et

LEFT JOIN (select
MIN(lab.StartDt) as StartTime,
MAX(lab.EndDt) as EndTime,
lab.WorkDt as WorkDate,
lab.EmpNum as EmpNo
from
lab where lab.WorkDt in ('2008-03-03 00:00:00.000')
group by lab.WorkDT, lab.EmpNum) AS TT

ON et.EmpNo = tt.EmpNo

View 2 Replies View Related

Can I Run SQL Server 2008 - Reporting Services CTP Until Microsoft Sells SQL 2008

Mar 31, 2008

There are a few features in the new SQL Server - Reporting Services that I really need in production. I have tested everything and it works great. I am running the CTP version since Microsoft is saying they aren't releasing the release version until 3rd quarter 2008.


Since Microsoft won't sell SQL 2008 until 3rd quarter, can I run the CTP in production until the release and then purchase SQL 2008?


Jim

View 1 Replies View Related

Seeking Advice: SQL Server On Win 2008 Virtual Server Or Just Win 2008?

Apr 23, 2008



Hello - does anyone have experience w/SQL Server 2005 in a virtual environment? I'm considering this for a production environment but not sure if performance will suffer. Our databases will have a lot of writing but not too much reading. A SSRS solution is currently the only app. connecting to the SQL db. Max users to server at any given time will be very low (~10 users max). But the databases are pulling in data from other, outside multiple data sources on a daily basis.

Any pointers to documentation or any advice?

Thanks,

A Brown

View 1 Replies View Related

Max Col In A Table Subset

May 1, 2007

hi i have a table as follows:

col1 col2 col3
2 BB 2
1 AB 3
3 CA 3
1 AC 1
2 BA 4
3 CB 2
2 BC 6
1 AA 2
3 CC 5

i want to output the whole row of each unique col1 where its col3 is max, so that i will get the ff result set
1 AB 3
2 BC 6
3 CC 5

i have an idea which is to use a cursor but i don't know the best/fastest way of doing it.
thanks heaps in advance!

View 1 Replies View Related

Subset A Dataset

Jul 11, 2007

I am trying to exclude patients from a dataset. There are multiple records per patid in this dataset. I have the following code:

SELECT meds.PATID, meds.MEDICATION, meds.MEDTYPE
FROM meds INNER JOIN patient ON meds.PATID = patient.PATID
WHERE (((meds.MEDTYPE) Not In ("FI (Fusion Inhibitor)","NNUC (","Non-nucleoside","NRTI & NNUC","NRTI (Nucleoside/tide Rev","PI (Protease Inhibitor)")));

I want to exclude all patient records if the patient had any of the above exclusions ever. If they have the exclusion if one record get rid of the rest of the records for that patient. Right now the code only excludes the particular record.

View 6 Replies View Related

Problem With Windows Server 2008 And SQL 2008 Express

Feb 25, 2008

Hello!
Recently, I set up server with Windows Web Server 2008 RC1, SQL 2008 Express beta, .NET 3.5, IIS 7.
I'm running ASP.NET web application with SQL database. Everything works fine until the first application state on the server expires. After that, any postback that starts a new application state on the server and connects to the database, results in the following error:
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
Is this a bug that will be fixed in release of Windows / SQL or am I doing something wrong?
Many thanks for help,
Jan

View 1 Replies View Related

SQL 2012 :: Restore DB From Prod To Test - How To Restore Users In Test

Jun 25, 2015

I need to restore test DB from production backup but once it is restored I would need all the permissions of sql logins and windows AD account intact in test Db as it was before.

View 4 Replies View Related

BI - Test Server

Jul 20, 2007

Hi,

I am new to BI. Can someone please tell me step by step how to setup BI test enviroment at work?

Thank you so much.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved