From fhtapia at gmail.com Mon Jun 1 07:50:26 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 1 Jun 2009 05:50:26 -0700 Subject: [dba-SQLServer] Sufficient rights In-Reply-To: <4A22FE24.9030102@colbyconsulting.com> References: <4A22FE24.9030102@colbyconsulting.com> Message-ID: I've never ran into that error before, what is the OS you rebuilt to?, which Verison of Sql Server? -Francisco http://sqlthis.blogspot.com | Tsql and More... On Sun, May 31, 2009 at 3:01 PM, jwcolby wrote: > I rebuilt one of my servers from the ground up yesterday, OS, SQL Server > etc. Now when I try to > reattach the databases I get a "create file encountered operating system > error 5" error. When I > Google that I find things that say that the user that SQL Server is trying > to use to open the files > doesn't have sufficient rights and was pointed to configuration manager / > services. > > I am in Configuration manager / services and the SQL Server Integration > Services uses the NT > Authority \ Network Services user. All the others use LocalSystem. > > What user should all of these services use, and is this even the problem? > Do these services not > have sufficient rights? These directories are on a raid array which is the > only survives over a > rebuild, were created long ago by users long since killed (by system > rebuilds). > > TIA for your help. > > BTW, I can create NEW databases (I tried), but cannot attach the existing > databases. And yes, I > detached the databases before I rebuilt the system. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Jun 1 09:05:01 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 01 Jun 2009 10:05:01 -0400 Subject: [dba-SQLServer] Sufficient rights In-Reply-To: References: <4A22FE24.9030102@colbyconsulting.com> Message-ID: <4A23E00D.7020306@colbyconsulting.com> The OS is Windows 2003, SQL Server 2005. The issue appears to be that the "owner" of the files is not the new Administrator, but rather the previous Administrator. From what I can tell the OS creates some kind of key that represents the Administrator (and in fact a different such key for every user) and this number is newly created (and random) as a user is created. I am sure you have seen a warning from Windows that if you delete a user "bad things will happen", I think it is this key will be deleted and so anything that user owned will now be orphaned. So when I created the files, the owner was represented not by the NAME administrator, but rather a "key" for the OLD administrator. When I rebuilt the system, the new Administrator got a new key, and thus the keys didn't match, and the new Administrator didn't own the file. I found a place in properties to take possession of a directory (or drive) and all the subdirectories / files below it, and did so. THAT problem went away. However the new owner did not have ALL rights to the files by default. I have to go in and give the new owner all rights, and then things work just as expected. Rather a PITA all around. I am actually back functioning again, grabbed ownership, set the files (databases) to full rights etc. and reattached the databases. It is just a bit of work to do all of that stuff. My guess is that there is no way around this. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > I've never ran into that error before, what is the OS you rebuilt to?, which > Verison of Sql Server? > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Sun, May 31, 2009 at 3:01 PM, jwcolby wrote: > >> I rebuilt one of my servers from the ground up yesterday, OS, SQL Server >> etc. Now when I try to >> reattach the databases I get a "create file encountered operating system >> error 5" error. When I >> Google that I find things that say that the user that SQL Server is trying >> to use to open the files >> doesn't have sufficient rights and was pointed to configuration manager / >> services. >> >> I am in Configuration manager / services and the SQL Server Integration >> Services uses the NT >> Authority \ Network Services user. All the others use LocalSystem. >> >> What user should all of these services use, and is this even the problem? >> Do these services not >> have sufficient rights? These directories are on a raid array which is the >> only survives over a >> rebuild, were created long ago by users long since killed (by system >> rebuilds). >> >> TIA for your help. >> >> BTW, I can create NEW databases (I tried), but cannot attach the existing >> databases. And yes, I >> detached the databases before I rebuilt the system. >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From sdunlap at brownshoe.com Mon Jun 1 12:06:24 2009 From: sdunlap at brownshoe.com (sdunlap at brownshoe.com) Date: Mon, 1 Jun 2009 12:06:24 -0500 Subject: [dba-SQLServer] Stuart Dunlap is out of the office. Message-ID: I will be out of the office starting 06/01/2009 and will not return until 06/02/2009. I will respond to your message when I return. From jwcolby at colbyconsulting.com Mon Jun 1 20:18:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 01 Jun 2009 21:18:13 -0400 Subject: [dba-SQLServer] SQL Server name does not match @@Server Message-ID: <4A247DD5.1050500@colbyconsulting.com> My SQL Server instance APPEARS to be named Stonehenge, the machine is named Stonehenge, but @@ServerName returns Colby-1393B53EE. AFAICR in the previous install it was named Stonehenge. Is this going to cause me a problem? I am trying to execute code: bcp "SELECT * FROM dbo.DataDepot_vPSMOrderAccuzipOut" queryout E:\PSM\Data\DataDepot\AccuzipInputTo\DataDepot_0MTo1000M.txt -c -t, -T -S COLBY-1393B53EE (@@ServerName) and getting an error: SQLState = 08001, NativeError = 53 Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [53]. SQLState = 08001, NativeError = 53 Error = [Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connecti ons. SQLState = S1T00, NativeError = 0 Error = [Microsoft][SQL Native Client]Login timeout expired NULL If I had to guess (which I have to do) I would say the @@Server is not returning what the BCP expects to see. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Jun 1 20:46:16 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 01 Jun 2009 21:46:16 -0400 Subject: [dba-SQLServer] SPAM-LOW: SQL Server name does not match @@Server In-Reply-To: <4A247DD5.1050500@colbyconsulting.com> References: <4A247DD5.1050500@colbyconsulting.com> Message-ID: <4A248468.9050207@colbyconsulting.com> Hey, I am slowly getting better at this stuff. That was indeed the problem. As soon as I renamed the sql server instance using code I found on Google the BCP stuff worked. Yea! John W. Colby www.ColbyConsulting.com jwcolby wrote: > My SQL Server instance APPEARS to be named Stonehenge, the machine is named Stonehenge, but > @@ServerName returns Colby-1393B53EE. AFAICR in the previous install it was named Stonehenge. > > Is this going to cause me a problem? > > I am trying to execute code: > > bcp "SELECT * FROM dbo.DataDepot_vPSMOrderAccuzipOut" queryout > E:\PSM\Data\DataDepot\AccuzipInputTo\DataDepot_0MTo1000M.txt -c -t, -T -S COLBY-1393B53EE (@@ServerName) > > and getting an error: > > SQLState = 08001, NativeError = 53 > Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not open a connection to SQL > Server [53]. > SQLState = 08001, NativeError = 53 > Error = [Microsoft][SQL Native Client]An error has occurred while establishing a connection to the > server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the > default settings SQL Server does not allow remote connecti > ons. > SQLState = S1T00, NativeError = 0 > Error = [Microsoft][SQL Native Client]Login timeout expired > NULL > > If I had to guess (which I have to do) I would say the @@Server is not returning what the BCP > expects to see. > From fhtapia at gmail.com Tue Jun 2 09:40:33 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 2 Jun 2009 07:40:33 -0700 Subject: [dba-SQLServer] SQL Server name does not match @@Server In-Reply-To: <4A247DD5.1050500@colbyconsulting.com> References: <4A247DD5.1050500@colbyconsulting.com> Message-ID: Did you rename your host machine? It looks like it because otherwise the @@ServerName is the same as the host name of the computer. In Sql Server 2000 and 7.0 iirc, you had to drop and re-add the server name like so: sp_dropserver 'old server name' sp_addserver 'new server name' , 'local' -Francisco http://sqlthis.blogspot.com | Tsql and More... On Mon, Jun 1, 2009 at 6:18 PM, jwcolby wrote: > My SQL Server instance APPEARS to be named Stonehenge, the machine is named > Stonehenge, but > @@ServerName returns Colby-1393B53EE. AFAICR in the previous install it > was named Stonehenge. > > Is this going to cause me a problem? > > I am trying to execute code: > > bcp "SELECT * FROM dbo.DataDepot_vPSMOrderAccuzipOut" queryout > E:\PSM\Data\DataDepot\AccuzipInputTo\DataDepot_0MTo1000M.txt -c -t, -T -S > COLBY-1393B53EE (@@ServerName) > > and getting an error: > > SQLState = 08001, NativeError = 53 > Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not open > a connection to SQL > Server [53]. > SQLState = 08001, NativeError = 53 > Error = [Microsoft][SQL Native Client]An error has occurred while > establishing a connection to the > server. When connecting to SQL Server 2005, this failure may be caused by > the fact that under the > default settings SQL Server does not allow remote connecti > ons. > SQLState = S1T00, NativeError = 0 > Error = [Microsoft][SQL Native Client]Login timeout expired > NULL > > If I had to guess (which I have to do) I would say the @@Server is not > returning what the BCP > expects to see. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Tue Jun 2 09:41:31 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 2 Jun 2009 07:41:31 -0700 Subject: [dba-SQLServer] SPAM-LOW: SQL Server name does not match @@Server In-Reply-To: <4A248468.9050207@colbyconsulting.com> References: <4A247DD5.1050500@colbyconsulting.com> <4A248468.9050207@colbyconsulting.com> Message-ID: is that your software tagging your own email as spam? :) that's pretty smart software you have there John! :-P -Francisco http://sqlthis.blogspot.com | Tsql and More... On Mon, Jun 1, 2009 at 6:46 PM, jwcolby wrote: > Hey, I am slowly getting better at this stuff. That was indeed the > problem. As soon as I renamed > the sql server instance using code I found on Google the BCP stuff worked. > > Yea! > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: > > My SQL Server instance APPEARS to be named Stonehenge, the machine is > named Stonehenge, but > > @@ServerName returns Colby-1393B53EE. AFAICR in the previous install it > was named Stonehenge. > > > > Is this going to cause me a problem? > > > > I am trying to execute code: > > > > bcp "SELECT * FROM dbo.DataDepot_vPSMOrderAccuzipOut" queryout > > E:\PSM\Data\DataDepot\AccuzipInputTo\DataDepot_0MTo1000M.txt -c -t, -T -S > COLBY-1393B53EE (@@ServerName) > > > > and getting an error: > > > > SQLState = 08001, NativeError = 53 > > Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not > open a connection to SQL > > Server [53]. > > SQLState = 08001, NativeError = 53 > > Error = [Microsoft][SQL Native Client]An error has occurred while > establishing a connection to the > > server. When connecting to SQL Server 2005, this failure may be caused by > the fact that under the > > default settings SQL Server does not allow remote connecti > > ons. > > SQLState = S1T00, NativeError = 0 > > Error = [Microsoft][SQL Native Client]Login timeout expired > > NULL > > > > If I had to guess (which I have to do) I would say the @@Server is not > returning what the BCP > > expects to see. > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jun 2 09:54:25 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 02 Jun 2009 10:54:25 -0400 Subject: [dba-SQLServer] SPAM-LOW: SQL Server name does not match @@Server In-Reply-To: References: <4A247DD5.1050500@colbyconsulting.com> <4A248468.9050207@colbyconsulting.com> Message-ID: <4A253D21.3010401@colbyconsulting.com> LOL, it's just Thunderbird. All of the AccessD stuff looks like spam to Thunderbird, no matter how many times I say it isn't. So I guess it isn't such smart software. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > is that your software tagging your own email as spam? :) that's pretty smart > software you have there John! :-P > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Mon, Jun 1, 2009 at 6:46 PM, jwcolby wrote: > >> Hey, I am slowly getting better at this stuff. That was indeed the >> problem. As soon as I renamed >> the sql server instance using code I found on Google the BCP stuff worked. >> >> Yea! >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> jwcolby wrote: >>> My SQL Server instance APPEARS to be named Stonehenge, the machine is >> named Stonehenge, but >>> @@ServerName returns Colby-1393B53EE. AFAICR in the previous install it >> was named Stonehenge. >>> Is this going to cause me a problem? >>> >>> I am trying to execute code: >>> >>> bcp "SELECT * FROM dbo.DataDepot_vPSMOrderAccuzipOut" queryout >>> E:\PSM\Data\DataDepot\AccuzipInputTo\DataDepot_0MTo1000M.txt -c -t, -T -S >> COLBY-1393B53EE (@@ServerName) >>> and getting an error: >>> >>> SQLState = 08001, NativeError = 53 >>> Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not >> open a connection to SQL >>> Server [53]. >>> SQLState = 08001, NativeError = 53 >>> Error = [Microsoft][SQL Native Client]An error has occurred while >> establishing a connection to the >>> server. When connecting to SQL Server 2005, this failure may be caused by >> the fact that under the >>> default settings SQL Server does not allow remote connecti >>> ons. >>> SQLState = S1T00, NativeError = 0 >>> Error = [Microsoft][SQL Native Client]Login timeout expired >>> NULL >>> >>> If I had to guess (which I have to do) I would say the @@Server is not >> returning what the BCP >>> expects to see. >>> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jun 2 10:07:04 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 02 Jun 2009 11:07:04 -0400 Subject: [dba-SQLServer] SPAM-LOW: Re: SQL Server name does not match @@Server In-Reply-To: References: <4A247DD5.1050500@colbyconsulting.com> Message-ID: <4A254018.1000508@colbyconsulting.com> I did rename the machine, and I discovered that SP_DropServer thing while Googling the problem. That fixed it. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > Did you rename your host machine? It looks like it because otherwise the > @@ServerName is the same as the host name of the computer. In Sql Server > 2000 and 7.0 iirc, you had to drop and re-add the server name like so: > sp_dropserver 'old server name' > sp_addserver 'new server name' , 'local' > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Mon, Jun 1, 2009 at 6:18 PM, jwcolby wrote: > >> My SQL Server instance APPEARS to be named Stonehenge, the machine is named >> Stonehenge, but >> @@ServerName returns Colby-1393B53EE. AFAICR in the previous install it >> was named Stonehenge. >> >> Is this going to cause me a problem? >> >> I am trying to execute code: >> >> bcp "SELECT * FROM dbo.DataDepot_vPSMOrderAccuzipOut" queryout >> E:\PSM\Data\DataDepot\AccuzipInputTo\DataDepot_0MTo1000M.txt -c -t, -T -S >> COLBY-1393B53EE (@@ServerName) >> >> and getting an error: >> >> SQLState = 08001, NativeError = 53 >> Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not open >> a connection to SQL >> Server [53]. >> SQLState = 08001, NativeError = 53 >> Error = [Microsoft][SQL Native Client]An error has occurred while >> establishing a connection to the >> server. When connecting to SQL Server 2005, this failure may be caused by >> the fact that under the >> default settings SQL Server does not allow remote connecti >> ons. >> SQLState = S1T00, NativeError = 0 >> Error = [Microsoft][SQL Native Client]Login timeout expired >> NULL >> >> If I had to guess (which I have to do) I would say the @@Server is not >> returning what the BCP >> expects to see. >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jun 2 19:59:26 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 02 Jun 2009 20:59:26 -0400 Subject: [dba-SQLServer] Optimizing my SQL Server for speed Message-ID: <4A25CAEE.2060700@colbyconsulting.com> I am running a pair of homebuilt servers, Quad core, 8 gigs RAM, Windows 2003 x64, SQL Server 2005 x64. I use an Areca hardware raid controller and have an 8 (500 gig) disk Raid 6 array. I am about to replace those disks with 5 (1 TB) disks Raid 6. Obviously I will lose a bit of speed in the process since I have fewer disks in the array, though I will eventually fill out the array with 3 more disks for a total of 8. Maybe. My question concerns how to physically implement the database. I know very little about the details of file groups, disks for log files and so forth, splitting out indexes etc. The databases are essentially read only under normal use. Because of the size of the databases, anywhere from 50 million records and up, as many as 640 fields in one, but more common 60 to 100 fields, I tend to set up what I know as "cover indexes". I am considering going to a pair of 120 g SSDs to house one specific database that is kind of the center of my data universe. In this database, 50 million records, 640 fields, I will create these indexes to place the PK and anywhere from a few to a dozen or more fields into an index. That index then provides all of the fields needed to supply all of the where clause. My question really is, if I am successful in getting the index to supply all of the data, should the INDEXES go in the SSD and the main table just sit out on the raid array? How do I go about specifying where indexes are physically placed? Next question is related, what about the log files? I could put the log files on a non raid disk connected directly to the motherboard, or on a pair of disks mirrored on the Areca Raid controller (if redundancy is important) or even a pair of disks in Raid 0 if redundancy is not important but speed is. As I said, I am rebuilding this thing and want to take this opportunity to think about how to distribute the parts of the databases, and I know absolutely nothing about this side of things. Any thoughts on this? TIA, -- John W. Colby www.ColbyConsulting.com From fuller.artful at gmail.com Wed Jun 3 08:09:00 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Wed, 3 Jun 2009 09:09:00 -0400 Subject: [dba-SQLServer] Fwd: Optimizing my SQL Server for speed In-Reply-To: References: <4A25CAEE.2060700@colbyconsulting.com> <29f585dd0906030530q3ae208adv676ea7f2e9d5d0a0@mail.gmail.com> Message-ID: <29f585dd0906030609w25589715lb97c02124b8aa0b7@mail.gmail.com> JC, I forwarded your post to my friend Dejan. Here is his reply. A. ---------- Forwarded message ---------- From: Dejan Sunderic Date: 2009/6/3 Subject: RE: [dba-SQLServer] Optimizing my SQL Server for speed To: Arthur Fuller , jwcolby at colbyconsulting.com > My question really is, if I am successful in getting the index to supply all of the data, should the INDEXES go in the SSD and the main table just sit out on the raid array? That would iprove their performance. > How do I go about specifying where indexes are physically placed? Create Index statement contains a segment for specifying the file group. > Next question is related, what about the log files? I could put the log files on a non raid disk connected directly to the motherboard, or on a pair of disks mirrored on the Areca Raid controller (if redundancy is important) or even a pair of disks in Raid 0 if redundancy is not important but speed is. Redandancy is typically critical. But if loading performance is not an issue for teh system, you can even leave it on RAID6. I do not see scenario for logs on RAID0. Dejan ?underi? Database Architect www.trigonblue.com www.tsql.ca ------------------------------ Date: Wed, 3 Jun 2009 08:30:55 -0400 Subject: Fwd: [dba-SQLServer] Optimizing my SQL Server for speed From: fuller.artful at gmail.com To: dejans at hotmail.com I'm forwarding this from my friend John Colby. Do you have any suggestions for him? Thanks, Arthur ---------- Forwarded message ---------- From: *jwcolby* Date: Tue, Jun 2, 2009 at 8:59 PM Subject: [dba-SQLServer] Optimizing my SQL Server for speed To: Dba-Sqlserver I am running a pair of homebuilt servers, Quad core, 8 gigs RAM, Windows 2003 x64, SQL Server 2005 x64. I use an Areca hardware raid controller and have an 8 (500 gig) disk Raid 6 array. I am about to replace those disks with 5 (1 TB) disks Raid 6. Obviously I will lose a bit of speed in the process since I have fewer disks in the array, though I will eventually fill out the array with 3 more disks for a total of 8. Maybe. My question concerns how to physically implement the database. I know very little about the details of file groups, disks for log files and so forth, splitting out indexes etc. The databases are essentially read only under normal use. Because of the size of the databases, anywhere from 50 million records and up, as many as 640 fields in one, but more common 60 to 100 fields, I tend to set up what I know as "cover indexes". I am considering going to a pair of 120 g SSDs to house one specific database that is kind of the center of my data universe. In this database, 50 million records, 640 fields, I will create these indexes to place the PK and anywhere from a few to a dozen or more fields into an index. That index then provides all of the fields needed to supply all of the where clause. My question really is, if I am successful in getting the index to supply all of the data, should the INDEXES go in the SSD and the main table just sit out on the raid array? How do I go about specifying where indexes are physically placed? Next question is related, what about the log files? I could put the log files on a non raid disk connected directly to the motherboard, or on a pair of disks mirrored on the Areca Raid controller (if redundancy is important) or even a pair of disks in Raid 0 if redundancy is not important but speed is. As I said, I am rebuilding this thing and want to take this opportunity to think about how to distribute the parts of the databases, and I know absolutely nothing about this side of things. Any thoughts on this? TIA, -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com ------------------------------ We are your photos. Share us now with Windows Live Photos. From jwcolby at colbyconsulting.com Thu Jun 4 12:31:09 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 04 Jun 2009 13:31:09 -0400 Subject: [dba-SQLServer] Moving stored procedures from the Master DB Message-ID: <4A2804DD.5020301@colbyconsulting.com> I have a dozen or so stored procedures in the master database. I am rebuilding my servers and need to move those stored procedures to the Master db on the other server. How do I do this? -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Thu Jun 4 12:57:08 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 4 Jun 2009 10:57:08 -0700 Subject: [dba-SQLServer] Moving stored procedures from the Master DB In-Reply-To: <4A2804DD.5020301@colbyconsulting.com> References: <4A2804DD.5020301@colbyconsulting.com> Message-ID: using management studio you can script each one out. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Thu, Jun 4, 2009 at 10:31 AM, jwcolby wrote: > I have a dozen or so stored procedures in the master database. I am > rebuilding my servers and need > to move those stored procedures to the Master db on the other server. How > do I do this? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Jun 4 13:14:07 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 04 Jun 2009 14:14:07 -0400 Subject: [dba-SQLServer] Moving stored procedures from the Master DB In-Reply-To: References: <4A2804DD.5020301@colbyconsulting.com> Message-ID: <4A280EEF.3030204@colbyconsulting.com> > using management studio you can script each one out. Directly into the other database? To a file and move the file? I know how to deal with database files but not things like stored procedures. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > using management studio you can script each one out. > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Thu, Jun 4, 2009 at 10:31 AM, jwcolby wrote: > >> I have a dozen or so stored procedures in the master database. I am >> rebuilding my servers and need >> to move those stored procedures to the Master db on the other server. How >> do I do this? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Thu Jun 4 13:16:32 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 4 Jun 2009 11:16:32 -0700 Subject: [dba-SQLServer] Moving stored procedures from the Master DB In-Reply-To: <4A280EEF.3030204@colbyconsulting.com> References: <4A2804DD.5020301@colbyconsulting.com> <4A280EEF.3030204@colbyconsulting.com> Message-ID: Easiest way would be to save them all to a file, then you can copy all of them and drop them in as one command and re-create all your sprocs in one motion... -Francisco http://sqlthis.blogspot.com | Tsql and More... On Thu, Jun 4, 2009 at 11:14 AM, jwcolby wrote: > > using management studio you can script each one out. > > Directly into the other database? To a file and move the file? I know how > to deal with database > files but not things like stored procedures. > > John W. Colby > www.ColbyConsulting.com > > > Francisco Tapia wrote: > > using management studio you can script each one out. > > > > -Francisco > > http://sqlthis.blogspot.com | Tsql and More... > > > > > > On Thu, Jun 4, 2009 at 10:31 AM, jwcolby >wrote: > > > >> I have a dozen or so stored procedures in the master database. I am > >> rebuilding my servers and need > >> to move those stored procedures to the Master db on the other server. > How > >> do I do this? > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-SQLServer mailing list > >> dba-SQLServer at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Thu Jun 4 13:37:04 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 4 Jun 2009 11:37:04 -0700 Subject: [dba-SQLServer] Optimizing my SQL Server for speed In-Reply-To: <4A25CAEE.2060700@colbyconsulting.com> References: <4A25CAEE.2060700@colbyconsulting.com> Message-ID: Some of the things you can do at this time is to check where your biggest bottle necks are with your existing setup.. IF, your biggest problem at this time is I/O, then 1) I would place all transaction logs on a SEPARATE bus and Disk system. This will help when you need to import / update a lot of records (from the sound of your system it seems like a whole lot). 2) I would place your TEMP DB on a separate bus and Disk system as well. Because you create a lot of reports with order by's and group by's... I suggest FAST disks, they don't need to be huge, but should stand to be as big as your biggest possible recordset maybe between 100-500gb by the sound of your system. 3) Raid out your Database. a) place your tables into specific filegroups. Filegroups can help out by separating heavily used tables from tables that do not get used as much. The advantage is that you can have multiple threads running and gain performance by not technically reading from the same file. b) If it's possible you can place filegroups into different raid clusters, this way you can buy superfast drives for the busy tables, and save money by storing less likely used tables into filegroups that are used least often. Lastly, RAM... Really you need a lot to keep your cachehit ratio up, I'd run profiler to see if you are keeping over 90% in cache or if it all is falling out (so you are paging). The only way to use a lot of Ram with sql server 2005 is to go with their enterprise license this allows your sql server to use as much ram as you can afford. CPU... I don't know your system, but you may want to review how pegged your systems get More Cores are useful, but you will also need to adjust the CPU settings so that you allow the OS to keep a CPU to perform the normal tasks such as paging etc. I hope this information helps. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Jun 2, 2009 at 5:59 PM, jwcolby wrote: > I am running a pair of homebuilt servers, Quad core, 8 gigs RAM, Windows > 2003 x64, SQL Server 2005 > x64. I use an Areca hardware raid controller and have an 8 (500 gig) disk > Raid 6 array. I am about > to replace those disks with 5 (1 TB) disks Raid 6. Obviously I will lose a > bit of speed in the > process since I have fewer disks in the array, though I will eventually > fill out the array with 3 > more disks for a total of 8. Maybe. > > My question concerns how to physically implement the database. I know very > little about the details > of file groups, disks for log files and so forth, splitting out indexes > etc. > > The databases are essentially read only under normal use. Because of the > size of the databases, > anywhere from 50 million records and up, as many as 640 fields in one, but > more common 60 to 100 > fields, I tend to set up what I know as "cover indexes". > > I am considering going to a pair of 120 g SSDs to house one specific > database that is kind of the > center of my data universe. In this database, 50 million records, 640 > fields, I will create these > indexes to place the PK and anywhere from a few to a dozen or more fields > into an index. That index > then provides all of the fields needed to supply all of the where clause. > > My question really is, if I am successful in getting the index to supply > all of the data, should the > INDEXES go in the SSD and the main table just sit out on the raid array? > How do I go about > specifying where indexes are physically placed? > > Next question is related, what about the log files? I could put the log > files on a non raid disk > connected directly to the motherboard, or on a pair of disks mirrored on > the Areca Raid controller > (if redundancy is important) or even a pair of disks in Raid 0 if > redundancy is not important but > speed is. > > As I said, I am rebuilding this thing and want to take this opportunity to > think about how to > distribute the parts of the databases, and I know absolutely nothing about > this side of things. > > Any thoughts on this? > > TIA, > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Jun 5 13:45:02 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 05 Jun 2009 14:45:02 -0400 Subject: [dba-SQLServer] Can't drop view Message-ID: <4A2967AE.8060200@colbyconsulting.com> I have a stored procedure that drops and dynamically rebuilds a view. This stored procedure suddenly fails. It turns out that the view that the SP was trying to drop referenced a non-existent table. I could not even "compile" the sp. BTW, what do you call the execute phase when you are editing a stored procedure - as opposed to actually running the stored procedure using EXEC()? Anyway, when I tried to perform that step it gave me error messages. Apparently the SP tries to open the view and if the view is bad it barfs. From my perspective, I don't care if the view is bad because I am going to drop the view anyway and rebuild it from scratch. Unfortunately if the SP won't run then I can't drop the bad view. Not good. So I went in and manually deleted the view and the stored procedure runs as I intended. Is there any way to programmatically drop a view that references a non-existent table, or has any other error that would prevent the view from running? -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Fri Jun 5 14:40:52 2009 From: ebarro at verizon.net (Eric Barro) Date: Fri, 05 Jun 2009 12:40:52 -0700 Subject: [dba-SQLServer] Can't drop view In-Reply-To: <4A2967AE.8060200@colbyconsulting.com> References: <4A2967AE.8060200@colbyconsulting.com> Message-ID: <868FC331CDCE458887C889B7E3D0737F@advancedinput.com> Why are you rebuilding the view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, June 05, 2009 11:45 AM To: Dba-Sqlserver Subject: [dba-SQLServer] Can't drop view I have a stored procedure that drops and dynamically rebuilds a view. This stored procedure suddenly fails. It turns out that the view that the SP was trying to drop referenced a non-existent table. I could not even "compile" the sp. BTW, what do you call the execute phase when you are editing a stored procedure - as opposed to actually running the stored procedure using EXEC()? Anyway, when I tried to perform that step it gave me error messages. Apparently the SP tries to open the view and if the view is bad it barfs. >From my perspective, I don't care if the view is bad because I am going to drop the view anyway and rebuild it from scratch. Unfortunately if the SP won't run then I can't drop the bad view. Not good. So I went in and manually deleted the view and the stored procedure runs as I intended. Is there any way to programmatically drop a view that references a non-existent table, or has any other error that would prevent the view from running? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jun 5 14:53:04 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 05 Jun 2009 15:53:04 -0400 Subject: [dba-SQLServer] Can't drop view In-Reply-To: <868FC331CDCE458887C889B7E3D0737F@advancedinput.com> References: <4A2967AE.8060200@colbyconsulting.com> <868FC331CDCE458887C889B7E3D0737F@advancedinput.com> Message-ID: <4A2977A0.40503@colbyconsulting.com> The view is used at a later step in a process and has varying fields. John W. Colby www.ColbyConsulting.com Eric Barro wrote: > Why are you rebuilding the view? > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, June 05, 2009 11:45 AM > To: Dba-Sqlserver > Subject: [dba-SQLServer] Can't drop view > > I have a stored procedure that drops and dynamically rebuilds a view. This > stored procedure suddenly fails. It turns out that the view that the SP was > trying to drop referenced a non-existent table. I could not even "compile" > the sp. BTW, what do you call the execute phase when you are editing a > stored procedure - as opposed to actually running the stored procedure using > EXEC()? > > Anyway, when I tried to perform that step it gave me error messages. > Apparently the SP tries to open the view and if the view is bad it barfs. >>From my perspective, I don't care if the view is bad because I am going to > drop the view anyway and rebuild it from scratch. Unfortunately if the SP > won't run then I can't drop the bad view. Not good. > > So I went in and manually deleted the view and the stored procedure runs as > I intended. > > Is there any way to programmatically drop a view that references a > non-existent table, or has any other error that would prevent the view from > running? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Fri Jun 5 15:32:03 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 5 Jun 2009 13:32:03 -0700 Subject: [dba-SQLServer] Can't drop view In-Reply-To: <4A2977A0.40503@colbyconsulting.com> References: <4A2967AE.8060200@colbyconsulting.com> <868FC331CDCE458887C889B7E3D0737F@advancedinput.com> <4A2977A0.40503@colbyconsulting.com> Message-ID: What is the code you are using? is it just DROP VIEW vwMyView what is the error message, a lot of times you can use a Try Catch to move around the error messages to allow your sproc to continue running. Post a snippet of the code and the error message I'll try to re-create the error here. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Fri, Jun 5, 2009 at 12:53 PM, jwcolby wrote: > The view is used at a later step in a process and has varying fields. > > John W. Colby > www.ColbyConsulting.com > > > Eric Barro wrote: > > Why are you rebuilding the view? > > > > -----Original Message----- > > From: dba-sqlserver-bounces at databaseadvisors.com > > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Friday, June 05, 2009 11:45 AM > > To: Dba-Sqlserver > > Subject: [dba-SQLServer] Can't drop view > > > > I have a stored procedure that drops and dynamically rebuilds a view. > This > > stored procedure suddenly fails. It turns out that the view that the SP > was > > trying to drop referenced a non-existent table. I could not even > "compile" > > the sp. BTW, what do you call the execute phase when you are editing a > > stored procedure - as opposed to actually running the stored procedure > using > > EXEC()? > > > > Anyway, when I tried to perform that step it gave me error messages. > > Apparently the SP tries to open the view and if the view is bad it barfs. > >>From my perspective, I don't care if the view is bad because I am going > to > > drop the view anyway and rebuild it from scratch. Unfortunately if the > SP > > won't run then I can't drop the bad view. Not good. > > > > So I went in and manually deleted the view and the stored procedure runs > as > > I intended. > > > > Is there any way to programmatically drop a view that references a > > non-existent table, or has any other error that would prevent the view > from > > running? > > > > -- > > John W. Colby > > www.ColbyConsulting.com > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Jun 5 18:27:07 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 05 Jun 2009 19:27:07 -0400 Subject: [dba-SQLServer] Can't drop view In-Reply-To: References: <4A2967AE.8060200@colbyconsulting.com> <868FC331CDCE458887C889B7E3D0737F@advancedinput.com> <4A2977A0.40503@colbyconsulting.com> Message-ID: <4A29A9CB.1060200@colbyconsulting.com> > is it just DROP VIEW vwMyView Yes. I deleted the view manually and went on with my work. The idea is to drop, then recreate the view. If it can't be dropped, then the recreate fails as well. The view was definitely bad, if I opened it manually it was trying to reference a table that simply did not exist. I imagine that this process created the view at some point im time that the table DID exist and then ... In any event, this is why I have to get error reporting back into the Access application. As it happens I was running this (it was an order I am processing) directly from a SP that runs other SPs. It also happens that this SP was the last SP in the line and I didn't have to have it working. However in any case I just deleted the view, and ran it again. The drop view is designed to print an error but may in fact be valid if (as in this case) there is no view to drop. The bigger problem is that the entire SP failed to run because the missing table in the view being dropped triggered an error that "bubbled up" (the only way I can describe it) into the SP error reporting. It was rather confusing at first because the name of the table wasn't ANYWHERE in my SP. It was in fact down in the view about to be dropped. Sigh. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > What is the code you are using? > > is it just DROP VIEW vwMyView > > what is the error message, a lot of times you can use a Try Catch to move > around the error messages to allow your sproc to continue running. Post a > snippet of the code and the error message I'll try to re-create the error > here. > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Fri, Jun 5, 2009 at 12:53 PM, jwcolby wrote: > >> The view is used at a later step in a process and has varying fields. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Eric Barro wrote: >>> Why are you rebuilding the view? >>> >>> -----Original Message----- >>> From: dba-sqlserver-bounces at databaseadvisors.com >>> [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: Friday, June 05, 2009 11:45 AM >>> To: Dba-Sqlserver >>> Subject: [dba-SQLServer] Can't drop view >>> >>> I have a stored procedure that drops and dynamically rebuilds a view. >> This >>> stored procedure suddenly fails. It turns out that the view that the SP >> was >>> trying to drop referenced a non-existent table. I could not even >> "compile" >>> the sp. BTW, what do you call the execute phase when you are editing a >>> stored procedure - as opposed to actually running the stored procedure >> using >>> EXEC()? >>> >>> Anyway, when I tried to perform that step it gave me error messages. >>> Apparently the SP tries to open the view and if the view is bad it barfs. >>> >From my perspective, I don't care if the view is bad because I am going >> to >>> drop the view anyway and rebuild it from scratch. Unfortunately if the >> SP >>> won't run then I can't drop the bad view. Not good. >>> >>> So I went in and manually deleted the view and the stored procedure runs >> as >>> I intended. >>> >>> Is there any way to programmatically drop a view that references a >>> non-existent table, or has any other error that would prevent the view >> from >>> running? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-SQLServer mailing list >>> dba-SQLServer at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>> http://www.databaseadvisors.com >>> >>> _______________________________________________ >>> dba-SQLServer mailing list >>> dba-SQLServer at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Jun 8 08:16:03 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 08 Jun 2009 09:16:03 -0400 Subject: [dba-SQLServer] Delete first record Message-ID: <4A2D0F13.3060301@colbyconsulting.com> Is there any way to delete the first record in a table in SQL Server. I am importing a csv file into a temp table, and from there appending the data to a permanent table. The csv has the field names in the first row. When I try to append to the permanent table the append fails because the row name fields aren't the correct data types, thus I need to just delete that first row. -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Mon Jun 8 08:37:34 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 8 Jun 2009 06:37:34 -0700 Subject: [dba-SQLServer] Delete first record In-Reply-To: <4A2D0F13.3060301@colbyconsulting.com> References: <4A2D0F13.3060301@colbyconsulting.com> Message-ID: if your field labels are always at pkid 1, you'd want to just say delete from mytable where pkid = 1 -Francisco http://sqlthis.blogspot.com | Tsql and More... On Mon, Jun 8, 2009 at 6:16 AM, jwcolby wrote: > Is there any way to delete the first record in a table in SQL Server. I am > importing a csv file > into a temp table, and from there appending the data to a permanent table. > The csv has the field > names in the first row. When I try to append to the permanent table the > append fails because the > row name fields aren't the correct data types, thus I need to just delete > that first row. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Jun 8 09:03:35 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 08 Jun 2009 10:03:35 -0400 Subject: [dba-SQLServer] Delete first record In-Reply-To: References: <4A2D0F13.3060301@colbyconsulting.com> Message-ID: <4A2D1A37.7010702@colbyconsulting.com> > delete from mytable where pk = 'PK' ROTFL. Duh! Thanks, John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > if your field labels are always at pkid 1, you'd want to just say > > delete from mytable > where pkid = 1 > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Mon, Jun 8, 2009 at 6:16 AM, jwcolby wrote: > >> Is there any way to delete the first record in a table in SQL Server. I am >> importing a csv file >> into a temp table, and from there appending the data to a permanent table. >> The csv has the field >> names in the first row. When I try to append to the permanent table the >> append fails because the >> row name fields aren't the correct data types, thus I need to just delete >> that first row. >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From paul.hartland at googlemail.com Mon Jun 8 10:14:50 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Mon, 8 Jun 2009 16:14:50 +0100 Subject: [dba-SQLServer] Counting Pages For Sub Query In SSRS 2005 Message-ID: <38c884770906080814x4fad5535o9e3350ea345d87cf@mail.gmail.com> To all, Been on this all day and have yet to come up with a good idea that works well, we produce a report (SSRS 2005) on a weekly basis that we send out to all our employees, telling them dates & locations of jobs that they are on. What has been suggest is that we put page x of y, in the header of the report so that the person knows that they have received all their required pages of work. In the main body of the report, their is a table with the persons job details. In one of the footer lines of the table are two sub-queries which then list all the people that are also on that job. This can increment/decrement drastically, i.e. one day they will be on a job with two other people the next day they could be part of a group of 50+, so the pages numbers vary depending on the jobs they are put on. Does anybody know how I can show the page x of y for this ? Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From fhtapia at gmail.com Mon Jun 8 11:15:27 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 8 Jun 2009 09:15:27 -0700 Subject: [dba-SQLServer] Counting Pages For Sub Query In SSRS 2005 In-Reply-To: <38c884770906080814x4fad5535o9e3350ea345d87cf@mail.gmail.com> References: <38c884770906080814x4fad5535o9e3350ea345d87cf@mail.gmail.com> Message-ID: in SSRS 2K we used to do this in the footer with a text control and the following function from the globals group like so: ="Page " & Globals!PageNumber & " of " & Globals!TotalPages -Francisco http://sqlthis.blogspot.com | Tsql and More... On Mon, Jun 8, 2009 at 8:14 AM, Paul Hartland wrote: > To all, > > Been on this all day and have yet to come up with a good idea that works > well, we produce a report (SSRS 2005) on a weekly basis that we send out to > all our employees, telling them dates & locations of jobs that they are on. > > What has been suggest is that we put page x of y, in the header of the > report so that the person knows that they have received all their required > pages of work. > > In the main body of the report, their is a table with the persons job > details. In one of the footer lines of the table are two sub-queries which > then list all the people that are also on that job. This can > increment/decrement drastically, i.e. one day they will be on a job with > two > other people the next day they could be part of a group of 50+, so the > pages > numbers vary depending on the jobs they are put on. > > Does anybody know how I can show the page x of y for this ? > > Thanks in advance for any help on this. > > -- > Paul Hartland > paul.hartland at googlemail.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From paul.hartland at googlemail.com Tue Jun 9 01:11:15 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Tue, 9 Jun 2009 07:11:15 +0100 Subject: [dba-SQLServer] Counting Pages For Sub Query In SSRS 2005 In-Reply-To: References: <38c884770906080814x4fad5535o9e3350ea345d87cf@mail.gmail.com> Message-ID: <38c884770906082311k70496398p4bff33bde7af6337@mail.gmail.com> Thank you Franciso & Betsy for your replies, I do know how to the that type of page numbering. But reading through my email I probably didn't explain myself too well, this report uses a large query which has all the employee's that are on jobs for a specific week/date range. I will try another example below: Arthur Andrews, Paul Hartland, Lesly Smith all have jobs on one week, Arthur has jobs which run across 10 pages, Paul has jobs which run over 5 pages, Lesly has jobs which run over 7 pages. Using either of the functions supplied the results would be page x of 22 (10+5+7), however all the employees are printed alphabetically, with a page break after the group (which is based on their payroll number). What I ideally want is still the report to have the whole 22 pages, but on Arthurs pages I need to show page x of 10, Pauls pages to show page x of 5 & Leslys pages to show page x of 7. Has anyone achieved this or had a similar issue ? Thank you again in advance. Paul Hartland paul.hartland at googlemail.com 2009/6/8 Francisco Tapia > in SSRS 2K we used to do this in the footer with a text control and the > following function from the globals group like so: > ="Page " & Globals!PageNumber & " of " & Globals!TotalPages > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Mon, Jun 8, 2009 at 8:14 AM, Paul Hartland > wrote: > > > To all, > > > > Been on this all day and have yet to come up with a good idea that works > > well, we produce a report (SSRS 2005) on a weekly basis that we send out > to > > all our employees, telling them dates & locations of jobs that they are > on. > > > > What has been suggest is that we put page x of y, in the header of the > > report so that the person knows that they have received all their > required > > pages of work. > > > > In the main body of the report, their is a table with the persons job > > details. In one of the footer lines of the table are two sub-queries > which > > then list all the people that are also on that job. This can > > increment/decrement drastically, i.e. one day they will be on a job with > > two > > other people the next day they could be part of a group of 50+, so the > > pages > > numbers vary depending on the jobs they are put on. > > > > Does anybody know how I can show the page x of y for this ? > > > > Thanks in advance for any help on this. > > > > -- > > Paul Hartland > > paul.hartland at googlemail.com > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From jwcolby at colbyconsulting.com Tue Jun 9 06:56:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 09 Jun 2009 07:56:13 -0400 Subject: [dba-SQLServer] SQL Server "locks up" Message-ID: <4A2E4DDD.1030403@colbyconsulting.com> Why does SQL Server "lock up" when I am running a query and I try to do something such as view the design of a view on a completely different view? BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. It seems that SQL Server should be able to do things like this with absolutely no hesitation. Yet when I am running a large query and I try to do anything else, such as view the tables or views, view the SQL in a stored procedure etc., even in a completely different database, the entire system just locks up for a long time, as in a minute. The odd part is that the query isn't even using much cpu. I have a quad core and the total cpu usage in task manager says 0%, yet I can't get anything else to work. Even something like saving a change to an Access module and closing Access takes a full minute. It is truly annoying. I often have to do other things on the machine while queries run and it is just impossible to get anything else done. -- John W. Colby www.ColbyConsulting.com From fuller.artful at gmail.com Tue Jun 9 07:31:47 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 9 Jun 2009 08:31:47 -0400 Subject: [dba-SQLServer] Counting Pages For Sub Query In SSRS 2005 In-Reply-To: <38c884770906082311k70496398p4bff33bde7af6337@mail.gmail.com> References: <38c884770906080814x4fad5535o9e3350ea345d87cf@mail.gmail.com> <38c884770906082311k70496398p4bff33bde7af6337@mail.gmail.com> Message-ID: <29f585dd0906090531m6fba3b5dh5895e5c60d2451b3@mail.gmail.com> Two approaches come to mind: 1. run the report once for each employee 2. create a subreport grouped by employee, and put the page numbering on it. The employee`s name etc. could be on the main report and it would have no footer. The subreport would occupy the entire detail section. hth, Arthur From fhtapia at gmail.com Tue Jun 9 13:03:30 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 9 Jun 2009 11:03:30 -0700 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: <4A2E4DDD.1030403@colbyconsulting.com> References: <4A2E4DDD.1030403@colbyconsulting.com> Message-ID: Are these large queries? What's your disk distribution setup like? Where is the OS disk what channel on your raid card, Where is your Page File on what channel / Raid Card, where is your DB, what chan... well you get the picture... If it's all processing via the same raid card I'm afraid you may have to troubleshoot that part. There is absolutely no reason your server should hang while running a view, unless there are problems with the view, or the design on your I/O layout. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Jun 9, 2009 at 4:56 AM, jwcolby wrote: > Why does SQL Server "lock up" when I am running a query and I try to do > something such as view the > design of a view on a completely different view? > > BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. > > It seems that SQL Server should be able to do things like this with > absolutely no hesitation. Yet > when I am running a large query and I try to do anything else, such as view > the tables or views, > view the SQL in a stored procedure etc., even in a completely different > database, the entire system > just locks up for a long time, as in a minute. The odd part is that the > query isn't even using much > cpu. I have a quad core and the total cpu usage in task manager says 0%, > yet I can't get anything > else to work. Even something like saving a change to an Access module and > closing Access takes a > full minute. > > It is truly annoying. I often have to do other things on the machine while > queries run and it is > just impossible to get anything else done. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jun 9 13:26:11 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 09 Jun 2009 14:26:11 -0400 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: References: <4A2E4DDD.1030403@colbyconsulting.com> Message-ID: <4A2EA943.8040301@colbyconsulting.com> All of them are in the same raid card. The OS is on a raid 1 pair. The page file is on the C: drive. The database is all on a single raid 6, even the same volume. That is what the questions I was asking were aimed at but I didn't really get much response on how to spread things around so I just did what I know. I have a set of 6 terabyte drives, which taken together gives me two 2 tbyte volumes, raid 6. I find it difficult to imagine that the disk stuff would cause the server to lock up tight when... I am running a query (yes it is large) and I click on another database to just look at the views contained in that database, or open a stored procedure to see what it looks like. It just seems like that should be instantaneous. I have told SQL Server to leave 3 gigs of ram available (only take 5 of the 8 gigs). It appears that SQL Server does indeed respect that because the size of the committed memory is only 5 gigs, and increases if I go in and increase that number while the query is running. So in theory I have 3 gigs available for the OS and other apps. The processors are idling. And yet it does not matter what I do, from look at parts of the databases to trying to open Excel or Access, it just takes 60 seconds or more to respond. I have no idea how to troubleshoot this, but the one constant is that I do not have this issue unless SQL Server is busy. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > Are these large queries? What's your disk distribution setup like? > Where is the OS disk what channel on your raid card, Where is your Page File > on what channel / Raid Card, where is your DB, what chan... well you get the > picture... > > If it's all processing via the same raid card I'm afraid you may have to > troubleshoot that part. There is absolutely no reason your server should > hang while running a view, unless there are problems with the view, or the > design on your I/O layout. > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Tue, Jun 9, 2009 at 4:56 AM, jwcolby wrote: > >> Why does SQL Server "lock up" when I am running a query and I try to do >> something such as view the >> design of a view on a completely different view? >> >> BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. >> >> It seems that SQL Server should be able to do things like this with >> absolutely no hesitation. Yet >> when I am running a large query and I try to do anything else, such as view >> the tables or views, >> view the SQL in a stored procedure etc., even in a completely different >> database, the entire system >> just locks up for a long time, as in a minute. The odd part is that the >> query isn't even using much >> cpu. I have a quad core and the total cpu usage in task manager says 0%, >> yet I can't get anything >> else to work. Even something like saving a change to an Access module and >> closing Access takes a >> full minute. >> >> It is truly annoying. I often have to do other things on the machine while >> queries run and it is >> just impossible to get anything else done. >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From newsgrps at dalyn.co.nz Tue Jun 9 13:36:18 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Wed, 10 Jun 2009 06:36:18 +1200 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: <4A2EA943.8040301@colbyconsulting.com> References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> Message-ID: <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> John, One area I have found this to happen is record locking. If I have a table open and run a query that accesses the table then SQL seems to wait a long time (often until I close the table). David At 10/06/2009, you wrote: >All of them are in the same raid card. The OS is on a raid 1 >pair. The page file is on the C: drive. > >The database is all on a single raid 6, even the same volume. That >is what the questions I was >asking were aimed at but I didn't really get much response on how to >spread things around so I just >did what I know. > >I have a set of 6 terabyte drives, which taken together gives me two >2 tbyte volumes, raid 6. I >find it difficult to imagine that the disk stuff would cause the >server to lock up tight when... I >am running a query (yes it is large) and I click on another database >to just look at the views >contained in that database, or open a stored procedure to see what >it looks like. > >It just seems like that should be instantaneous. I have told SQL >Server to leave 3 gigs of ram >available (only take 5 of the 8 gigs). It appears that SQL Server >does indeed respect that because >the size of the committed memory is only 5 gigs, and increases if I >go in and increase that number >while the query is running. > >So in theory I have 3 gigs available for the OS and other apps. The >processors are idling. And yet >it does not matter what I do, from look at parts of the databases to >trying to open Excel or Access, >it just takes 60 seconds or more to respond. > >I have no idea how to troubleshoot this, but the one constant is >that I do not have this issue >unless SQL Server is busy. > >John W. Colby >www.ColbyConsulting.com > > >Francisco Tapia wrote: > > Are these large queries? What's your disk distribution setup like? > > Where is the OS disk what channel on your raid card, Where is > your Page File > > on what channel / Raid Card, where is your DB, what chan... well > you get the > > picture... > > > > If it's all processing via the same raid card I'm afraid you may have to > > troubleshoot that part. There is absolutely no reason your server should > > hang while running a view, unless there are problems with the view, or the > > design on your I/O layout. > > > > > > -Francisco > > http://sqlthis.blogspot.com | Tsql and More... > > > > > > On Tue, Jun 9, 2009 at 4:56 AM, jwcolby > wrote: > > > >> Why does SQL Server "lock up" when I am running a query and I try to do > >> something such as view the > >> design of a view on a completely different view? > >> > >> BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. > >> > >> It seems that SQL Server should be able to do things like this with > >> absolutely no hesitation. Yet > >> when I am running a large query and I try to do anything else, > such as view > >> the tables or views, > >> view the SQL in a stored procedure etc., even in a completely different > >> database, the entire system > >> just locks up for a long time, as in a minute. The odd part is that the > >> query isn't even using much > >> cpu. I have a quad core and the total cpu usage in task manager says 0%, > >> yet I can't get anything > >> else to work. Even something like saving a change to an Access module and > >> closing Access takes a > >> full minute. > >> > >> It is truly annoying. I often have to do other things on the > machine while > >> queries run and it is > >> just impossible to get anything else done. From fhtapia at gmail.com Tue Jun 9 13:45:11 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 9 Jun 2009 11:45:11 -0700 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: But the issue that John is describing is that his entire system is locked up for up to a minute. I am thinking that the problem lies within the i/o setup. On my servers here (the massive systems) they are all setup where I have my mirror drive on one card, and the page file on a 2nd channel on a different set of drives. my transaction log is an fiber channel on one volume, as is the database and the tempdb. I am curious if you could move the pagefile over from the c drive to another set of drives(if you have them) to test out this theory. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Jun 9, 2009 at 11:36 AM, David Emerson wrote: > John, > > One area I have found this to happen is record locking. If I have a > table open and run a query that accesses the table then SQL seems to > wait a long time (often until I close the table). > > David > > At 10/06/2009, you wrote: > >All of them are in the same raid card. The OS is on a raid 1 > >pair. The page file is on the C: drive. > > > >The database is all on a single raid 6, even the same volume. That > >is what the questions I was > >asking were aimed at but I didn't really get much response on how to > >spread things around so I just > >did what I know. > > > >I have a set of 6 terabyte drives, which taken together gives me two > >2 tbyte volumes, raid 6. I > >find it difficult to imagine that the disk stuff would cause the > >server to lock up tight when... I > >am running a query (yes it is large) and I click on another database > >to just look at the views > >contained in that database, or open a stored procedure to see what > >it looks like. > > > >It just seems like that should be instantaneous. I have told SQL > >Server to leave 3 gigs of ram > >available (only take 5 of the 8 gigs). It appears that SQL Server > >does indeed respect that because > >the size of the committed memory is only 5 gigs, and increases if I > >go in and increase that number > >while the query is running. > > > >So in theory I have 3 gigs available for the OS and other apps. The > >processors are idling. And yet > >it does not matter what I do, from look at parts of the databases to > >trying to open Excel or Access, > >it just takes 60 seconds or more to respond. > > > >I have no idea how to troubleshoot this, but the one constant is > >that I do not have this issue > >unless SQL Server is busy. > > > >John W. Colby > >www.ColbyConsulting.com > > > > > >Francisco Tapia wrote: > > > Are these large queries? What's your disk distribution setup like? > > > Where is the OS disk what channel on your raid card, Where is > > your Page File > > > on what channel / Raid Card, where is your DB, what chan... well > > you get the > > > picture... > > > > > > If it's all processing via the same raid card I'm afraid you may have > to > > > troubleshoot that part. There is absolutely no reason your server > should > > > hang while running a view, unless there are problems with the view, or > the > > > design on your I/O layout. > > > > > > > > > -Francisco > > > http://sqlthis.blogspot.com | Tsql and More... > > > > > > > > > On Tue, Jun 9, 2009 at 4:56 AM, jwcolby > > wrote: > > > > > >> Why does SQL Server "lock up" when I am running a query and I try to > do > > >> something such as view the > > >> design of a view on a completely different view? > > >> > > >> BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. > > >> > > >> It seems that SQL Server should be able to do things like this with > > >> absolutely no hesitation. Yet > > >> when I am running a large query and I try to do anything else, > > such as view > > >> the tables or views, > > >> view the SQL in a stored procedure etc., even in a completely > different > > >> database, the entire system > > >> just locks up for a long time, as in a minute. The odd part is that > the > > >> query isn't even using much > > >> cpu. I have a quad core and the total cpu usage in task manager says > 0%, > > >> yet I can't get anything > > >> else to work. Even something like saving a change to an Access module > and > > >> closing Access takes a > > >> full minute. > > >> > > >> It is truly annoying. I often have to do other things on the > > machine while > > >> queries run and it is > > >> just impossible to get anything else done. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From mwp.reid at qub.ac.uk Tue Jun 9 14:08:33 2009 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Tue, 9 Jun 2009 20:08:33 +0100 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz>, Message-ID: <631CF83223105545BF43EFB52CB0829502A596F356@EX2K7-VIRT-2.ads.qub.ac.uk> John We have just put the tempdb out onto a Raid 10 configuration to improve performance. If its an i/o issue that could help. Thats the advice we where given. Martin Martin WP Reid Information Services The Library at Queen's Tel : 02890976174 Email : mwp.reid at qub.ac.uk ________________________________________ From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia [fhtapia at gmail.com] Sent: 09 June 2009 19:45 To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL Server "locks up" But the issue that John is describing is that his entire system is locked up for up to a minute. I am thinking that the problem lies within the i/o setup. On my servers here (the massive systems) they are all setup where I have my mirror drive on one card, and the page file on a 2nd channel on a different set of drives. my transaction log is an fiber channel on one volume, as is the database and the tempdb. I am curious if you could move the pagefile over from the c drive to another set of drives(if you have them) to test out this theory. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Jun 9, 2009 at 11:36 AM, David Emerson wrote: > John, > > One area I have found this to happen is record locking. If I have a > table open and run a query that accesses the table then SQL seems to > wait a long time (often until I close the table). > > David > > At 10/06/2009, you wrote: > >All of them are in the same raid card. The OS is on a raid 1 > >pair. The page file is on the C: drive. > > > >The database is all on a single raid 6, even the same volume. That > >is what the questions I was > >asking were aimed at but I didn't really get much response on how to > >spread things around so I just > >did what I know. > > > >I have a set of 6 terabyte drives, which taken together gives me two > >2 tbyte volumes, raid 6. I > >find it difficult to imagine that the disk stuff would cause the > >server to lock up tight when... I > >am running a query (yes it is large) and I click on another database > >to just look at the views > >contained in that database, or open a stored procedure to see what > >it looks like. > > > >It just seems like that should be instantaneous. I have told SQL > >Server to leave 3 gigs of ram > >available (only take 5 of the 8 gigs). It appears that SQL Server > >does indeed respect that because > >the size of the committed memory is only 5 gigs, and increases if I > >go in and increase that number > >while the query is running. > > > >So in theory I have 3 gigs available for the OS and other apps. The > >processors are idling. And yet > >it does not matter what I do, from look at parts of the databases to > >trying to open Excel or Access, > >it just takes 60 seconds or more to respond. > > > >I have no idea how to troubleshoot this, but the one constant is > >that I do not have this issue > >unless SQL Server is busy. > > > >John W. Colby > >www.ColbyConsulting.com > > > > > >Francisco Tapia wrote: > > > Are these large queries? What's your disk distribution setup like? > > > Where is the OS disk what channel on your raid card, Where is > > your Page File > > > on what channel / Raid Card, where is your DB, what chan... well > > you get the > > > picture... > > > > > > If it's all processing via the same raid card I'm afraid you may have > to > > > troubleshoot that part. There is absolutely no reason your server > should > > > hang while running a view, unless there are problems with the view, or > the > > > design on your I/O layout. > > > > > > > > > -Francisco > > > http://sqlthis.blogspot.com | Tsql and More... > > > > > > > > > On Tue, Jun 9, 2009 at 4:56 AM, jwcolby > > wrote: > > > > > >> Why does SQL Server "lock up" when I am running a query and I try to > do > > >> something such as view the > > >> design of a view on a completely different view? > > >> > > >> BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. > > >> > > >> It seems that SQL Server should be able to do things like this with > > >> absolutely no hesitation. Yet > > >> when I am running a large query and I try to do anything else, > > such as view > > >> the tables or views, > > >> view the SQL in a stored procedure etc., even in a completely > different > > >> database, the entire system > > >> just locks up for a long time, as in a minute. The odd part is that > the > > >> query isn't even using much > > >> cpu. I have a quad core and the total cpu usage in task manager says > 0%, > > >> yet I can't get anything > > >> else to work. Even something like saving a change to an Access module > and > > >> closing Access takes a > > >> full minute. > > >> > > >> It is truly annoying. I often have to do other things on the > > machine while > > >> queries run and it is > > >> just impossible to get anything else done. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fhtapia at gmail.com Tue Jun 9 15:24:36 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 9 Jun 2009 13:24:36 -0700 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: <631CF83223105545BF43EFB52CB0829502A596F356@EX2K7-VIRT-2.ads.qub.ac.uk> References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <631CF83223105545BF43EFB52CB0829502A596F356@EX2K7-VIRT-2.ads.qub.ac.uk> Message-ID: are you sorting your query John? if you are then moving the tempdb to it's own channel will help speed things up, however if you are not, then the issue may still lie with the page file location. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Jun 9, 2009 at 12:08 PM, Martin Reid wrote: > John > > We have just put the tempdb out onto a Raid 10 configuration to improve > performance. If its an i/o issue that could help. Thats the advice we where > given. > > Martin > > > > Martin WP Reid > Information Services > The Library at Queen's > Tel : 02890976174 > Email : mwp.reid at qub.ac.uk > ________________________________________ > From: dba-sqlserver-bounces at databaseadvisors.com [ > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia [ > fhtapia at gmail.com] > Sent: 09 June 2009 19:45 > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] SQL Server "locks up" > > But the issue that John is describing is that his entire system is locked > up > for up to a minute. I am thinking that the problem lies within the i/o > setup. On my servers here (the massive systems) they are all setup where I > have my mirror drive on one card, and the page file on a 2nd channel on a > different set of drives. > my transaction log is an fiber channel on one volume, as is the database > and > the tempdb. > > I am curious if you could move the pagefile over from the c drive to > another > set of drives(if you have them) to test out this theory. > > > > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Tue, Jun 9, 2009 at 11:36 AM, David Emerson > wrote: > > > John, > > > > One area I have found this to happen is record locking. If I have a > > table open and run a query that accesses the table then SQL seems to > > wait a long time (often until I close the table). > > > > David > > > > At 10/06/2009, you wrote: > > >All of them are in the same raid card. The OS is on a raid 1 > > >pair. The page file is on the C: drive. > > > > > >The database is all on a single raid 6, even the same volume. That > > >is what the questions I was > > >asking were aimed at but I didn't really get much response on how to > > >spread things around so I just > > >did what I know. > > > > > >I have a set of 6 terabyte drives, which taken together gives me two > > >2 tbyte volumes, raid 6. I > > >find it difficult to imagine that the disk stuff would cause the > > >server to lock up tight when... I > > >am running a query (yes it is large) and I click on another database > > >to just look at the views > > >contained in that database, or open a stored procedure to see what > > >it looks like. > > > > > >It just seems like that should be instantaneous. I have told SQL > > >Server to leave 3 gigs of ram > > >available (only take 5 of the 8 gigs). It appears that SQL Server > > >does indeed respect that because > > >the size of the committed memory is only 5 gigs, and increases if I > > >go in and increase that number > > >while the query is running. > > > > > >So in theory I have 3 gigs available for the OS and other apps. The > > >processors are idling. And yet > > >it does not matter what I do, from look at parts of the databases to > > >trying to open Excel or Access, > > >it just takes 60 seconds or more to respond. > > > > > >I have no idea how to troubleshoot this, but the one constant is > > >that I do not have this issue > > >unless SQL Server is busy. > > > > > >John W. Colby > > >www.ColbyConsulting.com > > > > > > > > >Francisco Tapia wrote: > > > > Are these large queries? What's your disk distribution setup like? > > > > Where is the OS disk what channel on your raid card, Where is > > > your Page File > > > > on what channel / Raid Card, where is your DB, what chan... well > > > you get the > > > > picture... > > > > > > > > If it's all processing via the same raid card I'm afraid you may have > > to > > > > troubleshoot that part. There is absolutely no reason your server > > should > > > > hang while running a view, unless there are problems with the view, > or > > the > > > > design on your I/O layout. > > > > > > > > > > > > -Francisco > > > > http://sqlthis.blogspot.com | Tsql and More... > > > > > > > > > > > > On Tue, Jun 9, 2009 at 4:56 AM, jwcolby > > > wrote: > > > > > > > >> Why does SQL Server "lock up" when I am running a query and I try to > > do > > > >> something such as view the > > > >> design of a view on a completely different view? > > > >> > > > >> BTW SQL Server has been limited to 5 gigs out of 8 gigs total > memory. > > > >> > > > >> It seems that SQL Server should be able to do things like this with > > > >> absolutely no hesitation. Yet > > > >> when I am running a large query and I try to do anything else, > > > such as view > > > >> the tables or views, > > > >> view the SQL in a stored procedure etc., even in a completely > > different > > > >> database, the entire system > > > >> just locks up for a long time, as in a minute. The odd part is that > > the > > > >> query isn't even using much > > > >> cpu. I have a quad core and the total cpu usage in task manager > says > > 0%, > > > >> yet I can't get anything > > > >> else to work. Even something like saving a change to an Access > module > > and > > > >> closing Access takes a > > > >> full minute. > > > >> > > > >> It is truly annoying. I often have to do other things on the > > > machine while > > > >> queries run and it is > > > >> just impossible to get anything else done. > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Jun 10 07:08:33 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 10 Jun 2009 08:08:33 -0400 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <4A2FA241.9020809@colbyconsulting.com> I have a TON of drives sitting around. I just replaced (8) 500g drives with (6) terabyte drives. The bigger issue is the power supply. We'll see. I even have another 8 channel raid card I can use. I have an order I have to get out and some other stuff to get done but when I finish that I will go do some of this. At this instant I do have a pair of tbyte drives raid 1 that have the OS (and page file) on one volume (Drive C:) and another volume available (Drive D:). The raid 6 volumes (2 tbyte) are E: and F: and live on a set of (6) tbyte drives. Raid 1 won't be as fast streaming as Raid 6 but it will be a separate set of disks. What would you like moved there and how do I do that? John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > But the issue that John is describing is that his entire system is locked up > for up to a minute. I am thinking that the problem lies within the i/o > setup. On my servers here (the massive systems) they are all setup where I > have my mirror drive on one card, and the page file on a 2nd channel on a > different set of drives. > my transaction log is an fiber channel on one volume, as is the database and > the tempdb. > > I am curious if you could move the pagefile over from the c drive to another > set of drives(if you have them) to test out this theory. > > > > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Tue, Jun 9, 2009 at 11:36 AM, David Emerson wrote: > >> John, >> >> One area I have found this to happen is record locking. If I have a >> table open and run a query that accesses the table then SQL seems to >> wait a long time (often until I close the table). >> >> David >> >> At 10/06/2009, you wrote: >>> All of them are in the same raid card. The OS is on a raid 1 >>> pair. The page file is on the C: drive. >>> >>> The database is all on a single raid 6, even the same volume. That >>> is what the questions I was >>> asking were aimed at but I didn't really get much response on how to >>> spread things around so I just >>> did what I know. >>> >>> I have a set of 6 terabyte drives, which taken together gives me two >>> 2 tbyte volumes, raid 6. I >>> find it difficult to imagine that the disk stuff would cause the >>> server to lock up tight when... I >>> am running a query (yes it is large) and I click on another database >>> to just look at the views >>> contained in that database, or open a stored procedure to see what >>> it looks like. >>> >>> It just seems like that should be instantaneous. I have told SQL >>> Server to leave 3 gigs of ram >>> available (only take 5 of the 8 gigs). It appears that SQL Server >>> does indeed respect that because >>> the size of the committed memory is only 5 gigs, and increases if I >>> go in and increase that number >>> while the query is running. >>> >>> So in theory I have 3 gigs available for the OS and other apps. The >>> processors are idling. And yet >>> it does not matter what I do, from look at parts of the databases to >>> trying to open Excel or Access, >>> it just takes 60 seconds or more to respond. >>> >>> I have no idea how to troubleshoot this, but the one constant is >>> that I do not have this issue >>> unless SQL Server is busy. >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> >>> Francisco Tapia wrote: >>>> Are these large queries? What's your disk distribution setup like? >>>> Where is the OS disk what channel on your raid card, Where is >>> your Page File >>>> on what channel / Raid Card, where is your DB, what chan... well >>> you get the >>>> picture... >>>> >>>> If it's all processing via the same raid card I'm afraid you may have >> to >>>> troubleshoot that part. There is absolutely no reason your server >> should >>>> hang while running a view, unless there are problems with the view, or >> the >>>> design on your I/O layout. >>>> >>>> >>>> -Francisco >>>> http://sqlthis.blogspot.com | Tsql and More... >>>> >>>> >>>> On Tue, Jun 9, 2009 at 4:56 AM, jwcolby >>> wrote: >>>>> Why does SQL Server "lock up" when I am running a query and I try to >> do >>>>> something such as view the >>>>> design of a view on a completely different view? >>>>> >>>>> BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. >>>>> >>>>> It seems that SQL Server should be able to do things like this with >>>>> absolutely no hesitation. Yet >>>>> when I am running a large query and I try to do anything else, >>> such as view >>>>> the tables or views, >>>>> view the SQL in a stored procedure etc., even in a completely >> different >>>>> database, the entire system >>>>> just locks up for a long time, as in a minute. The odd part is that >> the >>>>> query isn't even using much >>>>> cpu. I have a quad core and the total cpu usage in task manager says >> 0%, >>>>> yet I can't get anything >>>>> else to work. Even something like saving a change to an Access module >> and >>>>> closing Access takes a >>>>> full minute. >>>>> >>>>> It is truly annoying. I often have to do other things on the >>> machine while >>>>> queries run and it is >>>>> just impossible to get anything else done. >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Jun 10 07:58:48 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 10 Jun 2009 08:58:48 -0400 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <4A2FAE08.6040801@colbyconsulting.com> Francisco (and everyone trying to help), Thanks for pointing me back to the pagefile. I had just rebuilt this server and the first thing I did was go in and set the page file size... to... 1200 mbytes. Uhh.... ooops. That should be 12 gbytes (12000 mbytes). I had inadvertently left off a zero. This will very likely explain the whole problem. I upped that page file to 12000 mbytes and created a second page file on the same volume as the database is on. If I shouldn't do that (same volume as the db) let me know but I have read somewhere to create multiple page files and let Windows take it's pick. BTW, I have a very fast 32 gig SSD which I am using only 8 gigs of (working disk for virtual machines). I have read about issues using SSDs but have no direct experience using them for writing to - my VMs only read from the drive. So I could even place a pagefile out on the ssd. BTW, I just did the same update hash fields operation on 50 million records in 21 minutes that it took 3.5 HOURS to do yesterday on about 28 million records. The page file size error was definitely crippling the system. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > But the issue that John is describing is that his entire system is locked up > for up to a minute. I am thinking that the problem lies within the i/o > setup. On my servers here (the massive systems) they are all setup where I > have my mirror drive on one card, and the page file on a 2nd channel on a > different set of drives. > my transaction log is an fiber channel on one volume, as is the database and > the tempdb. > > I am curious if you could move the pagefile over from the c drive to another > set of drives(if you have them) to test out this theory. > > > > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Tue, Jun 9, 2009 at 11:36 AM, David Emerson wrote: > >> John, >> >> One area I have found this to happen is record locking. If I have a >> table open and run a query that accesses the table then SQL seems to >> wait a long time (often until I close the table). >> >> David >> >> At 10/06/2009, you wrote: >>> All of them are in the same raid card. The OS is on a raid 1 >>> pair. The page file is on the C: drive. >>> >>> The database is all on a single raid 6, even the same volume. That >>> is what the questions I was >>> asking were aimed at but I didn't really get much response on how to >>> spread things around so I just >>> did what I know. >>> >>> I have a set of 6 terabyte drives, which taken together gives me two >>> 2 tbyte volumes, raid 6. I >>> find it difficult to imagine that the disk stuff would cause the >>> server to lock up tight when... I >>> am running a query (yes it is large) and I click on another database >>> to just look at the views >>> contained in that database, or open a stored procedure to see what >>> it looks like. >>> >>> It just seems like that should be instantaneous. I have told SQL >>> Server to leave 3 gigs of ram >>> available (only take 5 of the 8 gigs). It appears that SQL Server >>> does indeed respect that because >>> the size of the committed memory is only 5 gigs, and increases if I >>> go in and increase that number >>> while the query is running. >>> >>> So in theory I have 3 gigs available for the OS and other apps. The >>> processors are idling. And yet >>> it does not matter what I do, from look at parts of the databases to >>> trying to open Excel or Access, >>> it just takes 60 seconds or more to respond. >>> >>> I have no idea how to troubleshoot this, but the one constant is >>> that I do not have this issue >>> unless SQL Server is busy. >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> >>> Francisco Tapia wrote: >>>> Are these large queries? What's your disk distribution setup like? >>>> Where is the OS disk what channel on your raid card, Where is >>> your Page File >>>> on what channel / Raid Card, where is your DB, what chan... well >>> you get the >>>> picture... >>>> >>>> If it's all processing via the same raid card I'm afraid you may have >> to >>>> troubleshoot that part. There is absolutely no reason your server >> should >>>> hang while running a view, unless there are problems with the view, or >> the >>>> design on your I/O layout. >>>> >>>> >>>> -Francisco >>>> http://sqlthis.blogspot.com | Tsql and More... >>>> >>>> >>>> On Tue, Jun 9, 2009 at 4:56 AM, jwcolby >>> wrote: >>>>> Why does SQL Server "lock up" when I am running a query and I try to >> do >>>>> something such as view the >>>>> design of a view on a completely different view? >>>>> >>>>> BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. >>>>> >>>>> It seems that SQL Server should be able to do things like this with >>>>> absolutely no hesitation. Yet >>>>> when I am running a large query and I try to do anything else, >>> such as view >>>>> the tables or views, >>>>> view the SQL in a stored procedure etc., even in a completely >> different >>>>> database, the entire system >>>>> just locks up for a long time, as in a minute. The odd part is that >> the >>>>> query isn't even using much >>>>> cpu. I have a quad core and the total cpu usage in task manager says >> 0%, >>>>> yet I can't get anything >>>>> else to work. Even something like saving a change to an Access module >> and >>>>> closing Access takes a >>>>> full minute. >>>>> >>>>> It is truly annoying. I often have to do other things on the >>> machine while >>>>> queries run and it is >>>>> just impossible to get anything else done. >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Wed Jun 10 09:47:51 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 10 Jun 2009 07:47:51 -0700 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: <4A2FAE08.6040801@colbyconsulting.com> References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <4A2FAE08.6040801@colbyconsulting.com> Message-ID: excellent, I generally never put a page file on my db drive because I don't ever want any bandwidth stolen from that partition, I also do not place one on my transaction log drive. my experience with ssd has been limited, but I have found that those drives perform extremely fast but only on smaller files (smaller than 3-4gb). if most of your work files are less than 3gb i have found it to be super fast :) almost like loaded in ram fast :). -Francisco http://sqlthis.blogspot.com | Tsql and More... On Wed, Jun 10, 2009 at 5:58 AM, jwcolby wrote: > Francisco (and everyone trying to help), > > Thanks for pointing me back to the pagefile. I had just rebuilt this > server and the first thing I > did was go in and set the page file size... to... 1200 mbytes. Uhh.... > ooops. That should be 12 > gbytes (12000 mbytes). I had inadvertently left off a zero. > > This will very likely explain the whole problem. > > I upped that page file to 12000 mbytes and created a second page file on > the same volume as the > database is on. If I shouldn't do that (same volume as the db) let me know > but I have read > somewhere to create multiple page files and let Windows take it's pick. > > BTW, I have a very fast 32 gig SSD which I am using only 8 gigs of (working > disk for virtual > machines). I have read about issues using SSDs but have no direct > experience using them for writing > to - my VMs only read from the drive. So I could even place a pagefile out > on the ssd. > > BTW, I just did the same update hash fields operation on 50 million records > in 21 minutes that it > took 3.5 HOURS to do yesterday on about 28 million records. The page file > size error was definitely > crippling the system. > > John W. Colby > www.ColbyConsulting.com > > > Francisco Tapia wrote: > > But the issue that John is describing is that his entire system is locked > up > > for up to a minute. I am thinking that the problem lies within the i/o > > setup. On my servers here (the massive systems) they are all setup where > I > > have my mirror drive on one card, and the page file on a 2nd channel on a > > different set of drives. > > my transaction log is an fiber channel on one volume, as is the database > and > > the tempdb. > > > > I am curious if you could move the pagefile over from the c drive to > another > > set of drives(if you have them) to test out this theory. > > > > > > > > > > > > -Francisco > > http://sqlthis.blogspot.com | Tsql and More... > > > > > > On Tue, Jun 9, 2009 at 11:36 AM, David Emerson > wrote: > > > >> John, > >> > >> One area I have found this to happen is record locking. If I have a > >> table open and run a query that accesses the table then SQL seems to > >> wait a long time (often until I close the table). > >> > >> David > >> > >> At 10/06/2009, you wrote: > >>> All of them are in the same raid card. The OS is on a raid 1 > >>> pair. The page file is on the C: drive. > >>> > >>> The database is all on a single raid 6, even the same volume. That > >>> is what the questions I was > >>> asking were aimed at but I didn't really get much response on how to > >>> spread things around so I just > >>> did what I know. > >>> > >>> I have a set of 6 terabyte drives, which taken together gives me two > >>> 2 tbyte volumes, raid 6. I > >>> find it difficult to imagine that the disk stuff would cause the > >>> server to lock up tight when... I > >>> am running a query (yes it is large) and I click on another database > >>> to just look at the views > >>> contained in that database, or open a stored procedure to see what > >>> it looks like. > >>> > >>> It just seems like that should be instantaneous. I have told SQL > >>> Server to leave 3 gigs of ram > >>> available (only take 5 of the 8 gigs). It appears that SQL Server > >>> does indeed respect that because > >>> the size of the committed memory is only 5 gigs, and increases if I > >>> go in and increase that number > >>> while the query is running. > >>> > >>> So in theory I have 3 gigs available for the OS and other apps. The > >>> processors are idling. And yet > >>> it does not matter what I do, from look at parts of the databases to > >>> trying to open Excel or Access, > >>> it just takes 60 seconds or more to respond. > >>> > >>> I have no idea how to troubleshoot this, but the one constant is > >>> that I do not have this issue > >>> unless SQL Server is busy. > >>> > >>> John W. Colby > >>> www.ColbyConsulting.com > >>> > >>> > >>> Francisco Tapia wrote: > >>>> Are these large queries? What's your disk distribution setup like? > >>>> Where is the OS disk what channel on your raid card, Where is > >>> your Page File > >>>> on what channel / Raid Card, where is your DB, what chan... well > >>> you get the > >>>> picture... > >>>> > >>>> If it's all processing via the same raid card I'm afraid you may have > >> to > >>>> troubleshoot that part. There is absolutely no reason your server > >> should > >>>> hang while running a view, unless there are problems with the view, or > >> the > >>>> design on your I/O layout. > >>>> > >>>> > >>>> -Francisco > >>>> http://sqlthis.blogspot.com | Tsql and More... > >>>> > >>>> > >>>> On Tue, Jun 9, 2009 at 4:56 AM, jwcolby > >>> wrote: > >>>>> Why does SQL Server "lock up" when I am running a query and I try to > >> do > >>>>> something such as view the > >>>>> design of a view on a completely different view? > >>>>> > >>>>> BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. > >>>>> > >>>>> It seems that SQL Server should be able to do things like this with > >>>>> absolutely no hesitation. Yet > >>>>> when I am running a large query and I try to do anything else, > >>> such as view > >>>>> the tables or views, > >>>>> view the SQL in a stored procedure etc., even in a completely > >> different > >>>>> database, the entire system > >>>>> just locks up for a long time, as in a minute. The odd part is that > >> the > >>>>> query isn't even using much > >>>>> cpu. I have a quad core and the total cpu usage in task manager says > >> 0%, > >>>>> yet I can't get anything > >>>>> else to work. Even something like saving a change to an Access > module > >> and > >>>>> closing Access takes a > >>>>> full minute. > >>>>> > >>>>> It is truly annoying. I often have to do other things on the > >>> machine while > >>>>> queries run and it is > >>>>> just impossible to get anything else done. > >> _______________________________________________ > >> dba-SQLServer mailing list > >> dba-SQLServer at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Jun 10 10:54:56 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 10 Jun 2009 11:54:56 -0400 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <4A2FAE08.6040801@colbyconsulting.com> Message-ID: <4A2FD750.4020007@colbyconsulting.com> Is there a generic setting to tell SQL Server to place log files on a specific drive? Is it by the database? How is this done? I am going to set up a RAID 1 pair of 512 gig drives just to put the log files on, but I do not know how to specify that logs should go there. My business has me setting up a new database for each order. In fact what I actually do is copy an existing "template" database, renaming it to the order name. The log files can get pretty large (tens of gigs) depending on the order and processing involved. it would be nice not to have to remember to tell SQL Server to place the logs in a specific place each time I create a database. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > excellent, I generally never put a page file on my db drive because I don't > ever want any bandwidth stolen from that partition, I also do not place one > on my transaction log drive. > > my experience with ssd has been limited, but I have found that those drives > perform extremely fast but only on smaller files (smaller than 3-4gb). if > most of your work files are less than 3gb i have found it to be super fast > :) almost like loaded in ram fast :). > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Wed, Jun 10, 2009 at 5:58 AM, jwcolby wrote: > >> Francisco (and everyone trying to help), >> >> Thanks for pointing me back to the pagefile. I had just rebuilt this >> server and the first thing I >> did was go in and set the page file size... to... 1200 mbytes. Uhh.... >> ooops. That should be 12 >> gbytes (12000 mbytes). I had inadvertently left off a zero. >> >> This will very likely explain the whole problem. >> >> I upped that page file to 12000 mbytes and created a second page file on >> the same volume as the >> database is on. If I shouldn't do that (same volume as the db) let me know >> but I have read >> somewhere to create multiple page files and let Windows take it's pick. >> >> BTW, I have a very fast 32 gig SSD which I am using only 8 gigs of (working >> disk for virtual >> machines). I have read about issues using SSDs but have no direct >> experience using them for writing >> to - my VMs only read from the drive. So I could even place a pagefile out >> on the ssd. >> >> BTW, I just did the same update hash fields operation on 50 million records >> in 21 minutes that it >> took 3.5 HOURS to do yesterday on about 28 million records. The page file >> size error was definitely >> crippling the system. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Francisco Tapia wrote: >>> But the issue that John is describing is that his entire system is locked >> up >>> for up to a minute. I am thinking that the problem lies within the i/o >>> setup. On my servers here (the massive systems) they are all setup where >> I >>> have my mirror drive on one card, and the page file on a 2nd channel on a >>> different set of drives. >>> my transaction log is an fiber channel on one volume, as is the database >> and >>> the tempdb. >>> >>> I am curious if you could move the pagefile over from the c drive to >> another >>> set of drives(if you have them) to test out this theory. >>> >>> >>> >>> >>> >>> -Francisco >>> http://sqlthis.blogspot.com | Tsql and More... >>> >>> >>> On Tue, Jun 9, 2009 at 11:36 AM, David Emerson >> wrote: >>>> John, >>>> >>>> One area I have found this to happen is record locking. If I have a >>>> table open and run a query that accesses the table then SQL seems to >>>> wait a long time (often until I close the table). >>>> >>>> David >>>> >>>> At 10/06/2009, you wrote: >>>>> All of them are in the same raid card. The OS is on a raid 1 >>>>> pair. The page file is on the C: drive. >>>>> >>>>> The database is all on a single raid 6, even the same volume. That >>>>> is what the questions I was >>>>> asking were aimed at but I didn't really get much response on how to >>>>> spread things around so I just >>>>> did what I know. >>>>> >>>>> I have a set of 6 terabyte drives, which taken together gives me two >>>>> 2 tbyte volumes, raid 6. I >>>>> find it difficult to imagine that the disk stuff would cause the >>>>> server to lock up tight when... I >>>>> am running a query (yes it is large) and I click on another database >>>>> to just look at the views >>>>> contained in that database, or open a stored procedure to see what >>>>> it looks like. >>>>> >>>>> It just seems like that should be instantaneous. I have told SQL >>>>> Server to leave 3 gigs of ram >>>>> available (only take 5 of the 8 gigs). It appears that SQL Server >>>>> does indeed respect that because >>>>> the size of the committed memory is only 5 gigs, and increases if I >>>>> go in and increase that number >>>>> while the query is running. >>>>> >>>>> So in theory I have 3 gigs available for the OS and other apps. The >>>>> processors are idling. And yet >>>>> it does not matter what I do, from look at parts of the databases to >>>>> trying to open Excel or Access, >>>>> it just takes 60 seconds or more to respond. >>>>> >>>>> I have no idea how to troubleshoot this, but the one constant is >>>>> that I do not have this issue >>>>> unless SQL Server is busy. >>>>> >>>>> John W. Colby >>>>> www.ColbyConsulting.com >>>>> >>>>> >>>>> Francisco Tapia wrote: >>>>>> Are these large queries? What's your disk distribution setup like? >>>>>> Where is the OS disk what channel on your raid card, Where is >>>>> your Page File >>>>>> on what channel / Raid Card, where is your DB, what chan... well >>>>> you get the >>>>>> picture... >>>>>> >>>>>> If it's all processing via the same raid card I'm afraid you may have >>>> to >>>>>> troubleshoot that part. There is absolutely no reason your server >>>> should >>>>>> hang while running a view, unless there are problems with the view, or >>>> the >>>>>> design on your I/O layout. >>>>>> >>>>>> >>>>>> -Francisco >>>>>> http://sqlthis.blogspot.com | Tsql and More... >>>>>> >>>>>> >>>>>> On Tue, Jun 9, 2009 at 4:56 AM, jwcolby >>>>> wrote: >>>>>>> Why does SQL Server "lock up" when I am running a query and I try to >>>> do >>>>>>> something such as view the >>>>>>> design of a view on a completely different view? >>>>>>> >>>>>>> BTW SQL Server has been limited to 5 gigs out of 8 gigs total memory. >>>>>>> >>>>>>> It seems that SQL Server should be able to do things like this with >>>>>>> absolutely no hesitation. Yet >>>>>>> when I am running a large query and I try to do anything else, >>>>> such as view >>>>>>> the tables or views, >>>>>>> view the SQL in a stored procedure etc., even in a completely >>>> different >>>>>>> database, the entire system >>>>>>> just locks up for a long time, as in a minute. The odd part is that >>>> the >>>>>>> query isn't even using much >>>>>>> cpu. I have a quad core and the total cpu usage in task manager says >>>> 0%, >>>>>>> yet I can't get anything >>>>>>> else to work. Even something like saving a change to an Access >> module >>>> and >>>>>>> closing Access takes a >>>>>>> full minute. >>>>>>> >>>>>>> It is truly annoying. I often have to do other things on the >>>>> machine while >>>>>>> queries run and it is >>>>>>> just impossible to get anything else done. >>>> _______________________________________________ >>>> dba-SQLServer mailing list >>>> dba-SQLServer at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-SQLServer mailing list >>> dba-SQLServer at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Wed Jun 10 15:18:21 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 10 Jun 2009 13:18:21 -0700 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <4A2FAE08.6040801@colbyconsulting.com> <4A2FD750.4020007@colbyconsulting.com> Message-ID: > > When you are doing the install you can specify the default location of > these files (i'll google for how to change this), also for existing > databases just detach and re-attach with the log file on it's specific > location, for new databases you can specify the new location for log files, > none of the existing databases will automatically move the log files to a > new location, this must be done manually. > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Wed, Jun 10, 2009 at 8:54 AM, jwcolby wrote: > >> Is there a generic setting to tell SQL Server to place log files on a >> specific drive? Is it by the >> database? How is this done? I am going to set up a RAID 1 pair of 512 >> gig drives just to put the >> log files on, but I do not know how to specify that logs should go there. >> >> My business has me setting up a new database for each order. In fact what >> I actually do is copy an >> existing "template" database, renaming it to the order name. The log >> files can get pretty large >> (tens of gigs) depending on the order and processing involved. it would >> be nice not to have to >> remember to tell SQL Server to place the logs in a specific place each >> time I create a database. >> >> John W. Colby >> www.ColbyConsulting.com >> >> From fhtapia at gmail.com Wed Jun 10 17:26:42 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 10 Jun 2009 15:26:42 -0700 Subject: [dba-SQLServer] SQL Server "locks up" In-Reply-To: References: <4A2E4DDD.1030403@colbyconsulting.com> <4A2EA943.8040301@colbyconsulting.com> <20090609183559.TUEK5406.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <4A2FAE08.6040801@colbyconsulting.com> <4A2FD750.4020007@colbyconsulting.com> Message-ID: Also, You can change the existing default paths for all future databases you create by right clicking on your server name in Management Studio and selecting the database properties. This will change the behavior of where you want your log files in the future, but not move any existing log files, to do that you must EITHER backup the database and restore it (choosing the locations of the files explicitly) OR detach and re-attach the database files with the explicit location of the log files... I think you already have the syntax for that so I won't repost... -Francisco http://sqlthis.blogspot.com | Tsql and More... On Wed, Jun 10, 2009 at 1:18 PM, Francisco Tapia wrote: > When you are doing the install you can specify the default location of >> these files (i'll google for how to change this), also for existing >> databases just detach and re-attach with the log file on it's specific >> location, for new databases you can specify the new location for log files, >> none of the existing databases will automatically move the log files to a >> new location, this must be done manually. >> >> >> -Francisco >> http://sqlthis.blogspot.com | Tsql and More... >> >> >> On Wed, Jun 10, 2009 at 8:54 AM, jwcolby wrote: >> >>> Is there a generic setting to tell SQL Server to place log files on a >>> specific drive? Is it by the >>> database? How is this done? I am going to set up a RAID 1 pair of 512 >>> gig drives just to put the >>> log files on, but I do not know how to specify that logs should go there. >>> >>> My business has me setting up a new database for each order. In fact >>> what I actually do is copy an >>> existing "template" database, renaming it to the order name. The log >>> files can get pretty large >>> (tens of gigs) depending on the order and processing involved. it would >>> be nice not to have to >>> remember to tell SQL Server to place the logs in a specific place each >>> time I create a database. >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> From paul.hartland at googlemail.com Thu Jun 11 06:18:40 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 11 Jun 2009 12:18:40 +0100 Subject: [dba-SQLServer] Multiple rows to a single row Message-ID: <38c884770906110418o2813b091o8fc72b8c075d4a71@mail.gmail.com> To all, I am sure I have seem this before on the list, but cant seem to find it. I have a query similar to the one below: SELECT TOP (100) PERCENT dbo.PoolCarTable.PoolCar, CASE WHEN dbo.EmployeeAvailability.[DriverOrPassenger?] = 'D' THEN dbo.PersonnelTable.[Forename/s] + ' ' + dbo.PersonnelTable.Surname ELSE '' END AS DriverName, CASE WHEN dbo.EmployeeAvailability.[DriverOrPassenger?] = 'D' THEN dbo.PersonnelTable.Office ELSE '' END AS Region, CASE WHEN dbo.EmployeeAvailability.[DriverOrPassenger?] = 'D' THEN dbo.PersonnelTable.Town ELSE '' END AS Town FROM dbo.JobDataTable INNER JOIN dbo.EmployeeAvailability ON dbo.JobDataTable.JobNo = dbo.EmployeeAvailability.JobNo INNER JOIN dbo.PersonnelTable ON dbo.EmployeeAvailability.PayrollNo = dbo.PersonnelTable.PayrollNo RIGHT OUTER JOIN dbo.PoolCarTable ON dbo.EmployeeAvailability.CarNo = dbo.PoolCarTable.PoolCar WHERE (dbo.EmployeeAvailability.JobDate BETWEEN '06/01/09' AND '06/07/09') AND (dbo.JobDataTable.CanDate IS NULL) GROUP BY dbo.PoolCarTable.PoolCar, CASE WHEN dbo.EmployeeAvailability.[DriverOrPassenger?] = 'D' THEN dbo.PersonnelTable.[Forename/s] + ' ' + dbo.PersonnelTable.Surname ELSE '' END, CASE WHEN dbo.EmployeeAvailability.[DriverOrPassenger?] = 'D' THEN dbo.PersonnelTable.Office ELSE '' END, CASE WHEN dbo.EmployeeAvailability.[DriverOrPassenger?] = 'D' THEN dbo.PersonnelTable.Town ELSE '' END ORDER BY dbo.PoolCarTable.PoolCar, DriverName DESC An example of what it returns is: PoolCar DriverName Region Town PC01 Smith North York PC01 Taylor North Hull PC02 Russell South London PC02 Loft South London PC02 Burns South Middlesex What I need to achieve is: PoolCar DriverName Region Town PC01 Smith,Taylor North York, Hull PC02 Russell,Loft,Burns South London, Middlesex Can anyone point me in the right direction please, I am starting to think that I will have the change my query, and have sub queries etc. Thank you in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From jwcolby at colbyconsulting.com Thu Jun 11 12:46:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 11 Jun 2009 13:46:13 -0400 Subject: [dba-SQLServer] Syntax to add field to index Message-ID: <4A3142E5.8020204@colbyconsulting.com> I need to create an index on a table, then use the index to update another field, then add that other field to the index. Is there a syntax to add a field to an existing index or is it just drop / create index? I create indexes in stored procedures, but I have never added another field to an existing index. -- John W. Colby www.ColbyConsulting.com From davidmcafee at gmail.com Thu Jun 11 14:20:05 2009 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 11 Jun 2009 12:20:05 -0700 Subject: [dba-SQLServer] Multiple rows to a single row In-Reply-To: <38c884770906110418o2813b091o8fc72b8c075d4a71@mail.gmail.com> References: <38c884770906110418o2813b091o8fc72b8c075d4a71@mail.gmail.com> Message-ID: <8786a4c00906111220g56eaaadbr414b5c0a71ab71c5@mail.gmail.com> Paul, maybe you can insert it into a temp table (Lets assume it is called tblTemp) then create a udf which does something like this: CREATE FUNCTION udfTableToList (@PoolCar AS VARCHAR(50), @intMode AS INT) RETURNS VARCHAR(1000) AS BEGIN DECLARE @str VARCHAR(100) IF @IntMode = 1 SELECT @str = ISNULL(@str,'') + DriverName + ',' FROM tblTemp WHERE PoolCar = @PoolCar ELSE IF @IntMode = 2 SELECT @str = ISNULL(@str,'') + Town + ',' FROM tblTemp WHERE PoolCar = @PoolCar RETURN LEFT(@str,LEN(@Str)-1) END You call the udf as such: SELECT DISTINCT PoolCar, dbo.udfTableToList(PoolCar,1) AS Driver, Region, dbo.udfTableToList(PoolCar,2) AS Town FROM tblTemp Results: PoolCar Driver Region Town PC01 Smith,Taylor North York,Hull PC02 Russell,Loft,Burns South London,London,Middlesex From jwcolby at colbyconsulting.com Thu Jun 11 18:52:51 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 11 Jun 2009 19:52:51 -0400 Subject: [dba-SQLServer] Update using GetDate() Message-ID: <4A3198D3.7070604@colbyconsulting.com> If I update a field in millions of records with GetDate, will every record get the same date / time value? Or will later updates get a later time if the time of that record update happens a second or more later than earlier updates? IOW does SQL Server get one date/time value and use that value for all updates in that query? -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Thu Jun 11 19:04:29 2009 From: ebarro at verizon.net (Eric Barro) Date: Thu, 11 Jun 2009 17:04:29 -0700 Subject: [dba-SQLServer] Update using GetDate() In-Reply-To: <4A3198D3.7070604@colbyconsulting.com> References: <4A3198D3.7070604@colbyconsulting.com> Message-ID: <3176E686055241AE85922085B03ADF3A@advancedinput.com> I believe you will have unique datetime values for each record. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, June 11, 2009 4:53 PM To: Dba-Sqlserver Subject: [dba-SQLServer] Update using GetDate() If I update a field in millions of records with GetDate, will every record get the same date / time value? Or will later updates get a later time if the time of that record update happens a second or more later than earlier updates? IOW does SQL Server get one date/time value and use that value for all updates in that query? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From davidmcafee at gmail.com Thu Jun 11 19:14:54 2009 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 11 Jun 2009 17:14:54 -0700 Subject: [dba-SQLServer] Update using GetDate() In-Reply-To: <4A3198D3.7070604@colbyconsulting.com> References: <4A3198D3.7070604@colbyconsulting.com> Message-ID: <8786a4c00906111714g146917fek2b279f058562b818@mail.gmail.com> They are individual. On a recent import of 22188 records. I obtained these 11 unique time stamps: 2009-06-11 05:45:04.857 2009-06-11 05:45:04.637 2009-06-11 05:45:03.480 2009-06-11 05:45:03.683 2009-06-11 05:45:04.780 2009-06-11 05:45:04.480 2009-06-11 05:45:03.607 2009-06-11 05:45:04.247 2009-06-11 05:45:03.373 2009-06-11 05:45:04.920 2009-06-11 05:45:04.717 On Thu, Jun 11, 2009 at 4:52 PM, jwcolby wrote: > If I update a field in millions of records with GetDate, will every record > get the same date / time > value? Or will later updates get a later time if the time of that record > update happens a second or > more later than earlier updates? > > > IOW does SQL Server get one date/time value and use that value for all > updates in that query? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fuller.artful at gmail.com Thu Jun 11 20:16:48 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 11 Jun 2009 21:16:48 -0400 Subject: [dba-SQLServer] Syntax to add field to index In-Reply-To: <4A3142E5.8020204@colbyconsulting.com> References: <4A3142E5.8020204@colbyconsulting.com> Message-ID: <29f585dd0906111816l11b23ddahb763d017cb8ed19d@mail.gmail.com> I looked into this on your behalf and have not come up with anything useful (c.f. ALTER INDEX etc.). My suggestion thereore is to drop the index(es) and create from scratch. This syntax is trivial and by now I'm sure that you know it by rote. You have wrestled numeruous pigs in the mud in this app, so I won't bother you with redundant ops. There (IMO) is no advantage to be gained by any ALTER INDEX variation. Better to DROP INDEX then recreate it according to your new requirements. A. On Thu, Jun 11, 2009 at 1:46 PM, jwcolby wrote: > I need to create an index on a table, then use the index to update another > field, then add that > other field to the index. Is there a syntax to add a field to an existing > index or is it just drop > / create index? > > I create indexes in stored procedures, but I have never added another field > to an existing index. > > From jwcolby at colbyconsulting.com Thu Jun 11 22:02:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 11 Jun 2009 23:02:05 -0400 Subject: [dba-SQLServer] SPAM-LOW: Re: Syntax to add field to index In-Reply-To: <29f585dd0906111816l11b23ddahb763d017cb8ed19d@mail.gmail.com> References: <4A3142E5.8020204@colbyconsulting.com> <29f585dd0906111816l11b23ddahb763d017cb8ed19d@mail.gmail.com> Message-ID: <4A31C52D.6060305@colbyconsulting.com> Roger that, it is as I suspected. Thanks Arthur. John W. Colby www.ColbyConsulting.com Arthur Fuller wrote: > I looked into this on your behalf and have not come up with anything useful > (c.f. ALTER INDEX etc.). > > My suggestion thereore is to drop the index(es) and create from scratch. > This syntax is trivial and by now I'm sure that you know it by rote. You > have wrestled numeruous pigs in the mud in this app, so I won't bother you > with redundant ops. > > There (IMO) is no advantage to be gained by any ALTER INDEX variation. > Better to DROP INDEX then recreate it according to your new requirements. > > A. > > On Thu, Jun 11, 2009 at 1:46 PM, jwcolby wrote: > >> I need to create an index on a table, then use the index to update another >> field, then add that >> other field to the index. Is there a syntax to add a field to an existing >> index or is it just drop >> / create index? >> >> I create indexes in stored procedures, but I have never added another field >> to an existing index. >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Jun 13 19:00:06 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 13 Jun 2009 20:00:06 -0400 Subject: [dba-SQLServer] Raid for reliability on SSDs Message-ID: <4A343D86.1060303@colbyconsulting.com> I have a very unique situation which I have discussed in other emails. The situation is that I have a SQL Server database where I intend to place just cover indexes (assuming I can do that) into database files out on a RAID of SSDs. The main database tables will continue to reside on a normal raid 6 array. My question is, if I have the original READ-ONLY data tables on a raid 6 array, and I am just building cover indexes into a RAID of SSDs, is it necessary to use a "redundant" array, or can I just go RAID 0 with no redundancy. SSDs are still quite expensive and if I could go with 2 or 3 120g SSDs RAID 0 I would get much better read speed and more volume size than if I used the same number of drives RAID 5. IOW if a drive fails so what? The table used to generate the cover index sits out on a fully protected RAID 6 array. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jun 13 21:47:27 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 13 Jun 2009 22:47:27 -0400 Subject: [dba-SQLServer] [AccessD] Raid for reliability on SSDs In-Reply-To: References: <4A343D86.1060303@colbyconsulting.com> Message-ID: <4A3464BF.5080507@colbyconsulting.com> William, > ...mind if I ask wtf is a "cover index"? Well... I am not anywhere near an expert... but apparently in SQL Server if you build an index that "covers" all of the fields used in a where clause, joins etc for a given query, then the data is pulled directly out of the index itself rather than having to go read each row of the table that the index covers. I am guessing that the same might be true for Access as well though I have never researched it. Let's take an example... I have a real table that is 50 million rows and 640 fields. This is the center of the client's universe. I might write a query (that joins to another query on PK) such as... SELECT PK from tblHSID WHERE (Age = X) AND (Sex = Y) AND (income in (C,D,E,F,G)) AND ((HasDogs = Y) OR (HasCats = Y) You get the idea... So, if I have a single index on Age, Sex, Income, HasDogs and HasCats then the data is already stored in the index and only that index will be used for the where clause. If any field is missing (and for sure if it is not in another index) then SQL Server will have to "Scan" through all 50 million records looking for the data in the actual fields of the table to get the data to perform the where. As you might imagine, scanning through 50 million records with 640 columns is "not only slow, but DAMNED SLOW". So I set up "cover indexes" for all of the major fields that are in every order. For example the age, sex, income kind of stuff plus the PKID might be in one "cover index". Then I set up other cover indexes over "sets" of fields. For example the client often does orders for arthritis, and there are about 10 fields that ORed together indicate someone that might have arthritis. So I "cover" all of those fields plus the PKID. Thus an order like that might use TWO "cover" indexes, one for the age/sex/income and a second for the arthritis fields, joining on the PKID. The intent is to allow SQL Server to find all of the data in two indexes instead of scanning 50 million records. I am addressing this response to the SQL Server group as well so that anyone over there who might know more, or be able to explain it better, or even tell me I am out of luck that it doesn't work that way can speak up. I can tell you that before I discovered this my queries were taking a half hour to run. After discovering the cover indexes and using them, my times dropped to a minute or two or three or five so it does in fact appear to work that way. So the point NOW... is to place just those indexes in separate files out on a raid of SSDs. MAYBE I will get results down to a 10/20/30 seconds? When you are dealing with the table sizes that I am, and the number of steps to do the stuff that I am, every minute counts. I can't tell you the number of times I start a query and just twiddle my thumbs for 2 or 3 or 5 minutes waiting for the results. Not enough time to switch gears to something else but a huge waste of time none the less. I am going to try splitting the indexes out and placing them on a RAID 1 array on a pair of normal 500g hard drives. This will likely slow me down a tad, or even a lot, since a RAID 6 with 6 drives (where they are now) streams data much faster than a raid 1 will. However I will have figured out how to split the indexes out, and have them in separate files when I finally get the SSDs. Furthermore I do have extra 500g drives hanging around I can add to the array if I need to get the streaming speed up temporarily until I get the SSDs. I am willing to bet a fairly large chunk of money that the indexes on a raid SSD will be smokin' fast. In fact I will likely drop them on their own controller to give them their own coprocessor and their own path to the CPU. If this works my speeds will be in the big leagues. Or at least bigger leagues. ;) John W. Colby www.ColbyConsulting.com William Hindman wrote: > ...mind if I ask wtf is a "cover index"? > > William From jwcolby at colbyconsulting.com Sat Jun 13 22:25:52 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 13 Jun 2009 23:25:52 -0400 Subject: [dba-SQLServer] SSD on raid Message-ID: <4A346DC0.2080303@colbyconsulting.com> Here is the counterpart to the test results I posted before, this shows RAID 0 using the Intel raid controller on the motherboard. It would be interesting to see what a hardware raid controller would add to the results. http://benchmarkreviews.com/index.php?option=com_content&task=view&id=318&Itemid=60 All in all RAID 0 does what you would expect, increases bandwidth / streaming read/write speeds.As soon as I get reimbursed for the hardware I have already bought, I will likely go do this with two or possibly even three of these drives. To satisfy my own curiosity I am going to try some real world tests using SQL Server, with the indexes on RAID 0 hard disk and the indexes on RAID 0 SSDs. I have big enough data sets to clearly define relative speeds. I will keep you posted. And... I still need knowledgeable responses to whether using RAID 0 is an OK thing to do for just the SQL Server index files used as I have described. -- John W. Colby www.ColbyConsulting.com From listmaster at databaseadvisors.com Tue Jun 16 12:10:00 2009 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Tue, 16 Jun 2009 13:10:00 -0400 Subject: [dba-SQLServer] Administrivia - Dickford Cohn Donation Fund In-Reply-To: <05bf01c9ee8b$3f2935e0$bd7ba1a0$@net> References: <05bf01c9ee8b$3f2935e0$bd7ba1a0$@net> Message-ID: "We're a family." Members often share that sentiment in their posts. The Database Advisor group is a family. It's obvious in our responses and brief explosions of humor that we care about one another. Dickford Cohn, a member of our family has suffered a great loss. Due to a fire, this member has lost his home and all of his belongings. He recently spent a number of weeks in the hospital, recovering from serious burns. You can read more about his horrific encounter with death in the online article, Hawker dragged from trailer fire. Keys News The DBA Board of Directors recently voted to accept donations from members on Dickford's behalf. The DBA organization will keep nothing for administrative purposes -- we will forward every cent donated to Dickford. >From the time of this message until July 31, 2009, every donation received will go to Dickford Cohn. Make your donation via our existing PayPal account link. If you prefer snail mail, please send donation to the following address: Database Advisors, Inc. 814 Peppard Drive Bel Air, MD 21014 Please make your check or money order payable to Database Advisors, Inc. As always, donations of any kind are not mandatory for membership. John R. Bartow President Database Advisors, Inc. Email: president at databaseadvisors.com From listmaster at databaseadvisors.com Tue Jun 16 12:23:45 2009 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Tue, 16 Jun 2009 13:23:45 -0400 Subject: [dba-SQLServer] Administrivia - Dickford Cohn Donation Fund In-Reply-To: References: <05bf01c9ee8b$3f2935e0$bd7ba1a0$@net> Message-ID: RESEND with Links this time. Bryan "We're a family." Members often share that sentiment in their posts. The Database Advisor group is a family. It's obvious in our responses and brief explosions of humor that we care about one another. Dickford Cohn, a member of our family has suffered a great loss. Due to a fire, this member has lost his home and all of his belongings. He recently spent a number of weeks in the hospital, recovering from serious burns. You can read more about his horrific encounter with death in the online article, Hawker dragged from trailer fire. Keys News ( http://keysnews.com/node/13470 ) The DBA Board of Directors recently voted to accept donations from members on Dickford's behalf. The DBA organization will keep nothing for administrative purposes -- we will forward every cent donated to Dickford. >From the time of this message until July 31, 2009, every donation received will go to Dickford Cohn. Make your donation via our existing PayPal account link ( http://www.databaseadvisors.com/donations/dickford.asp ). If you prefer snail mail, please send donation to the following address: Database Advisors, Inc. 814 Peppard Drive Bel Air, MD 21014 Please make your check or money order payable to Database Advisors, Inc. As always, donations of any kind are not mandatory for membership. John R. Bartow President Database Advisors, Inc. Email: president at databaseadvisors.com From ssharkins at gmail.com Tue Jun 16 12:35:16 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Tue, 16 Jun 2009 13:35:16 -0400 Subject: [dba-SQLServer] Administrivia - Dickford Cohn Donation Fund References: <05bf01c9ee8b$3f2935e0$bd7ba1a0$@net> Message-ID: <845A21F5757D4528AD4FFAB2B137E89A@SusanOne> Well, they're showing up now -- how weird! But, I rechecked the message I received earlier and they're not there -- might just be something in my settings. I checked the donations pages and they're all blank. ----- Original Message ----- From: "Bryan Carbonnell" To: Sent: Tuesday, June 16, 2009 1:23 PM Subject: [dba-SQLServer] Administrivia - Dickford Cohn Donation Fund > RESEND with Links this time. > Bryan > > "We're a family." > > Members often share that sentiment in their posts. The Database > Advisor group is a family. It's obvious in our responses and brief > explosions of humor that we care about one another. > > Dickford Cohn, a member of our family has suffered a great loss. Due > to a fire, this member has lost his home and all of his belongings. He > recently spent a number of weeks in the hospital, recovering from > serious burns. You can read more about his horrific encounter with > death in the online article, Hawker dragged from trailer fire. Keys > News ( http://keysnews.com/node/13470 ) > > The DBA Board of Directors recently voted to accept donations from > members on Dickford's behalf. The DBA organization will keep nothing > for administrative purposes -- we will forward every cent donated to > Dickford. > >>From the time of this message until July 31, 2009, every donation > received will go to Dickford Cohn. > > Make your donation via our existing PayPal account link ( > http://www.databaseadvisors.com/donations/dickford.asp ). > > If you prefer snail mail, please send donation to the following address: > > Database Advisors, Inc. > 814 Peppard Drive > Bel Air, MD 21014 > > > Please make your check or money order payable to Database Advisors, > Inc. As always, donations of any kind are not mandatory for > membership. > > John R. Bartow > > President Database Advisors, Inc. > Email: president at databaseadvisors.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From accessd at shaw.ca Tue Jun 16 13:45:44 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 16 Jun 2009 11:45:44 -0700 Subject: [dba-SQLServer] Administrivia - Dickford Cohn Donation Fund In-Reply-To: <845A21F5757D4528AD4FFAB2B137E89A@SusanOne> References: <05bf01c9ee8b$3f2935e0$bd7ba1a0$@net> <845A21F5757D4528AD4FFAB2B137E89A@SusanOne> Message-ID: Hi Susan: The donation pages are blank on purpose as the related donation run is now over but the current donation run (http://www.databaseadvisors.com/donations/dickford.asp)is exclusively for DBA members and so the associated page is not public. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Tuesday, June 16, 2009 10:35 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Administrivia - Dickford Cohn Donation Fund Well, they're showing up now -- how weird! But, I rechecked the message I received earlier and they're not there -- might just be something in my settings. I checked the donations pages and they're all blank. ----- Original Message ----- From: "Bryan Carbonnell" To: Sent: Tuesday, June 16, 2009 1:23 PM Subject: [dba-SQLServer] Administrivia - Dickford Cohn Donation Fund > RESEND with Links this time. > Bryan > > "We're a family." > > Members often share that sentiment in their posts. The Database > Advisor group is a family. It's obvious in our responses and brief > explosions of humor that we care about one another. > > Dickford Cohn, a member of our family has suffered a great loss. Due > to a fire, this member has lost his home and all of his belongings. He > recently spent a number of weeks in the hospital, recovering from > serious burns. You can read more about his horrific encounter with > death in the online article, Hawker dragged from trailer fire. Keys > News ( http://keysnews.com/node/13470 ) > > The DBA Board of Directors recently voted to accept donations from > members on Dickford's behalf. The DBA organization will keep nothing > for administrative purposes -- we will forward every cent donated to > Dickford. > >>From the time of this message until July 31, 2009, every donation > received will go to Dickford Cohn. > > Make your donation via our existing PayPal account link ( > http://www.databaseadvisors.com/donations/dickford.asp ). > > If you prefer snail mail, please send donation to the following address: > > Database Advisors, Inc. > 814 Peppard Drive > Bel Air, MD 21014 > > > Please make your check or money order payable to Database Advisors, > Inc. As always, donations of any kind are not mandatory for > membership. > > John R. Bartow > > President Database Advisors, Inc. > Email: president at databaseadvisors.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jun 17 07:26:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 17 Jun 2009 08:26:05 -0400 Subject: [dba-SQLServer] can't specify database in DROP INDEX Message-ID: <4A38E0DD.5040902@colbyconsulting.com> Am I missing something? CREATE INDEX allows me to specify the database but DROP INDEX gives me an error message 'DROP INDEX does not allow specifying database name...' Please tell me there is a way around this. -- John W. Colby www.ColbyConsulting.com From fuller.artful at gmail.com Wed Jun 17 07:41:29 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Wed, 17 Jun 2009 08:41:29 -0400 Subject: [dba-SQLServer] can't specify database in DROP INDEX In-Reply-To: <4A38E0DD.5040902@colbyconsulting.com> References: <4A38E0DD.5040902@colbyconsulting.com> Message-ID: <29f585dd0906170541ka35f366j3493bb463983451c@mail.gmail.com> USE DROP INDEX hth, Arthur On Wed, Jun 17, 2009 at 8:26 AM, jwcolby wrote: > Am I missing something? > > CREATE INDEX allows me to specify the database but DROP INDEX gives me an > error message > > 'DROP INDEX does not allow specifying database name...' > > Please tell me there is a way around this. > > From jwcolby at colbyconsulting.com Wed Jun 17 08:01:49 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 17 Jun 2009 09:01:49 -0400 Subject: [dba-SQLServer] can't specify database in DROP INDEX In-Reply-To: <29f585dd0906170541ka35f366j3493bb463983451c@mail.gmail.com> References: <4A38E0DD.5040902@colbyconsulting.com> <29f585dd0906170541ka35f366j3493bb463983451c@mail.gmail.com> Message-ID: <4A38E93D.9070301@colbyconsulting.com> I found AN answer. It turns out that there are two valid syntaxes DROP INDEX TblName.IndexName. With this syntax it is NOT valid to specify the database name, i.e. DBName.TblName.IndexName. Another syntax is DROP INDEX IndexName ON DatabaseName.TableName where it IS valid to include the database name. Thanks for all your help! ;) John W. Colby www.ColbyConsulting.com Arthur Fuller wrote: > USE > DROP INDEX > > hth, > Arthur > > On Wed, Jun 17, 2009 at 8:26 AM, jwcolby wrote: > >> Am I missing something? >> >> CREATE INDEX allows me to specify the database but DROP INDEX gives me an >> error message >> >> 'DROP INDEX does not allow specifying database name...' >> >> Please tell me there is a way around this. >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From dw-murphy at cox.net Thu Jun 18 13:32:28 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 18 Jun 2009 11:32:28 -0700 Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition In-Reply-To: <4A38E93D.9070301@colbyconsulting.com> References: <4A38E0DD.5040902@colbyconsulting.com><29f585dd0906170541ka35f366j3493bb463983451c@mail.gmail.com> <4A38E93D.9070301@colbyconsulting.com> Message-ID: Folks, I am looking at installing SQL Server 2005 developer edition on my development system? The computer currently has Visual Studio 2008 and SQL Server 2005 express edition on it. As things stand now Visual Studio uses the Express edition for projects and web sites. I don't want to screw up my current projects. I would like to have access to the Full version of Management Studio to work on some remote servers. What is the consensus of the SQL Server gurus on the best way to do this? Thanks in advance. Doug From fhtapia at gmail.com Thu Jun 18 18:35:36 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 18 Jun 2009 16:35:36 -0700 Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition In-Reply-To: References: <4A38E0DD.5040902@colbyconsulting.com> <29f585dd0906170541ka35f366j3493bb463983451c@mail.gmail.com> <4A38E93D.9070301@colbyconsulting.com> Message-ID: Doug, Sorry for the late reply, but I've been tied up most of the day...It won't upgrade, the installer will instead put you through the process of installing developer as an instance. There is nothing wrong with this, as it's done by design so you can have multiple instances running on one server, it helps with keeping things separate. Express has a few limitations and it's almost worth uninstalling in lieu of developer as developer behaves like the enterprise edition (OS limitations apply). -Francisco http://sqlthis.blogspot.com | Tsql and More... On Thu, Jun 18, 2009 at 11:32 AM, Doug Murphy wrote: > Folks, > > I am looking at installing SQL Server 2005 developer edition on my > development system? The computer currently has Visual Studio 2008 and SQL > Server 2005 express edition on it. As things stand now Visual Studio uses > the Express edition for projects and web sites. I don't want to screw up my > current projects. I would like to have access to the Full version of > Management Studio to work on some remote servers. > > What is the consensus of the SQL Server gurus on the best way to do this? > > Thanks in advance. > > Doug > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From james at fcidms.com Fri Jun 19 08:33:19 2009 From: james at fcidms.com (James Barash) Date: Fri, 19 Jun 2009 09:33:19 -0400 Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition In-Reply-To: Message-ID: <12D2F894654B53498DEF840AE12B7BB3115C0933@fciexchange.fcidms.com> Doug: If you just need the Management Studio, you can install that by itself, without installing an instance of SQL Server 2005. I've done that with Management Studio 2008. As I recall, you start the installation and just select the Client Tools and make sure to deselect everything else. I also have the Developer and Express editions on my desktop and they run together without any problems. You just need to install the second version as a named instance. Although I usually shut down the one I'm not using to save memory. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, June 18, 2009 2:32 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition Folks, I am looking at installing SQL Server 2005 developer edition on my development system? The computer currently has Visual Studio 2008 and SQL Server 2005 express edition on it. As things stand now Visual Studio uses the Express edition for projects and web sites. I don't want to screw up my current projects. I would like to have access to the Full version of Management Studio to work on some remote servers. What is the consensus of the SQL Server gurus on the best way to do this? Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From dw-murphy at cox.net Fri Jun 19 10:58:24 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Fri, 19 Jun 2009 08:58:24 -0700 Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition In-Reply-To: <12D2F894654B53498DEF840AE12B7BB3115C0933@fciexchange.fcidms.com> References: <12D2F894654B53498DEF840AE12B7BB3115C0933@fciexchange.fcidms.com> Message-ID: <71EDA02CC7B3425BA9F2407A708810D9@murphy3234aaf1> James, Thank you for your suggestions. Looks like it is something that can be done. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of James Barash Sent: Friday, June 19, 2009 6:33 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition Doug: If you just need the Management Studio, you can install that by itself, without installing an instance of SQL Server 2005. I've done that with Management Studio 2008. As I recall, you start the installation and just select the Client Tools and make sure to deselect everything else. I also have the Developer and Express editions on my desktop and they run together without any problems. You just need to install the second version as a named instance. Although I usually shut down the one I'm not using to save memory. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, June 18, 2009 2:32 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition Folks, I am looking at installing SQL Server 2005 developer edition on my development system? The computer currently has Visual Studio 2008 and SQL Server 2005 express edition on it. As things stand now Visual Studio uses the Express edition for projects and web sites. I don't want to screw up my current projects. I would like to have access to the Full version of Management Studio to work on some remote servers. What is the consensus of the SQL Server gurus on the best way to do this? Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From David at sierranevada.com Fri Jun 19 13:04:56 2009 From: David at sierranevada.com (David Lewis) Date: Fri, 19 Jun 2009 11:04:56 -0700 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 In-Reply-To: References: Message-ID: <01606FC26AD0E54B8348D886D0C074D33BF90FA259@schwarz.sierranevada.corp> Doug: Coincidentally I just upgraded my management studio from 2000 to 2008 yesterday. I had sqlprompt (from Redgate) installed, and that caused the install to bonk. There is a patch they've issued to allow the install to proceed although I hacked around it by renaming a registry key temporarily. Details on that via google. But more importantly, I found after the upgrade that some ssis packages broke. Thankfully they were still in dev stage. I don't remember all the things that went wrong, but some of them were relative paths in script tasks no longer worked (had to change to absolute paths), and some db connections just plain broke. hth. d lewis Message: 3 Date: Fri, 19 Jun 2009 09:33:19 -0400 From: James Barash Subject: Re: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition To: Discussion concerning MS SQL Server Message-ID: <12D2F894654B53498DEF840AE12B7BB3115C0933 at fciexchange.fcidms.com> Content-Type: text/plain; charset="us-ascii" Doug: If you just need the Management Studio, you can install that by itself, without installing an instance of SQL Server 2005. I've done that with Management Studio 2008. As I recall, you start the installation and just select the Client Tools and make sure to deselect everything else. I also have the Developer and Express editions on my desktop and they run together without any problems. You just need to install the second version as a named instance. Although I usually shut down the one I'm not using to save memory. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, June 18, 2009 2:32 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition Folks, I am looking at installing SQL Server 2005 developer edition on my development system? The computer currently has Visual Studio 2008 and SQL Server 2005 express edition on it. As things stand now Visual Studio uses the Express edition for projects and web sites. I don't want to screw up my current projects. I would like to have access to the Full version of Management Studio to work on some remote servers. What is the consensus of the SQL Server gurus on the best way to do this? Thanks in advance. Doug The contents of this e-mail message and its attachments are covered by the Electronic Communications Privacy Act (18 U.S.C. 2510-2521) and are intended solely for the addressee(s) hereof. If you are not the named recipient, or the employee or agent responsible for delivering the message to the intended recipient, or if this message has been addressed to you in error, you are directed not to read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. If you have received this communication in error, please notify us immediately by return e-mail or by telephone, 530-893-3520, and delete and/or destroy all copies of the message immediately. From dw-murphy at cox.net Fri Jun 19 15:18:32 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Fri, 19 Jun 2009 13:18:32 -0700 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 In-Reply-To: <01606FC26AD0E54B8348D886D0C074D33BF90FA259@schwarz.sierranevada.corp> References: <01606FC26AD0E54B8348D886D0C074D33BF90FA259@schwarz.sierranevada.corp> Message-ID: Hi Dave, Thanks for the insight. The only projects I really have on this machine that use SQL server are some Visual Studio applications and several ASP.NET sites. They all are using my SQL Express server now. I can redo the connection strings but would preffer not to if Express and the full version are compatible on the same machine. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Lewis Sent: Friday, June 19, 2009 11:05 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 Doug: Coincidentally I just upgraded my management studio from 2000 to 2008 yesterday. I had sqlprompt (from Redgate) installed, and that caused the install to bonk. There is a patch they've issued to allow the install to proceed although I hacked around it by renaming a registry key temporarily. Details on that via google. But more importantly, I found after the upgrade that some ssis packages broke. Thankfully they were still in dev stage. I don't remember all the things that went wrong, but some of them were relative paths in script tasks no longer worked (had to change to absolute paths), and some db connections just plain broke. hth. d lewis Message: 3 Date: Fri, 19 Jun 2009 09:33:19 -0400 From: James Barash Subject: Re: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition To: Discussion concerning MS SQL Server Message-ID: <12D2F894654B53498DEF840AE12B7BB3115C0933 at fciexchange.fcidms.com> Content-Type: text/plain; charset="us-ascii" Doug: If you just need the Management Studio, you can install that by itself, without installing an instance of SQL Server 2005. I've done that with Management Studio 2008. As I recall, you start the installation and just select the Client Tools and make sure to deselect everything else. I also have the Developer and Express editions on my desktop and they run together without any problems. You just need to install the second version as a named instance. Although I usually shut down the one I'm not using to save memory. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, June 18, 2009 2:32 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition Folks, I am looking at installing SQL Server 2005 developer edition on my development system? The computer currently has Visual Studio 2008 and SQL Server 2005 express edition on it. As things stand now Visual Studio uses the Express edition for projects and web sites. I don't want to screw up my current projects. I would like to have access to the Full version of Management Studio to work on some remote servers. What is the consensus of the SQL Server gurus on the best way to do this? Thanks in advance. Doug The contents of this e-mail message and its attachments are covered by the Electronic Communications Privacy Act (18 U.S.C. 2510-2521) and are intended solely for the addressee(s) hereof. If you are not the named recipient, or the employee or agent responsible for delivering the message to the intended recipient, or if this message has been addressed to you in error, you are directed not to read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. If you have received this communication in error, please notify us immediately by return e-mail or by telephone, 530-893-3520, and delete and/or destroy all copies of the message immediately. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at gmail.com Mon Jun 22 09:04:33 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 22 Jun 2009 10:04:33 -0400 Subject: [dba-SQLServer] Looking for SAP - HR Payroll Analyst Message-ID: If you have the skills to fill this position or know someone who does, please send me a resume. Susan H. From jwcolby at colbyconsulting.com Tue Jun 23 06:42:59 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 23 Jun 2009 07:42:59 -0400 Subject: [dba-SQLServer] Interesting read on capturing I/O patterns Message-ID: <4A40BFC3.8040704@colbyconsulting.com> http://www.sqlservercentral.com/articles/I%2fO/66420/ -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jun 23 08:53:04 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 23 Jun 2009 09:53:04 -0400 Subject: [dba-SQLServer] Append several fields into one Message-ID: <4A40DE40.3010806@colbyconsulting.com> I am trying to append all of the pieces of an address into a single address string. As an example, if I have the address: 121 S. Main Street NE Apt #201 this address will be stored with standardized spellings of all the parts into a set of fields: 121 S Main St NE Apt 201 I need to get this all back into a single field. Understand however that lots of those pieces might be missing in any given address. For example the next field might be: 121 Main St Ste 1342 So... I need to get all the pieces back into a single address field. If a piece exists then it needs padding around it so I don't end up with: 121MainStSte1342 But if a piece does not exist then I do not want the padding for that missing field. I am assuming that I will be using a stored procedure. Pass in the database, table, UnifiedAddressField, then all of the field parts. It seems clumsy to do it this way, not to mention record by record, for 50 million records... well... There must be a better way. Has anyone on the list done this before? -- John W. Colby www.ColbyConsulting.com From JHewson at nciinc.com Tue Jun 23 09:13:19 2009 From: JHewson at nciinc.com (Hewson, Jim ) Date: Tue, 23 Jun 2009 09:13:19 -0500 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: <4A40DE40.3010806@colbyconsulting.com> References: <4A40DE40.3010806@colbyconsulting.com> Message-ID: <7E02B06E41E5404589EDDDA2BAA1C5A86BDFD9@sanex101.nciinc.com> I've done it, but not for that many records. I'm not sure how fast it would be. What I did was use a series IF statements in a view and then used that view to update the new record. For example.... Field names for the below could be: HouseNumber; HouseDirection, StreetName, StreetIdentifier; CityDirection; UnitIdentifier; UnitNumber And then to shorten them for ease of the example: HN, HD, SN, SI, CD, UI, UN IIF(IsNull(HN),"", HN &" ") & IIF(IsNull(HD),"", HD &" ") & IIF(IsNull(SN),"", SN &" ") & _ IIF(IsNull(SI),"", SI &" ") & IIF(IsNull(CD),"", CD &" ") & IIF(IsNull(UI),"", UI &" ") & _ IIF(IsNull(UN),"", UN &" ") Instead of IsNull a >" " statement could be used or something similar. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, June 23, 2009 8:53 AM To: Dba-Sqlserver Subject: [dba-SQLServer] Append several fields into one I am trying to append all of the pieces of an address into a single address string. As an example, if I have the address: 121 S. Main Street NE Apt #201 this address will be stored with standardized spellings of all the parts into a set of fields: 121 S Main St NE Apt 201 I need to get this all back into a single field. Understand however that lots of those pieces might be missing in any given address. For example the next field might be: 121 Main St Ste 1342 So... I need to get all the pieces back into a single address field. If a piece exists then it needs padding around it so I don't end up with: 121MainStSte1342 But if a piece does not exist then I do not want the padding for that missing field. I am assuming that I will be using a stored procedure. Pass in the database, table, UnifiedAddressField, then all of the field parts. It seems clumsy to do it this way, not to mention record by record, for 50 million records... well... There must be a better way. Has anyone on the list done this before? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com ################################################################################ If you have received this message in error, please contact the sender immediately and be aware that the use, copying, or dissemination of this information is prohibited. This email transmission contains information from NCI Information Systems, Inc. that may be considered privileged or confidential and is intended solely for the named recipient. ################################################################################ From fahooper at trapo.com Tue Jun 23 09:17:55 2009 From: fahooper at trapo.com (Fred Hooper) Date: Tue, 23 Jun 2009 10:17:55 -0400 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: <4A40DE40.3010806@colbyconsulting.com> References: <4A40DE40.3010806@colbyconsulting.com> Message-ID: <4A40E413.5020604@trapo.com> How about just concatenating them with spaces inside some nested replace statements to remove the multiple spaces? jwcolby wrote: > I am trying to append all of the pieces of an address into a single address string. As an example, > if I have the address: > > 121 S. Main Street NE Apt #201 > > this address will be stored with standardized spellings of all the parts into a set of fields: > > 121 > S > Main > St > NE > Apt > 201 > > I need to get this all back into a single field. Understand however that lots of those pieces might > be missing in any given address. For example the next field might be: > > 121 > > Main > St > > Ste > 1342 > > So... I need to get all the pieces back into a single address field. If a piece exists then it > needs padding around it so I don't end up with: > > 121MainStSte1342 > > But if a piece does not exist then I do not want the padding for that missing field. > > I am assuming that I will be using a stored procedure. Pass in the database, table, > UnifiedAddressField, then all of the field parts. > > It seems clumsy to do it this way, not to mention record by record, for 50 million records... well... > > There must be a better way. Has anyone on the list done this before? > > From fhtapia at gmail.com Tue Jun 23 09:42:35 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 23 Jun 2009 07:42:35 -0700 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: <4A40DE40.3010806@colbyconsulting.com> References: <4A40DE40.3010806@colbyconsulting.com> Message-ID: John, you can do it right out of a select, something like this IsNull(StreetNumber + ' ', '') + IsNull(Direction + ' ', '') + IsNull(StreetName + ' ', '') etc... I added the space padding right inside of the IsNull formula because this way you get a padding, for each field, unless there is nothing then the result is no padding. In Sql Server Null + a value = Null :) If you don't want to accidentally end up with a space padding on the right simply trim your statement with RTRIM(your isnull series) -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Jun 23, 2009 at 6:53 AM, jwcolby wrote: > I am trying to append all of the pieces of an address into a single address > string. As an example, > if I have the address: > > 121 S. Main Street NE Apt #201 > > this address will be stored with standardized spellings of all the parts > into a set of fields: > > 121 > S > Main > St > NE > Apt > 201 > > I need to get this all back into a single field. Understand however that > lots of those pieces might > be missing in any given address. For example the next field might be: > > 121 > > Main > St > > Ste > 1342 > > So... I need to get all the pieces back into a single address field. If a > piece exists then it > needs padding around it so I don't end up with: > > 121MainStSte1342 > > But if a piece does not exist then I do not want the padding for that > missing field. > > I am assuming that I will be using a stored procedure. Pass in the > database, table, > UnifiedAddressField, then all of the field parts. > > It seems clumsy to do it this way, not to mention record by record, for 50 > million records... well... > > There must be a better way. Has anyone on the list done this before? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From ssharkins at gmail.com Tue Jun 23 10:17:32 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Tue, 23 Jun 2009 11:17:32 -0400 Subject: [dba-SQLServer] Another good one from Francisco Message-ID: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> Sending E-mail from SQL Server 200X Susan H. From jwcolby at colbyconsulting.com Tue Jun 23 10:27:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 23 Jun 2009 11:27:08 -0400 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: References: <4A40DE40.3010806@colbyconsulting.com> Message-ID: <4A40F44C.9040009@colbyconsulting.com> This certainly looks like the answer. Now to turn the computer loose for a week, updating the address field... There are about 6 or 8 of these address parts, each will now be inside of an IsNull(). ;) Is it possible to do this X records at a time? IOW I have a fifty million record table. I want to cause the computer to go off and start doing this but I also want the table that is being updated to be available for use while this is happening (for selection queries). How do I tell SQL Server to do updates in blocks of 1000 records or something like that? Can I dynamically change that "number of records updated at a time" inside of a stored procedure? John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > John, you can do it right out of a select, something like this > > IsNull(StreetNumber + ' ', '') + IsNull(Direction + ' ', '') + > IsNull(StreetName + ' ', '') etc... > > I added the space padding right inside of the IsNull formula because this > way you get a padding, for each field, unless there is nothing then the > result is no padding. In Sql Server Null + a value = Null :) > > If you don't want to accidentally end up with a space padding on the right > simply trim your statement with RTRIM(your isnull series) > > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Tue, Jun 23, 2009 at 6:53 AM, jwcolby wrote: > >> I am trying to append all of the pieces of an address into a single address >> string. As an example, >> if I have the address: >> >> 121 S. Main Street NE Apt #201 >> >> this address will be stored with standardized spellings of all the parts >> into a set of fields: >> >> 121 >> S >> Main >> St >> NE >> Apt >> 201 >> >> I need to get this all back into a single field. Understand however that >> lots of those pieces might >> be missing in any given address. For example the next field might be: >> >> 121 >> >> Main >> St >> >> Ste >> 1342 >> >> So... I need to get all the pieces back into a single address field. If a >> piece exists then it >> needs padding around it so I don't end up with: >> >> 121MainStSte1342 >> >> But if a piece does not exist then I do not want the padding for that >> missing field. >> >> I am assuming that I will be using a stored procedure. Pass in the >> database, table, >> UnifiedAddressField, then all of the field parts. >> >> It seems clumsy to do it this way, not to mention record by record, for 50 >> million records... well... >> >> There must be a better way. Has anyone on the list done this before? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Tue Jun 23 13:39:40 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 23 Jun 2009 11:39:40 -0700 Subject: [dba-SQLServer] Another good one from Francisco In-Reply-To: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> References: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> Message-ID: Thank you for the shameless plug :) -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Jun 23, 2009 at 8:17 AM, Susan Harkins wrote: > > > Sending E-mail from SQL Server 200X > > Susan H. > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From ssharkins at gmail.com Tue Jun 23 13:50:58 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Tue, 23 Jun 2009 14:50:58 -0400 Subject: [dba-SQLServer] Another good one from Francisco References: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> Message-ID: <6330E296530F4194939BEFE9DC67D25D@SusanOne> Hey, if we don't toot it, nobody else will! ;) ----- Original Message ----- From: "Francisco Tapia" To: "Discussion concerning MS SQL Server" Sent: Tuesday, June 23, 2009 2:39 PM Subject: Re: [dba-SQLServer] Another good one from Francisco > Thank you for the shameless plug :) > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Tue, Jun 23, 2009 at 8:17 AM, Susan Harkins > wrote: > >> >> >> Sending E-mail from SQL Server 200X >> >> Susan H. >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From fhtapia at gmail.com Tue Jun 23 13:58:12 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 23 Jun 2009 11:58:12 -0700 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: <4A40F44C.9040009@colbyconsulting.com> References: <4A40DE40.3010806@colbyconsulting.com> <4A40F44C.9040009@colbyconsulting.com> Message-ID: I have a solution for this john, but I won't be able to get to it for a bit with some air code.. but essentially what you want to do is to exercise the rowcount setting (ie, SET ROWCOUNT 1000 and you can also add in a delay such as WAITFOR DELAY '00:00:30' for a 30 second delay maybe shorter if needed ... you can also setup your select statements that you need to run with the table hints UPDLOCK and READPAST that way they don't read rows that are locked and still updating. i'll have a working solution sometime after work.. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Jun 23, 2009 at 8:27 AM, jwcolby wrote: > This certainly looks like the answer. Now to turn the computer loose for a > week, updating the > address field... > > There are about 6 or 8 of these address parts, each will now be inside of > an IsNull(). ;) > > Is it possible to do this X records at a time? IOW I have a fifty million > record table. I want to > cause the computer to go off and start doing this but I also want the table > that is being updated to > be available for use while this is happening (for selection queries). How > do I tell SQL Server to > do updates in blocks of 1000 records or something like that? Can I > dynamically change that "number > of records updated at a time" inside of a stored procedure? > > John W. Colby > www.ColbyConsulting.com > > > Francisco Tapia wrote: > > John, you can do it right out of a select, something like this > > > > IsNull(StreetNumber + ' ', '') + IsNull(Direction + ' ', '') + > > IsNull(StreetName + ' ', '') etc... > > > > I added the space padding right inside of the IsNull formula because this > > way you get a padding, for each field, unless there is nothing then the > > result is no padding. In Sql Server Null + a value = Null :) > > > > If you don't want to accidentally end up with a space padding on the > right > > simply trim your statement with RTRIM(your isnull series) > > > > > > > > -Francisco > > http://sqlthis.blogspot.com | Tsql and More... > > > > > > On Tue, Jun 23, 2009 at 6:53 AM, jwcolby >wrote: > > > >> I am trying to append all of the pieces of an address into a single > address > >> string. As an example, > >> if I have the address: > >> > >> 121 S. Main Street NE Apt #201 > >> > >> this address will be stored with standardized spellings of all the parts > >> into a set of fields: > >> > >> 121 > >> S > >> Main > >> St > >> NE > >> Apt > >> 201 > >> > >> I need to get this all back into a single field. Understand however > that > >> lots of those pieces might > >> be missing in any given address. For example the next field might be: > >> > >> 121 > >> > >> Main > >> St > >> > >> Ste > >> 1342 > >> > >> So... I need to get all the pieces back into a single address field. If > a > >> piece exists then it > >> needs padding around it so I don't end up with: > >> > >> 121MainStSte1342 > >> > >> But if a piece does not exist then I do not want the padding for that > >> missing field. > >> > >> I am assuming that I will be using a stored procedure. Pass in the > >> database, table, > >> UnifiedAddressField, then all of the field parts. > >> > >> It seems clumsy to do it this way, not to mention record by record, for > 50 > >> million records... well... > >> > >> There must be a better way. Has anyone on the list done this before? > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-SQLServer mailing list > >> > From jwcolby at colbyconsulting.com Tue Jun 23 14:11:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 23 Jun 2009 15:11:22 -0400 Subject: [dba-SQLServer] Another good one from Francisco In-Reply-To: <6330E296530F4194939BEFE9DC67D25D@SusanOne> References: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> <6330E296530F4194939BEFE9DC67D25D@SusanOne> Message-ID: <4A4128DA.2060606@colbyconsulting.com> Hey, when I toot it clears the room. ;) John W. Colby www.ColbyConsulting.com Susan Harkins wrote: > Hey, if we don't toot it, nobody else will! ;) > > > ----- Original Message ----- > From: "Francisco Tapia" > To: "Discussion concerning MS SQL Server" > > Sent: Tuesday, June 23, 2009 2:39 PM > Subject: Re: [dba-SQLServer] Another good one from Francisco > > >> Thank you for the shameless plug :) >> -Francisco >> http://sqlthis.blogspot.com | Tsql and More... >> >> >> On Tue, Jun 23, 2009 at 8:17 AM, Susan Harkins >> wrote: >> >>> >>> >>> Sending E-mail from SQL Server 200X >>> >>> Susan H. >>> _______________________________________________ >>> dba-SQLServer mailing list >>> dba-SQLServer at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From marklbreen at gmail.com Wed Jun 24 03:15:50 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 24 Jun 2009 09:15:50 +0100 Subject: [dba-SQLServer] Another good one from Francisco In-Reply-To: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> References: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> Message-ID: Hello Susan and Francisco I wish I know about blat a few years ago when I was struggling to get outlook installed on a SQL Server. With 2005 though, is there some hidden benefit that I am missing in your blat code, over the following code. I have met quite a few people of the the last ten years that do not like to use SQL Sever mail, but I have used it with never one complaint for close to ten years now. For me it gives me very quick to implement email facilities. Thanks for blat, Mark EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Server4DBMail', @recipients = 'mark.breen at gmail.com', @query = 'Select * from MyTable', @body = 'Hello World, here is the contents of the table', @subject = 'More SQL Server email', @attach_query_result_as_file = 0 ; 2009/6/23 Susan Harkins > > > Sending E-mail from SQL Server 200X > > Susan H. > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From marklbreen at gmail.com Wed Jun 24 03:23:06 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 24 Jun 2009 09:23:06 +0100 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: <4A40F44C.9040009@colbyconsulting.com> References: <4A40DE40.3010806@colbyconsulting.com> <4A40F44C.9040009@colbyconsulting.com> Message-ID: Hello John, you thought me how to call vba functions in MS Access 97 queries, I was shocked by how powerful that feature was. Have you used functions in SQL Server? If so, please ignore my email and accept my apologies for even asking the question;) I have created a few functions in SQL Server and for low volumes of data, they work great, of course in your case, you are seeking max efficiency and I have no idea about performance of a function versus inline code. I guess no major difference. If you have not used them, give them a try. Thanks Mark 2009/6/23 jwcolby > This certainly looks like the answer. Now to turn the computer loose for a > week, updating the > address field... > > There are about 6 or 8 of these address parts, each will now be inside of > an IsNull(). ;) > > Is it possible to do this X records at a time? IOW I have a fifty million > record table. I want to > cause the computer to go off and start doing this but I also want the table > that is being updated to > be available for use while this is happening (for selection queries). How > do I tell SQL Server to > do updates in blocks of 1000 records or something like that? Can I > dynamically change that "number > of records updated at a time" inside of a stored procedure? > > John W. Colby > www.ColbyConsulting.com > > > Francisco Tapia wrote: > > John, you can do it right out of a select, something like this > > > > IsNull(StreetNumber + ' ', '') + IsNull(Direction + ' ', '') + > > IsNull(StreetName + ' ', '') etc... > > > > I added the space padding right inside of the IsNull formula because this > > way you get a padding, for each field, unless there is nothing then the > > result is no padding. In Sql Server Null + a value = Null :) > > > > If you don't want to accidentally end up with a space padding on the > right > > simply trim your statement with RTRIM(your isnull series) > > > > > > > > -Francisco > > http://sqlthis.blogspot.com | Tsql and More... > > > > > > On Tue, Jun 23, 2009 at 6:53 AM, jwcolby >wrote: > > > >> I am trying to append all of the pieces of an address into a single > address > >> string. As an example, > >> if I have the address: > >> > >> 121 S. Main Street NE Apt #201 > >> > >> this address will be stored with standardized spellings of all the parts > >> into a set of fields: > >> > >> 121 > >> S > >> Main > >> St > >> NE > >> Apt > >> 201 > >> > >> I need to get this all back into a single field. Understand however > that > >> lots of those pieces might > >> be missing in any given address. For example the next field might be: > >> > >> 121 > >> > >> Main > >> St > >> > >> Ste > >> 1342 > >> > >> So... I need to get all the pieces back into a single address field. If > a > >> piece exists then it > >> needs padding around it so I don't end up with: > >> > >> 121MainStSte1342 > >> > >> But if a piece does not exist then I do not want the padding for that > >> missing field. > >> > >> I am assuming that I will be using a stored procedure. Pass in the > >> database, table, > >> UnifiedAddressField, then all of the field parts. > >> > >> It seems clumsy to do it this way, not to mention record by record, for > 50 > >> million records... well... > >> > >> There must be a better way. Has anyone on the list done this before? > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-SQLServer mailing list > >> dba-SQLServer at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Jun 24 06:50:53 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 24 Jun 2009 07:50:53 -0400 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: References: <4A40DE40.3010806@colbyconsulting.com> <4A40F44C.9040009@colbyconsulting.com> Message-ID: <4A42131D.7010507@colbyconsulting.com> Mark, I know that they exist, and I have used them very occasionally. I really need to go become acquainted with all of them, print out a list and study what is available. I am doing rather a lot of stored procedures now, but they mostly just build tables, add fields, indexes, bcp in/out etc. I am still at the advanced beginner level in SQL Server. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > you thought me how to call vba functions in MS Access 97 queries, I was > shocked by how powerful that feature was. > > Have you used functions in SQL Server? If so, please ignore my email and > accept my apologies for even asking the question;) > > I have created a few functions in SQL Server and for low volumes of data, > they work great, of course in your case, you are seeking max efficiency and > I have no idea about performance of a function versus inline code. I guess > no major difference. > > If you have not used them, give them a try. > > Thanks > > Mark > > > > > > 2009/6/23 jwcolby > >> This certainly looks like the answer. Now to turn the computer loose for a >> week, updating the >> address field... >> >> There are about 6 or 8 of these address parts, each will now be inside of >> an IsNull(). ;) >> >> Is it possible to do this X records at a time? IOW I have a fifty million >> record table. I want to >> cause the computer to go off and start doing this but I also want the table >> that is being updated to >> be available for use while this is happening (for selection queries). How >> do I tell SQL Server to >> do updates in blocks of 1000 records or something like that? Can I >> dynamically change that "number >> of records updated at a time" inside of a stored procedure? >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Francisco Tapia wrote: >>> John, you can do it right out of a select, something like this >>> >>> IsNull(StreetNumber + ' ', '') + IsNull(Direction + ' ', '') + >>> IsNull(StreetName + ' ', '') etc... >>> >>> I added the space padding right inside of the IsNull formula because this >>> way you get a padding, for each field, unless there is nothing then the >>> result is no padding. In Sql Server Null + a value = Null :) >>> >>> If you don't want to accidentally end up with a space padding on the >> right >>> simply trim your statement with RTRIM(your isnull series) >>> >>> >>> >>> -Francisco >>> http://sqlthis.blogspot.com | Tsql and More... >>> >>> >>> On Tue, Jun 23, 2009 at 6:53 AM, jwcolby >> wrote: >>> >>>> I am trying to append all of the pieces of an address into a single >> address >>>> string. As an example, >>>> if I have the address: >>>> >>>> 121 S. Main Street NE Apt #201 >>>> >>>> this address will be stored with standardized spellings of all the parts >>>> into a set of fields: >>>> >>>> 121 >>>> S >>>> Main >>>> St >>>> NE >>>> Apt >>>> 201 >>>> >>>> I need to get this all back into a single field. Understand however >> that >>>> lots of those pieces might >>>> be missing in any given address. For example the next field might be: >>>> >>>> 121 >>>> >>>> Main >>>> St >>>> >>>> Ste >>>> 1342 >>>> >>>> So... I need to get all the pieces back into a single address field. If >> a >>>> piece exists then it >>>> needs padding around it so I don't end up with: >>>> >>>> 121MainStSte1342 >>>> >>>> But if a piece does not exist then I do not want the padding for that >>>> missing field. >>>> >>>> I am assuming that I will be using a stored procedure. Pass in the >>>> database, table, >>>> UnifiedAddressField, then all of the field parts. >>>> >>>> It seems clumsy to do it this way, not to mention record by record, for >> 50 >>>> million records... well... >>>> >>>> There must be a better way. Has anyone on the list done this before? >>>> >>>> -- >>>> John W. Colby >>>> www.ColbyConsulting.com >>>> _______________________________________________ >>>> dba-SQLServer mailing list >>>> dba-SQLServer at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-SQLServer mailing list >>> dba-SQLServer at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fuller.artful at gmail.com Wed Jun 24 07:35:48 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Wed, 24 Jun 2009 08:35:48 -0400 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: <4A42131D.7010507@colbyconsulting.com> References: <4A40DE40.3010806@colbyconsulting.com> <4A40F44C.9040009@colbyconsulting.com> <4A42131D.7010507@colbyconsulting.com> Message-ID: <29f585dd0906240535n54ac7240j4289ef440ca2aac4@mail.gmail.com> The execution time varies significantly with the nature of a given function. I love UDFs but experience has taught me that they can be expensive. A while ago I inherited a database that used lots and lots of UDFs for simple lookups, the developer's theory being that the PKs of said lookups might possibly change and therefore to insulate against this, they ought to be UDFs that sought the text string and returned the PK. These were all called in a process that ran overnight. After first investigating the implications, I rewrote the procedure, replacing all the numerous UDF calls with hard-coded references. It took a while (the procedure was about 2000 lines of code), and I was careful (e.g. copy the line, paste it in, change it, and comment out the previous line). At the end of the day, the process, which formerly took six hours to run, came down to 45 minutes. Since I was the new kid on the block and since DBA tasks tend to be invisible to the users, I was especially pleased that my boss chose to make an official announcement of the success of the little project. This is one case where the use of UDFs was bad in terms of performance. There are many other cases where UDFs are a godsend, but for simple lookups, as in the example cited above, they are pointless. And one other thing before I finish this message: UDFs that return a table rather than a simple scalar variable are truly wonderful. A. On Wed, Jun 24, 2009 at 7:50 AM, jwcolby wrote: > Mark, > > I know that they exist, and I have used them very occasionally. I really > need to go become > acquainted with all of them, print out a list and study what is available. > I am doing rather a lot > of stored procedures now, but they mostly just build tables, add fields, > indexes, bcp in/out etc. > > I am still at the advanced beginner level in SQL Server. > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: > > Hello John, > > you thought me how to call vba functions in MS Access 97 queries, I was > > shocked by how powerful that feature was. > > > > Have you used functions in SQL Server? If so, please ignore my email and > > accept my apologies for even asking the question;) > > > > I have created a few functions in SQL Server and for low volumes of data, > > they work great, of course in your case, you are seeking max efficiency > and > > I have no idea about performance of a function versus inline code. I > guess > > no major difference. > > > > If you have not used them, give them a try. > > > > Thanks > > > > Mark > > > > > > > > > > > > 2009/6/23 jwcolby > > > >> This certainly looks like the answer. Now to turn the computer loose > for a > >> week, updating the > >> address field... > >> > >> There are about 6 or 8 of these address parts, each will now be inside > of > >> an IsNull(). ;) > >> > >> Is it possible to do this X records at a time? IOW I have a fifty > million > >> record table. I want to > >> cause the computer to go off and start doing this but I also want the > table > >> that is being updated to > >> be available for use while this is happening (for selection queries). > How > >> do I tell SQL Server to > >> do updates in blocks of 1000 records or something like that? Can I > >> dynamically change that "number > >> of records updated at a time" inside of a stored procedure? > >> > >> John W. Colby > >> www.ColbyConsulting.com > >> > >> > >> Francisco Tapia wrote: > >>> John, you can do it right out of a select, something like this > >>> > >>> IsNull(StreetNumber + ' ', '') + IsNull(Direction + ' ', '') + > >>> IsNull(StreetName + ' ', '') etc... > >>> > >>> I added the space padding right inside of the IsNull formula because > this > >>> way you get a padding, for each field, unless there is nothing then the > >>> result is no padding. In Sql Server Null + a value = Null :) > >>> > >>> If you don't want to accidentally end up with a space padding on the > >> right > >>> simply trim your statement with RTRIM(your isnull series) > >>> > >>> > >>> > >>> -Francisco > >>> http://sqlthis.blogspot.com | Tsql and More... > >>> > >>> > >>> On Tue, Jun 23, 2009 at 6:53 AM, jwcolby >>> wrote: > >>> > >>>> I am trying to append all of the pieces of an address into a single > >> address > >>>> string. As an example, > >>>> if I have the address: > >>>> > >>>> 121 S. Main Street NE Apt #201 > >>>> > >>>> this address will be stored with standardized spellings of all the > parts > >>>> into a set of fields: > >>>> > >>>> 121 > >>>> S > >>>> Main > >>>> St > >>>> NE > >>>> Apt > >>>> 201 > >>>> > >>>> I need to get this all back into a single field. Understand however > >> that > >>>> lots of those pieces might > >>>> be missing in any given address. For example the next field might be: > >>>> > >>>> 121 > >>>> > >>>> Main > >>>> St > >>>> > >>>> Ste > >>>> 1342 > >>>> > >>>> So... I need to get all the pieces back into a single address field. > If > >> a > >>>> piece exists then it > >>>> needs padding around it so I don't end up with: > >>>> > >>>> 121MainStSte1342 > >>>> > >>>> But if a piece does not exist then I do not want the padding for that > >>>> missing field. > >>>> > >>>> I am assuming that I will be using a stored procedure. Pass in the > >>>> database, table, > >>>> UnifiedAddressField, then all of the field parts. > >>>> > >>>> It seems clumsy to do it this way, not to mention record by record, > for > >> 50 > >>>> million records... well... > >>>> > >>>> There must be a better way. Has anyone on the list done this before? > >>>> > >>>> -- > >>>> John W. Colby > >>>> www.ColbyConsulting.com > >>>> _______________________________________________ > >>>> dba-SQLServer mailing list > >>>> dba-SQLServer at databaseadvisors.com > >>>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >>>> http://www.databaseadvisors.com > >>>> > >>>> > >>> _______________________________________________ > >>> dba-SQLServer mailing list > >>> dba-SQLServer at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >>> http://www.databaseadvisors.com > >>> > >>> > >> _______________________________________________ > >> dba-SQLServer mailing list > >> dba-SQLServer at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From sdunlap at brownshoe.com Wed Jun 24 08:00:23 2009 From: sdunlap at brownshoe.com (sdunlap at brownshoe.com) Date: Wed, 24 Jun 2009 08:00:23 -0500 Subject: [dba-SQLServer] Stuart Dunlap is out of the office. Message-ID: I will be out of the office starting 06/24/2009 and will not return until 06/29/2009. I will respond to your message when I return. From fhtapia at gmail.com Wed Jun 24 09:45:38 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 24 Jun 2009 07:45:38 -0700 Subject: [dba-SQLServer] Another good one from Francisco In-Reply-To: References: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> Message-ID: Blat is great for Sql Server 2000 simply because you can implement email for your server without also installing Outlook. I just don't like Outlook as an email client. It is buggy for me, and has always caused me pains. With Google's Desktop Search (or Vista's indexing search) I was finally able to get a hold of all my email vs the sloooooow email search from Outlook. I personally would NOT use the blat solution on a Sql Server 2005 system. Database Mail is sooo much easier and nicer to use. Blat is a great tool for any of your legacy 2000 systems. Here were I work at I have a mixture of Sql Server 2000 / 2005 and (recently 2008) servers. The 2000 servers at this point are not ready to be retired, the hardware is still under warranty and has plenty of redundancy. However, Email is required from these systems and I've been using Blat for a number of years on these systems :). -Francisco http://sqlthis.blogspot.com | Tsql and More... On Wed, Jun 24, 2009 at 1:15 AM, Mark Breen wrote: > Hello Susan and Francisco > I wish I know about blat a few years ago when I was struggling to get > outlook installed on a SQL Server. > > With 2005 though, is there some hidden benefit that I am missing in your > blat code, over the following code. > > I have met quite a few people of the the last ten years that do not like to > use SQL Sever mail, but I have used it with never one complaint for close > to > ten years now. For me it gives me very quick to implement email > facilities. > > Thanks for blat, > > Mark > > > EXEC msdb.dbo.sp_send_dbmail > @profile_name = 'Server4DBMail', > @recipients = 'mark.breen at gmail.com', > @query = 'Select * from MyTable', > @body = 'Hello World, here is the contents of the table', > @subject = 'More SQL Server email', > @attach_query_result_as_file = 0 > ; > > > 2009/6/23 Susan Harkins > > > > > > > Sending E-mail from SQL Server 200X > > > > Susan H. > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From davidmcafee at gmail.com Wed Jun 24 11:02:14 2009 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 24 Jun 2009 09:02:14 -0700 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: <29f585dd0906240535n54ac7240j4289ef440ca2aac4@mail.gmail.com> References: <4A40DE40.3010806@colbyconsulting.com> <4A40F44C.9040009@colbyconsulting.com> <4A42131D.7010507@colbyconsulting.com> <29f585dd0906240535n54ac7240j4289ef440ca2aac4@mail.gmail.com> Message-ID: <8786a4c00906240902s3545c947v307894c35cf93a55@mail.gmail.com> Yes they are! On Wed, Jun 24, 2009 at 5:35 AM, Arthur Fuller wrote: > . And one other thing > before I finish this message: UDFs that return a table rather than a simple > scalar variable are truly wonderful. > > A. > From accessd at shaw.ca Wed Jun 24 11:33:01 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 24 Jun 2009 09:33:01 -0700 Subject: [dba-SQLServer] Colour Picture In-Reply-To: References: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> Message-ID: Here is a link great colour poster on all the methods in SQL 2008: http://www.left-brain.com/product/tabid/63/p-97-sql-server-2008-system-views .aspx My computer room is covered with various similar posters as I find it easier to jog my memory with a quick glance than digging through the books again. Jim From jwcolby at colbyconsulting.com Wed Jun 24 12:11:44 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 24 Jun 2009 13:11:44 -0400 Subject: [dba-SQLServer] Colour Picture In-Reply-To: References: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> Message-ID: <4A425E50.80402@colbyconsulting.com> Cool, Thanks. John W. Colby www.ColbyConsulting.com Jim Lawrence wrote: > Here is a link great colour poster on all the methods in SQL 2008: > http://www.left-brain.com/product/tabid/63/p-97-sql-server-2008-system-views > .aspx > > My computer room is covered with various similar posters as I find it easier > to jog my memory with a quick glance than digging through the books again. > > Jim > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Jun 25 02:58:56 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 25 Jun 2009 08:58:56 +0100 Subject: [dba-SQLServer] Another good one from Francisco In-Reply-To: References: <9281785B9FBD4E5EA0F31F01D51D22CB@SusanOne> Message-ID: Hello Francisco, Phew, thanks, I thought I was missing something about SQL 2005. Again, thanks for the email. A few years ago, I had to wait a year to get outlook installed on a SQL 2000 machine, if I had had blat then... Mark 2009/6/24 Francisco Tapia > Blat is great for Sql Server 2000 simply because you can implement email > for > your server without also installing Outlook. I just don't like Outlook as > an email client. It is buggy for me, and has always caused me pains. With > Google's Desktop Search (or Vista's indexing search) I was finally able to > get a hold of all my email vs the sloooooow email search from Outlook. > I personally would NOT use the blat solution on a Sql Server 2005 system. > Database Mail is sooo much easier and nicer to use. Blat is a great tool > for any of your legacy 2000 systems. Here were I work at I have a mixture > of Sql Server 2000 / 2005 and (recently 2008) servers. The 2000 servers at > this point are not ready to be retired, the hardware is still under > warranty > and has plenty of redundancy. However, Email is required from these > systems > and I've been using Blat for a number of years on these systems :). > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Wed, Jun 24, 2009 at 1:15 AM, Mark Breen wrote: > > > Hello Susan and Francisco > > I wish I know about blat a few years ago when I was struggling to get > > outlook installed on a SQL Server. > > > > With 2005 though, is there some hidden benefit that I am missing in your > > blat code, over the following code. > > > > I have met quite a few people of the the last ten years that do not like > to > > use SQL Sever mail, but I have used it with never one complaint for close > > to > > ten years now. For me it gives me very quick to implement email > > facilities. > > > > Thanks for blat, > > > > Mark > > > > > > EXEC msdb.dbo.sp_send_dbmail > > @profile_name = 'Server4DBMail', > > @recipients = 'mark.breen at gmail.com', > > @query = 'Select * from MyTable', > > @body = 'Hello World, here is the contents of the table', > > @subject = 'More SQL Server email', > > @attach_query_result_as_file = 0 > > ; > > > > > > 2009/6/23 Susan Harkins > > > > > > > > > > > Sending E-mail from SQL Server 200X > > > > > > Susan H. > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Jun 25 02:56:24 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 25 Jun 2009 08:56:24 +0100 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: <4A42131D.7010507@colbyconsulting.com> References: <4A40DE40.3010806@colbyconsulting.com> <4A40F44C.9040009@colbyconsulting.com> <4A42131D.7010507@colbyconsulting.com> Message-ID: Hi John, Great, but in your comment below, you mention printing them out. I was referring more to writing your own UDF's. It is as easy as a sproc, but can be used inline. For the example you had originally posted in this thread, you could write a udf that would concatenate the fields you need, with nulls taken care of, then that udf is available throughout the db. Again, I guess you now this, but if it helps, I am glad. As Arthur mentions below, you can have a udf that returns a value, or you can also have one return a table. Does any one know why you use a UDF to return a table, rather than an sproc ? Mark 2009/6/24 jwcolby > Mark, > > I know that they exist, and I have used them very occasionally. I really > need to go become > acquainted with all of them, print out a list and study what is available. > I am doing rather a lot > of stored procedures now, but they mostly just build tables, add fields, > indexes, bcp in/out etc. > > I am still at the advanced beginner level in SQL Server. > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: > > Hello John, > > you thought me how to call vba functions in MS Access 97 queries, I was > > shocked by how powerful that feature was. > > > > Have you used functions in SQL Server? If so, please ignore my email and > > accept my apologies for even asking the question;) > > > > I have created a few functions in SQL Server and for low volumes of data, > > they work great, of course in your case, you are seeking max efficiency > and > > I have no idea about performance of a function versus inline code. I > guess > > no major difference. > > > > If you have not used them, give them a try. > > > > Thanks > > > > Mark > > > > > > > > > > > > 2009/6/23 jwcolby > > > >> This certainly looks like the answer. Now to turn the computer loose > for a > >> week, updating the > >> address field... > >> > >> There are about 6 or 8 of these address parts, each will now be inside > of > >> an IsNull(). ;) > >> > >> Is it possible to do this X records at a time? IOW I have a fifty > million > >> record table. I want to > >> cause the computer to go off and start doing this but I also want the > table > >> that is being updated to > >> be available for use while this is happening (for selection queries). > How > >> do I tell SQL Server to > >> do updates in blocks of 1000 records or something like that? Can I > >> dynamically change that "number > >> of records updated at a time" inside of a stored procedure? > >> > >> John W. Colby > >> www.ColbyConsulting.com > >> > >> > >> Francisco Tapia wrote: > >>> John, you can do it right out of a select, something like this > >>> > >>> IsNull(StreetNumber + ' ', '') + IsNull(Direction + ' ', '') + > >>> IsNull(StreetName + ' ', '') etc... > >>> > >>> I added the space padding right inside of the IsNull formula because > this > >>> way you get a padding, for each field, unless there is nothing then the > >>> result is no padding. In Sql Server Null + a value = Null :) > >>> > >>> If you don't want to accidentally end up with a space padding on the > >> right > >>> simply trim your statement with RTRIM(your isnull series) > >>> > >>> > >>> > >>> -Francisco > >>> http://sqlthis.blogspot.com | Tsql and More... > >>> > >>> > >>> On Tue, Jun 23, 2009 at 6:53 AM, jwcolby >>> wrote: > >>> > >>>> I am trying to append all of the pieces of an address into a single > >> address > >>>> string. As an example, > >>>> if I have the address: > >>>> > >>>> 121 S. Main Street NE Apt #201 > >>>> > >>>> this address will be stored with standardized spellings of all the > parts > >>>> into a set of fields: > >>>> > >>>> 121 > >>>> S > >>>> Main > >>>> St > >>>> NE > >>>> Apt > >>>> 201 > >>>> > >>>> I need to get this all back into a single field. Understand however > >> that > >>>> lots of those pieces might > >>>> be missing in any given address. For example the next field might be: > >>>> > >>>> 121 > >>>> > >>>> Main > >>>> St > >>>> > >>>> Ste > >>>> 1342 > >>>> > >>>> So... I need to get all the pieces back into a single address field. > If > >> a > >>>> piece exists then it > >>>> needs padding around it so I don't end up with: > >>>> > >>>> 121MainStSte1342 > >>>> > >>>> But if a piece does not exist then I do not want the padding for that > >>>> missing field. > >>>> > >>>> I am assuming that I will be using a stored procedure. Pass in the > >>>> database, table, > >>>> UnifiedAddressField, then all of the field parts. > >>>> > >>>> It seems clumsy to do it this way, not to mention record by record, > for > >> 50 > >>>> million records... well... > >>>> > >>>> There must be a better way. Has anyone on the list done this before? > >>>> > >>>> -- > >>>> John W. Colby > >>>> www.ColbyConsulting.com > >>>> _______________________________________________ > >>>> dba-SQLServer mailing list > >>>> dba-SQLServer at databaseadvisors.com > >>>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >>>> http://www.databaseadvisors.com > >>>> > >>>> > >>> _______________________________________________ > >>> dba-SQLServer mailing list > >>> dba-SQLServer at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >>> http://www.databaseadvisors.com > >>> > >>> > >> _______________________________________________ > >> dba-SQLServer mailing list > >> dba-SQLServer at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Thu Jun 25 12:13:45 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 25 Jun 2009 10:13:45 -0700 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: References: <4A40DE40.3010806@colbyconsulting.com> <4A40F44C.9040009@colbyconsulting.com> <4A42131D.7010507@colbyconsulting.com> Message-ID: You can't join on a sproc. typically your inline function (table return) would not exceed the amount of ram you have available for such tasks, and then you'd use this function with parameters to help result with a joinable table. (that's just one reason (otomh)). -- -Francisco http://sqlthis.blogspot.com | Tsql and More... On Thu, Jun 25, 2009 at 12:56 AM, Mark Breen wrote: > Hi John, > Great, but in your comment below, you mention printing them out. I > was referring more to writing your own UDF's. It is as easy as a sproc, > but > can be used inline. For the example you had originally posted in this > thread, you could write a udf that would concatenate the fields you need, > with nulls taken care of, then that udf is available throughout the db. > Again, I guess you now this, but if it helps, I am glad. > > As Arthur mentions below, you can have a udf that returns a value, or you > can also have one return a table. > > Does any one know why you use a UDF to return a table, rather than an sproc > ? > > Mark > > > > > > 2009/6/24 jwcolby > > > Mark, > > > > I know that they exist, and I have used them very occasionally. I really > > need to go become > > acquainted with all of them, print out a list and study what is > available. > > I am doing rather a lot > > of stored procedures now, but they mostly just build tables, add fields, > > indexes, bcp in/out etc. > > > > I am still at the advanced beginner level in SQL Server. > > > > John W. Colby > > www.ColbyConsulting.com > > > > > > Mark Breen wrote: > > > Hello John, > > > you thought me how to call vba functions in MS Access 97 queries, I was > > > shocked by how powerful that feature was. > > > > > > Have you used functions in SQL Server? If so, please ignore my email > and > > > accept my apologies for even asking the question;) > > > > > > I have created a few functions in SQL Server and for low volumes of > data, > > > they work great, of course in your case, you are seeking max efficiency > > and > > > I have no idea about performance of a function versus inline code. I > > guess > > > no major difference. > > > > > > If you have not used them, give them a try. > > > > > > Thanks > > > > > > Mark > > > > > > > > > > > > > > > > > > 2009/6/23 jwcolby > > > > > >> This certainly looks like the answer. Now to turn the computer loose > > for a > > >> week, updating the > > >> address field... > > >> > > >> There are about 6 or 8 of these address parts, each will now be inside > > of > > >> an IsNull(). ;) > > >> > > >> Is it possible to do this X records at a time? IOW I have a fifty > > million > > >> record table. I want to > > >> cause the computer to go off and start doing this but I also want the > > table > > >> that is being updated to > > >> be available for use while this is happening (for selection queries). > > How > > >> do I tell SQL Server to > > >> do updates in blocks of 1000 records or something like that? Can I > > >> dynamically change that "number > > >> of records updated at a time" inside of a stored procedure? > > >> > > >> John W. Colby > > >> www.ColbyConsulting.com > > >> > > >> > > >> Francisco Tapia wrote: > > >>> John, you can do it right out of a select, something like this > > >>> > > >>> IsNull(StreetNumber + ' ', '') + IsNull(Direction + ' ', '') + > > >>> IsNull(StreetName + ' ', '') etc... > > >>> > > >>> I added the space padding right inside of the IsNull formula because > > this > > >>> way you get a padding, for each field, unless there is nothing then > the > > >>> result is no padding. In Sql Server Null + a value = Null :) > > >>> > > >>> If you don't want to accidentally end up with a space padding on the > > >> right > > >>> simply trim your statement with RTRIM(your isnull series) > > >>> > > >>> > > >>> > > >>> -Francisco > > >>> http://sqlthis.blogspot.com | Tsql and More... > > >>> > > >>> > > >>> On Tue, Jun 23, 2009 at 6:53 AM, jwcolby < > jwcolby at colbyconsulting.com > > >>> wrote: > > >>> > > >>>> I am trying to append all of the pieces of an address into a single > > >> address > > >>>> string. As an example, > > >>>> if I have the address: > > >>>> > > >>>> 121 S. Main Street NE Apt #201 > > >>>> > > >>>> this address will be stored with standardized spellings of all the > > parts > > >>>> into a set of fields: > > >>>> > > >>>> 121 > > >>>> S > > >>>> Main > > >>>> St > > >>>> NE > > >>>> Apt > > >>>> 201 > > >>>> > > >>>> I need to get this all back into a single field. Understand however > > >> that > > >>>> lots of those pieces might > > >>>> be missing in any given address. For example the next field might > be: > > >>>> > > >>>> 121 > > >>>> > > >>>> Main > > >>>> St > > >>>> > > >>>> Ste > > >>>> 1342 > > >>>> > > >>>> So... I need to get all the pieces back into a single address field. > > If > > >> a > > >>>> piece exists then it > > >>>> needs padding around it so I don't end up with: > > >>>> > > >>>> 121MainStSte1342 > > >>>> > > >>>> But if a piece does not exist then I do not want the padding for > that > > >>>> missing field. > > >>>> > > >>>> I am assuming that I will be using a stored procedure. Pass in the > > >>>> database, table, > > >>>> UnifiedAddressField, then all of the field parts. > > >>>> > > >>>> It seems clumsy to do it this way, not to mention record by record, > > for > > >> 50 > > >>>> million records... well... > > >>>> > > >>>> There must be a better way. Has anyone on the list done this > before? > > >>>> > > >>>> -- > > >>>> John W. Colby > > >>>> www.ColbyConsulting.com > > >>>> _______________________________________________ > > >>>> dba-SQLServer mailing list > > >>>> dba-SQLServer at databaseadvisors.com > > >>>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > >>>> http://www.databaseadvisors.com > > >>>> > > >>>> > > >>> _______________________________________________ > > >>> dba-SQLServer mailing list > > >>> dba-SQLServer at databaseadvisors.com > > >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > >>> http://www.databaseadvisors.com > > >>> > > >>> > > >> _______________________________________________ > > >> dba-SQLServer mailing list > > >> dba-SQLServer at databaseadvisors.com > > >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > >> http://www.databaseadvisors.com > > >> > > >> > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From davidmcafee at gmail.com Thu Jun 25 12:28:47 2009 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 25 Jun 2009 10:28:47 -0700 Subject: [dba-SQLServer] Fwd: Append several fields into one In-Reply-To: <8786a4c00906251009r41ad1d3fue48f9f96c8bfdf16@mail.gmail.com> References: <4A40DE40.3010806@colbyconsulting.com> <4A40F44C.9040009@colbyconsulting.com> <4A42131D.7010507@colbyconsulting.com> <8786a4c00906251009r41ad1d3fue48f9f96c8bfdf16@mail.gmail.com> Message-ID: <8786a4c00906251028q2eed5f6fmb322f3d312841b01@mail.gmail.com> This is something that I modifed from a udf that Francisco orignally wrote: ALTER FUNCTION [dbo].[udfListToTable] (@HList VarChar(1000), @Delimiter CHAR(1)) RETURNS @ListTable TABLE (Mystr VARCHAR(20)) AS BEGIN --Purpose: To convert a Comma delimited text to a Temp Variable table To help avoid dynamic sql -- Instead you can join the temp table or use it in your where clause if a field is IN the subquery DECLARE @Mystrtext as VarChar(20) IF RIGHT(RTRIM(@HLIST),1) <>@Delimiter SET @HList = @HList + @Delimiter WHILE CHARINDEX(@Delimiter, @HList) > 0 BEGIN IF CHARINDEX(@Delimiter, @HList) > 0 BEGIN SELECT @Mystrtext =LEFT(@HList, CHARINDEX(@Delimiter, @HList)-1) END ELSE BEGIN SELECT @Mystrtext = RTRIM(LTRIM(@HList)) END --Insert into Variable Table INSERT INTO @ListTable(Mystr) SELECT RTRIM(LTRIM(@Mystrtext)) --Remove Item from list SELECT @HList = RIGHT(RTRIM(@HList), LEN(RTRIM(@HList)) - CHARINDEX(@Delimiter, @HList)) END RETURN END Call it as such (from within a sproc) SELECT * FROM dbo.udfListToTable('jim,joe,bob,tom',',') Returns: jim joe bob tom From jwcolby at colbyconsulting.com Thu Jun 25 12:54:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 25 Jun 2009 13:54:54 -0400 Subject: [dba-SQLServer] Append several fields into one In-Reply-To: References: <4A40DE40.3010806@colbyconsulting.com> <4A40F44C.9040009@colbyconsulting.com> <4A42131D.7010507@colbyconsulting.com> Message-ID: <4A43B9EE.6070006@colbyconsulting.com> Mark, I definitely haven't gotten to writing UDFs. Thanks for the suggestion. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hi John, > Great, but in your comment below, you mention printing them out. I > was referring more to writing your own UDF's. It is as easy as a sproc, but > can be used inline. For the example you had originally posted in this > thread, you could write a udf that would concatenate the fields you need, > with nulls taken care of, then that udf is available throughout the db. > Again, I guess you now this, but if it helps, I am glad. > > As Arthur mentions below, you can have a udf that returns a value, or you > can also have one return a table. > > Does any one know why you use a UDF to return a table, rather than an sproc > ? > > Mark From ssharkins at gmail.com Thu Jun 25 18:52:24 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Thu, 25 Jun 2009 19:52:24 -0400 Subject: [dba-SQLServer] Database Administrator Message-ID: Looking for a SQL Server administrator who lives in or wants to live in Sacramento. Send me a resume privately, if interested. Please feel free to pass this along to others. Susan H. From newsgrps at dalyn.co.nz Thu Jun 25 20:38:23 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 26 Jun 2009 13:38:23 +1200 Subject: [dba-SQLServer] Looping through table Fields Message-ID: <20090626013647.PPKT20420.mta02.xtra.co.nz@Dalyn.dalyn.co.nz> I have an SQL2000 database that we require to compare two records field by field and report back on the fields that have different values. Can someone please point me in the right direction of how to do this within a stored procedure? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Gustav at cactus.dk Fri Jun 26 12:05:03 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 26 Jun 2009 19:05:03 +0200 Subject: [dba-SQLServer] Clustered Index Debate - Was: RE: Primary keys and entry points Message-ID: >> copy from AccessD: --- Hi Shamil Yes, let's keep it here for a while - at least I cannot provide much more useful input as I don't have experience with SQL Server and large databases. As you mention, one could choose to let the ADO.NET EF do the work and let it design the database and leave to it the decisions for building indexes and keys. However, I'm not sure I'm prepared to go that far until the EF is a bit more mature. Thanks for all the links. I'll study them at a later occasion, time is too limited currently. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2009 17:10 >>> Hi Gustav, Yes, SQL Server table can have no more than one clustered index (see links below). And "if the table has a clustered index, or the index is on an indexed view, the row locator is the clustered index key for the row." The latter means (AFAIU feel free to correct me if you suppose I'm wrong) that if we introduce surrogate key additionally to clustered index created on natural (primary key) columns and if we also create an index on surrogate key column (to e.g. speed-up joins execution one may suppose) then clustered index will anyway be involved in sql selection operations to lookup actual data rows - and that will result in joins of large data tables using surrogate keys would run (considerably) slower than joins on tables without surrogate keys. And not even joins: if you have a surrogate Autonumber/Identity clustered primary key/index on a table (that's what we usually have most of the time currenlty?) plus a natural (compound) (unique) key/index then using where expression on the columns from the natural key/index will involve two indexes on sql execution time, and if result set is large then execution time will be bad... Well, the above doesn't yet sound clear for me therefore I'd propose to have this discussion kept here for some time to find all "pros" and contra" for this or that approach. As e.g. it's done here on "the GUIDs as primary key" subject: "Is it a bad idea to use GUIDs as primary keys in MS SQL?" http://stackoverflow.com/questions/537145/is-it-a-bad-idea-to-use-guids-as-primary-keys-in-ms-sql <<<<<<<<<<<<<<<<<<<< GUID Pros * Unique across every table, every database, every server * Allows easy merging of records from different databases * Allows easy distribution of databases across multiple servers * You can generate IDs anywhere, instead of having to roundtrip to the database * Most replication scenarios require GUID columns anyway GUID Cons * It is a whopping 4 times larger than the traditional 4-byte index value; this can have serious performance and storage implications if you're not careful * Cumbersome to debug (where userid='{BAE7DF4-DDF-3RG-5TY3E3RF456AS10}') * The generated GUIDs should be partially sequential for best performance... >>>>>>>>>>>>>>>>>>> I mean I expect this thread will finally come to similar "Pros" and "Cons" list - in fact that would be two lists: 1) Natural Primary Keys with Clustered Index and No Surrogate Keys - Pros Natural Primary Keys with Clustered Index and No Surrogate Keys - Contra 2) Surrogate Primary Keys with Clustered index - Pros Surrogate Primary Keys with Clustered index - Contra As usual the "truth should be somewhere in between" - what I wanted to achieve is to stop using surrogate keys almost "religiously" in all and every table as I do now - I think I can stop doing that now if I will use ADO.NET Entity Framework as my main data access/manipulation technology because ADO.NET Entity Framework will take care for me to "write/generate lengthy join expressions on-the-fly (under the hood)" as well as it (ADO.NET Entity Framework) will let me to not rewrite my join expressions in the case of the data model changes/reorganization. Thank you. -- Shamil P.S. Here are some links related to the subject of this thread: --- The ADO.NET Entity Framework Overview http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx --- Table and Index Organization http://msdn.microsoft.com/en-us/library/ms189051.aspx Tables and Index Data Structures Architecture http://msdn.microsoft.com/en-us/library/ms180978.aspx Logical and Physical Operators Reference http://msdn.microsoft.com/en-us/library/ms191158.aspx -- Clustered Index Structures http://msdn.microsoft.com/en-us/library/ms177443.aspx "If the table has a clustered index, or the index is on an indexed view, the row locator is the clustered index key for the row. " Nonclustered Index Structures http://msdn.microsoft.com/en-us/library/ms177484.aspx Heap Structures http://msdn.microsoft.com/en-us/library/ms188270.aspx SQL Statement Processing http://msdn.microsoft.com/en-us/library/ms190623.aspx --- Is it a bad idea to use GUIDs as primary keys in MS SQL? http://stackoverflow.com/questions/537145/is-it-a-bad-idea-to-use-guids-as-primary-keys-in-ms-sql --- Should a Composite Primary Key be clustered in SQL Server? http://stackoverflow.com/questions/389348/should-a-composite-primary-key-be-clustered-in-sql-server What happens when I drop a clustered primary key in SQL 2005 http://stackoverflow.com/questions/705504/what-happens-when-i-drop-a-clustered-primary-key-in-sql-2005 Where to place a primary key http://stackoverflow.com/questions/575450/where-to-place-a-primary-key What is the optimal indexing strategy for a relation table? http://stackoverflow.com/questions/851908/what-is-the-optimal-indexing-strategy-for-a-relation-table ---- -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 26, 2009 12:40 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Clustered Index Debate - Was: RE: Primary keys and entry points Hi Shamil and John Reading these chatty fellows is a bit difficult as they refer to quite a lot before and outside the article and many versions of SQL Server including 6.5, pack it in "if"s and different scenarios, and - as I'm not a DBA - expressions unknown by me, but to me it looks more like a discussion on indexes rather than keys with zero conclusion. However - if that is true - if only one clustered index can be applied to a table then, of course, it has to be designed with great care considering the expected purpose and usage of the table and, of course, that may very well include a natural (compound) key. But I can't see why that should indicate a farewell to the surrogate key. How the ADO.NET Entity Framework handles this is really out of our hands but I guess the old rule still applies: the groundwork sets the quality of the house. /gustav <<< snip >>> From dw-murphy at cox.net Sat Jun 27 18:42:03 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Sat, 27 Jun 2009 16:42:03 -0700 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 In-Reply-To: References: <01606FC26AD0E54B8348D886D0C074D33BF90FA259@schwarz.sierranevada.corp> Message-ID: <9C3615C63A2F4D23A85683035B2EC901@murphy3234aaf1> Folks, I am following up on this thread just to pass on my experience. I attempted to install SQL Server 2005 standard on my development machine that already has SQL Server 2005 Express on it. There is a conflict and the installer won't put anything on my machine, apparently because the Express components are newer than the Standard edition. After querying Stack Overflow and some SQL Server groups this seems to be a known situation and the consensus is to take Express off the machine. I could do this but then I'd have to go back and modify all my apps and sites connection strings. Beging a coward and lazy, why break something that runs, I set up an Windows 2008 Server virtual machine and installed SQL server on that. SQL Server 2005 on Windows server 2008 has it's own set of issues, compatibility mostly, but they are known and can be worked through. I have it up and running and can work on the remote server through management studio which was my objective. Another 4 hours setting something up that should be simple. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, June 19, 2009 1:19 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 Hi Dave, Thanks for the insight. The only projects I really have on this machine that use SQL server are some Visual Studio applications and several ASP.NET sites. They all are using my SQL Express server now. I can redo the connection strings but would preffer not to if Express and the full version are compatible on the same machine. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Lewis Sent: Friday, June 19, 2009 11:05 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 Doug: Coincidentally I just upgraded my management studio from 2000 to 2008 yesterday. I had sqlprompt (from Redgate) installed, and that caused the install to bonk. There is a patch they've issued to allow the install to proceed although I hacked around it by renaming a registry key temporarily. Details on that via google. But more importantly, I found after the upgrade that some ssis packages broke. Thankfully they were still in dev stage. I don't remember all the things that went wrong, but some of them were relative paths in script tasks no longer worked (had to change to absolute paths), and some db connections just plain broke. hth. d lewis Message: 3 Date: Fri, 19 Jun 2009 09:33:19 -0400 From: James Barash Subject: Re: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition To: Discussion concerning MS SQL Server Message-ID: <12D2F894654B53498DEF840AE12B7BB3115C0933 at fciexchange.fcidms.com> Content-Type: text/plain; charset="us-ascii" Doug: If you just need the Management Studio, you can install that by itself, without installing an instance of SQL Server 2005. I've done that with Management Studio 2008. As I recall, you start the installation and just select the Client Tools and make sure to deselect everything else. I also have the Developer and Express editions on my desktop and they run together without any problems. You just need to install the second version as a named instance. Although I usually shut down the one I'm not using to save memory. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, June 18, 2009 2:32 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition Folks, I am looking at installing SQL Server 2005 developer edition on my development system? The computer currently has Visual Studio 2008 and SQL Server 2005 express edition on it. As things stand now Visual Studio uses the Express edition for projects and web sites. I don't want to screw up my current projects. I would like to have access to the Full version of Management Studio to work on some remote servers. What is the consensus of the SQL Server gurus on the best way to do this? Thanks in advance. Doug The contents of this e-mail message and its attachments are covered by the Electronic Communications Privacy Act (18 U.S.C. 2510-2521) and are intended solely for the addressee(s) hereof. If you are not the named recipient, or the employee or agent responsible for delivering the message to the intended recipient, or if this message has been addressed to you in error, you are directed not to read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. If you have received this communication in error, please notify us immediately by return e-mail or by telephone, 530-893-3520, and delete and/or destroy all copies of the message immediately. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jlawrenc1 at shaw.ca Sat Jun 27 20:14:41 2009 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Sat, 27 Jun 2009 18:14:41 -0700 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 In-Reply-To: <9C3615C63A2F4D23A85683035B2EC901@murphy3234aaf1> References: <01606FC26AD0E54B8348D886D0C074D33BF90FA259@schwarz.sierranevada.corp> <9C3615C63A2F4D23A85683035B2EC901@murphy3234aaf1> Message-ID: <3DFA59B5764D4B5B824CABA248E935E9@creativesystemdesigns.com> Thanks for the heads up Doug. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, June 27, 2009 4:42 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 Folks, I am following up on this thread just to pass on my experience. I attempted to install SQL Server 2005 standard on my development machine that already has SQL Server 2005 Express on it. There is a conflict and the installer won't put anything on my machine, apparently because the Express components are newer than the Standard edition. After querying Stack Overflow and some SQL Server groups this seems to be a known situation and the consensus is to take Express off the machine. I could do this but then I'd have to go back and modify all my apps and sites connection strings. Beging a coward and lazy, why break something that runs, I set up an Windows 2008 Server virtual machine and installed SQL server on that. SQL Server 2005 on Windows server 2008 has it's own set of issues, compatibility mostly, but they are known and can be worked through. I have it up and running and can work on the remote server through management studio which was my objective. Another 4 hours setting something up that should be simple. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, June 19, 2009 1:19 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 Hi Dave, Thanks for the insight. The only projects I really have on this machine that use SQL server are some Visual Studio applications and several ASP.NET sites. They all are using my SQL Express server now. I can redo the connection strings but would preffer not to if Express and the full version are compatible on the same machine. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Lewis Sent: Friday, June 19, 2009 11:05 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 76, Issue 14 Doug: Coincidentally I just upgraded my management studio from 2000 to 2008 yesterday. I had sqlprompt (from Redgate) installed, and that caused the install to bonk. There is a patch they've issued to allow the install to proceed although I hacked around it by renaming a registry key temporarily. Details on that via google. But more importantly, I found after the upgrade that some ssis packages broke. Thankfully they were still in dev stage. I don't remember all the things that went wrong, but some of them were relative paths in script tasks no longer worked (had to change to absolute paths), and some db connections just plain broke. hth. d lewis Message: 3 Date: Fri, 19 Jun 2009 09:33:19 -0400 From: James Barash Subject: Re: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition To: Discussion concerning MS SQL Server Message-ID: <12D2F894654B53498DEF840AE12B7BB3115C0933 at fciexchange.fcidms.com> Content-Type: text/plain; charset="us-ascii" Doug: If you just need the Management Studio, you can install that by itself, without installing an instance of SQL Server 2005. I've done that with Management Studio 2008. As I recall, you start the installation and just select the Client Tools and make sure to deselect everything else. I also have the Developer and Express editions on my desktop and they run together without any problems. You just need to install the second version as a named instance. Although I usually shut down the one I'm not using to save memory. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, June 18, 2009 2:32 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Installing SQL Server 2005 developer on a machine with SQL Server 2005 express edition Folks, I am looking at installing SQL Server 2005 developer edition on my development system? The computer currently has Visual Studio 2008 and SQL Server 2005 express edition on it. As things stand now Visual Studio uses the Express edition for projects and web sites. I don't want to screw up my current projects. I would like to have access to the Full version of Management Studio to work on some remote servers. What is the consensus of the SQL Server gurus on the best way to do this? Thanks in advance. Doug The contents of this e-mail message and its attachments are covered by the Electronic Communications Privacy Act (18 U.S.C. 2510-2521) and are intended solely for the addressee(s) hereof. If you are not the named recipient, or the employee or agent responsible for delivering the message to the intended recipient, or if this message has been addressed to you in error, you are directed not to read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. If you have received this communication in error, please notify us immediately by return e-mail or by telephone, 530-893-3520, and delete and/or destroy all copies of the message immediately. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jun 29 08:58:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 29 Jun 2009 09:58:54 -0400 Subject: [dba-SQLServer] SQL Server - how much memory to assign Message-ID: <4A48C89E.6060403@colbyconsulting.com> I now have two servers, one dedicated to SQL Server and the other to VMs. The SQL Server has 16 gigs and I am wondering how much to assign to SQL Server in its memory configuration and how much to leave for the OS. It will be running a couple of apps such as Access and Ultra Edit, Excel occasionally, but nothing too memory intensive. I am figuring something like 14 gigs for SQL Server and 2 gigs for the OS apps. -- John W. Colby www.ColbyConsulting.com From nancy.lytle at gmail.com Mon Jun 29 13:30:57 2009 From: nancy.lytle at gmail.com (Nancy Lytle) Date: Mon, 29 Jun 2009 13:30:57 -0500 Subject: [dba-SQLServer] SQL Server - how much memory to assign In-Reply-To: <4A48C89E.6060403@colbyconsulting.com> References: <4A48C89E.6060403@colbyconsulting.com> Message-ID: I might go a little lower on SQL Server, monitor it and then raise it if all is okay. Maybe 12 for SQL, 4 for everything else then monitor for a while and see how it goes. Spotlight on Windows (freeware) is a nice little monitoring tool, that will show you what is using how much, etc. Nancy Lytle EMAILING FOR THE GREATER GOOD Join me > Date: Mon, 29 Jun 2009 09:58:54 -0400 > From: jwcolby at colbyconsulting.com > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer] SQL Server - how much memory to assign > > I now have two servers, one dedicated to SQL Server and the other to VMs. The SQL Server has 16 > gigs and I am wondering how much to assign to SQL Server in its memory configuration and how much to > leave for the OS. It will be running a couple of apps such as Access and Ultra Edit, Excel > occasionally, but nothing too memory intensive. I am figuring something like 14 gigs for SQL Server > and 2 gigs for the OS apps. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From joe.rojas at symmetrynb.com Mon Jun 29 14:41:28 2009 From: joe.rojas at symmetrynb.com (Rojas, Joe) Date: Mon, 29 Jun 2009 15:41:28 -0400 Subject: [dba-SQLServer] SS7: Cannot open or drop a table In-Reply-To: <20090626013647.PPKT20420.mta02.xtra.co.nz@Dalyn.dalyn.co.nz> References: <20090626013647.PPKT20420.mta02.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <5BAE0A5B5D7E414D96584521B26E6C090106073B@DPYUSNBEXS1.snb.local> Hi All, We had a big domain migration this past weekend and I had to migrate a SQL Server 7 box that is running Windows 2000 server. Part of the migration was that I had to rename the server also. I found a great and simple article online that described how to survive a computer rename when running SQL Server 7 and everything seemed to have worked. This morning I found one application not playing nicely and it turns out to be a bad table in one of the databases. I cannot open the table and I cannot drop the table. All other tables in this database work properly. Any ideas on how to get around this? Is there a way to drop the table? Joe