From jwcolby at colbyconsulting.com Thu May 1 07:37:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 08:37:44 -0400 Subject: [dba-SQLServer] System not responding for seconds at a time Message-ID: <4819B998.40507@colbyconsulting.com> I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu May 1 08:30:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 09:30:44 -0400 Subject: [dba-SQLServer] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> References: <4819B998.40507@colbyconsulting.com> Message-ID: <4819C604.4000901@colbyconsulting.com> Well... it appears that I have fixed the issue. After Googling "slow server response time" or something similar I ran across references to a "Maximum Memory" property for SQL Server. I finally found that and it was set to something insane like 200000000 MEGABYTES (several petabytes of server memory). While I can dream of such a machine, it ain't happening here! I adjusted the Maximum Memory down to 2 gigs and the "amount available" in Task Manager Performance tab popped up to 4 gigs. Having done that, and after perhaps 30 seconds, suddenly my machine is responding in a normal way. I am now adjusting that number to "leave" perhaps 2 gigs available to applications other than SQL Server. I probably don't even need 2 gigs but it is critical that I don't end up unable to do anything on that machine. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I don't quite know where to address this so I am cross posting it. I am > working on a fairly powerful server running Windows 2003 x64 and SQL > Server 2003 x64. It has 8 gigs of memory. No malware software, > software firewall, virus scanner etc. Nothing. > > I am running a file shrink on the SQL Server file, trying to remove > about 140 gigs of empty space. That process has been running since last > night, well over 8 hours now. It APPEARS that process is using all of > available memory since task manager shows only about 200 megs > "available". However if you look at the process tab, no process says it > is using more than 100 megs of ram. The performance tab shows almost no > CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then > only one of the cores appears to be doing anything. > > The computer is "stuttering" badly. Try to do anything - change to a > different program, page up in visual studios code etc, and the computer > will usually hesitate before doing whatever you requested. I am trying > to work on a VB project and can't get anything done because as I move > around in the doc it may take 2 to 5 seconds just to respond to my > request to move my cursor. > > Has anyone seen SQL Server lock up the the system like this, IOW is it > SQL Server? Does anyone know how long the file shrink could take - > days, weeks, months? Does anyone know how to cancel the file shrink? > This is the most powerful server I have, quad core, running x64 > software, 8 gigs, high speed raid arrays etc. > > Unfortunately I was in the middle of a vb.net project yesterday before I > started the shrink running after work and the server is unusable for > anything right now. > From accessd at shaw.ca Thu May 1 10:00:21 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 01 May 2008 08:00:21 -0700 Subject: [dba-SQLServer] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> References: <4819B998.40507@colbyconsulting.com> Message-ID: <39A021213EFB41AC8B52840AA4FB2599@creativesystemdesigns.com> Hi John: Try viewing Perfmon: Start > Programs > Administrative Tools > Performance This little app is always running on a system so it takes up no addition resourses. Check out how to run it (http://www.computerperformance.co.uk/HealthCheck/GettingStarted.htm) and you should be able to find where all the system resource are going or have been lost. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 5:38 AM To: Discussion of Hardware and Software issues; VBA; Dba-Sqlserver Subject: [dba-SQLServer] System not responding for seconds at a time I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- 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 jlawrenc1 at shaw.ca Thu May 1 10:02:08 2008 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Thu, 01 May 2008 08:02:08 -0700 Subject: [dba-SQLServer] System not responding for seconds at a time In-Reply-To: <4819C604.4000901@colbyconsulting.com> References: <4819B998.40507@colbyconsulting.com> <4819C604.4000901@colbyconsulting.com> Message-ID: That is very good to know... John -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 6:31 AM To: Discussion concerning MS SQL Server; VBA; Discussion of Hardware and Software issues Subject: Re: [dba-SQLServer] System not responding for seconds at a time Well... it appears that I have fixed the issue. After Googling "slow server response time" or something similar I ran across references to a "Maximum Memory" property for SQL Server. I finally found that and it was set to something insane like 200000000 MEGABYTES (several petabytes of server memory). While I can dream of such a machine, it ain't happening here! I adjusted the Maximum Memory down to 2 gigs and the "amount available" in Task Manager Performance tab popped up to 4 gigs. Having done that, and after perhaps 30 seconds, suddenly my machine is responding in a normal way. I am now adjusting that number to "leave" perhaps 2 gigs available to applications other than SQL Server. I probably don't even need 2 gigs but it is critical that I don't end up unable to do anything on that machine. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I don't quite know where to address this so I am cross posting it. I am > working on a fairly powerful server running Windows 2003 x64 and SQL > Server 2003 x64. It has 8 gigs of memory. No malware software, > software firewall, virus scanner etc. Nothing. > > I am running a file shrink on the SQL Server file, trying to remove > about 140 gigs of empty space. That process has been running since last > night, well over 8 hours now. It APPEARS that process is using all of > available memory since task manager shows only about 200 megs > "available". However if you look at the process tab, no process says it > is using more than 100 megs of ram. The performance tab shows almost no > CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then > only one of the cores appears to be doing anything. > > The computer is "stuttering" badly. Try to do anything - change to a > different program, page up in visual studios code etc, and the computer > will usually hesitate before doing whatever you requested. I am trying > to work on a VB project and can't get anything done because as I move > around in the doc it may take 2 to 5 seconds just to respond to my > request to move my cursor. > > Has anyone seen SQL Server lock up the the system like this, IOW is it > SQL Server? Does anyone know how long the file shrink could take - > days, weeks, months? Does anyone know how to cancel the file shrink? > This is the most powerful server I have, quad core, running x64 > software, 8 gigs, high speed raid arrays etc. > > Unfortunately I was in the middle of a vb.net project yesterday before I > started the shrink running after work and the server is unusable for > anything right now. > _______________________________________________ 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 May 1 10:59:30 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 11:59:30 -0400 Subject: [dba-SQLServer] System not responding for seconds at a time In-Reply-To: References: <4819B998.40507@colbyconsulting.com> <4819C604.4000901@colbyconsulting.com> Message-ID: <4819E8E2.5030900@colbyconsulting.com> This did not completely fix the issue but it did make a HUGE difference. I was getting REALLY strange behavior like pauses every time Visual studio would step INTO a function. It appeared to have something to do with initializing objects as well, any time I would initialize an object it would pause for several seconds. I observed this stepping through a program. Needless to say when I just fired up my project and tried to run to a break point buried way down in the code it would not respond for 20-30 seconds... Truly strange. In the end I had to shut down SQL Server and reboot the system. Then the system responded normally. However I have discovered that .Net on x64 systems do not have editing in a running project (forget what that is called). It works in x32 but not x64, which is where I am trying to do my dev at this moment. John W. Colby www.ColbyConsulting.com Jim Lawrence wrote: > That is very good to know... John > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 6:31 AM > To: Discussion concerning MS SQL Server; VBA; Discussion of Hardware and > Software issues > Subject: Re: [dba-SQLServer] System not responding for seconds at a time > > Well... it appears that I have fixed the issue. After Googling "slow > server response time" or something similar I ran across references to a > "Maximum Memory" property for SQL Server. I finally found that and it > was set to something insane like 200000000 MEGABYTES (several petabytes > of server memory). While I can dream of such a machine, it ain't > happening here! > > I adjusted the Maximum Memory down to 2 gigs and the "amount available" > in Task Manager Performance tab popped up to 4 gigs. Having done that, > and after perhaps 30 seconds, suddenly my machine is responding in a > normal way. I am now adjusting that number to "leave" perhaps 2 gigs > available to applications other than SQL Server. I probably don't even > need 2 gigs but it is critical that I don't end up unable to do anything > on that machine. > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: >> I don't quite know where to address this so I am cross posting it. I am >> working on a fairly powerful server running Windows 2003 x64 and SQL >> Server 2003 x64. It has 8 gigs of memory. No malware software, >> software firewall, virus scanner etc. Nothing. >> >> I am running a file shrink on the SQL Server file, trying to remove >> about 140 gigs of empty space. That process has been running since last >> night, well over 8 hours now. It APPEARS that process is using all of >> available memory since task manager shows only about 200 megs >> "available". However if you look at the process tab, no process says it >> is using more than 100 megs of ram. The performance tab shows almost no >> CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then >> only one of the cores appears to be doing anything. >> >> The computer is "stuttering" badly. Try to do anything - change to a >> different program, page up in visual studios code etc, and the computer >> will usually hesitate before doing whatever you requested. I am trying >> to work on a VB project and can't get anything done because as I move >> around in the doc it may take 2 to 5 seconds just to respond to my >> request to move my cursor. >> >> Has anyone seen SQL Server lock up the the system like this, IOW is it >> SQL Server? Does anyone know how long the file shrink could take - >> days, weeks, months? Does anyone know how to cancel the file shrink? >> This is the most powerful server I have, quad core, running x64 >> software, 8 gigs, high speed raid arrays etc. >> >> Unfortunately I was in the middle of a vb.net project yesterday before I >> started the shrink running after work and the server is unusable for >> anything right now. >> > _______________________________________________ > 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 Thu May 1 11:10:53 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 1 May 2008 12:10:53 -0400 Subject: [dba-SQLServer] Combining Data from OLAP and OLTP Message-ID: <29f585dd0805010910m6530aaa6j109644a8f7f7c558@mail.gmail.com> This is becoming an important issue for me. Assume an OLAP db that gathers its data with a frequency of let's say once a day, and an OLTP db that gathers its data very frequently, let's say 100 transactions an hour. I need to combine them into a result set. While we're all asleep, the OLAP part can roll up its aggregates etc., that's not complex. But I'm wondering about the joins with the current data plus the history. I am not sure how this is done. Never done it before, want to get it right. The OLAP part is simple: dimension this and that and the other thing and you're done. But the current data happens way too quickly to think about rolling it into the OLAP part and then interrogating the cube. So how does one combine the cube with the OLTP data? I've been reading this and that and so far have no clear-cut answer on this. Anybody been there and done that? TIA, Arthur From Gustav at cactus.dk Thu May 1 11:50:44 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 01 May 2008 18:50:44 +0200 Subject: [dba-SQLServer] Combining Data from OLAP and OLTP Message-ID: Hi Arthur If you have timestamps on your records, select current data between last timestamp of the aggregated data and chosen timestamp (now) and union these with the aggregated data. /gustav >>> fuller.artful at gmail.com 01-05-2008 18:10 >>> This is becoming an important issue for me. Assume an OLAP db that gathers its data with a frequency of let's say once a day, and an OLTP db that gathers its data very frequently, let's say 100 transactions an hour. I need to combine them into a result set. While we're all asleep, the OLAP part can roll up its aggregates etc., that's not complex. But I'm wondering about the joins with the current data plus the history. I am not sure how this is done. Never done it before, want to get it right. The OLAP part is simple: dimension this and that and the other thing and you're done. But the current data happens way too quickly to think about rolling it into the OLAP part and then interrogating the cube. So how does one combine the cube with the OLTP data? I've been reading this and that and so far have no clear-cut answer on this. Anybody been there and done that? TIA, Arthur From fuller.artful at gmail.com Thu May 1 12:04:03 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 1 May 2008 13:04:03 -0400 Subject: [dba-SQLServer] Combining Data from OLAP and OLTP In-Reply-To: References: Message-ID: <29f585dd0805011004m6b00d2c6vf93ebd1e2a2eb130@mail.gmail.com> Sounds cool. I assume that I have to create a connection to both dbs and then do what you say. I imagined that it would work something like that. Thanks, Arthur From accessd at shaw.ca Thu May 1 13:44:04 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 01 May 2008 11:44:04 -0700 Subject: [dba-SQLServer] System not responding for seconds at a time In-Reply-To: <4819E8E2.5030900@colbyconsulting.com> References: <4819B998.40507@colbyconsulting.com> <4819C604.4000901@colbyconsulting.com> <4819E8E2.5030900@colbyconsulting.com> Message-ID: Hi John: Dot Net applications, running off IIS are always slow when they first initialize. After that, the modules are already compiled and stored in memory and any subsequent hits are much quicker. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 9:00 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] System not responding for seconds at a time This did not completely fix the issue but it did make a HUGE difference. I was getting REALLY strange behavior like pauses every time Visual studio would step INTO a function. It appeared to have something to do with initializing objects as well, any time I would initialize an object it would pause for several seconds. I observed this stepping through a program. Needless to say when I just fired up my project and tried to run to a break point buried way down in the code it would not respond for 20-30 seconds... Truly strange. In the end I had to shut down SQL Server and reboot the system. Then the system responded normally. However I have discovered that .Net on x64 systems do not have editing in a running project (forget what that is called). It works in x32 but not x64, which is where I am trying to do my dev at this moment. John W. Colby www.ColbyConsulting.com Jim Lawrence wrote: > That is very good to know... John > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 6:31 AM > To: Discussion concerning MS SQL Server; VBA; Discussion of Hardware and > Software issues > Subject: Re: [dba-SQLServer] System not responding for seconds at a time > > Well... it appears that I have fixed the issue. After Googling "slow > server response time" or something similar I ran across references to a > "Maximum Memory" property for SQL Server. I finally found that and it > was set to something insane like 200000000 MEGABYTES (several petabytes > of server memory). While I can dream of such a machine, it ain't > happening here! > > I adjusted the Maximum Memory down to 2 gigs and the "amount available" > in Task Manager Performance tab popped up to 4 gigs. Having done that, > and after perhaps 30 seconds, suddenly my machine is responding in a > normal way. I am now adjusting that number to "leave" perhaps 2 gigs > available to applications other than SQL Server. I probably don't even > need 2 gigs but it is critical that I don't end up unable to do anything > on that machine. > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: >> I don't quite know where to address this so I am cross posting it. I am >> working on a fairly powerful server running Windows 2003 x64 and SQL >> Server 2003 x64. It has 8 gigs of memory. No malware software, >> software firewall, virus scanner etc. Nothing. >> >> I am running a file shrink on the SQL Server file, trying to remove >> about 140 gigs of empty space. That process has been running since last >> night, well over 8 hours now. It APPEARS that process is using all of >> available memory since task manager shows only about 200 megs >> "available". However if you look at the process tab, no process says it >> is using more than 100 megs of ram. The performance tab shows almost no >> CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then >> only one of the cores appears to be doing anything. >> >> The computer is "stuttering" badly. Try to do anything - change to a >> different program, page up in visual studios code etc, and the computer >> will usually hesitate before doing whatever you requested. I am trying >> to work on a VB project and can't get anything done because as I move >> around in the doc it may take 2 to 5 seconds just to respond to my >> request to move my cursor. >> >> Has anyone seen SQL Server lock up the the system like this, IOW is it >> SQL Server? Does anyone know how long the file shrink could take - >> days, weeks, months? Does anyone know how to cancel the file shrink? >> This is the most powerful server I have, quad core, running x64 >> software, 8 gigs, high speed raid arrays etc. >> >> Unfortunately I was in the middle of a vb.net project yesterday before I >> started the shrink running after work and the server is unusable for >> anything right now. >> > _______________________________________________ > 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 ebarro at verizon.net Thu May 1 21:50:40 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 01 May 2008 19:50:40 -0700 Subject: [dba-SQLServer] System not responding for seconds at a time In-Reply-To: Message-ID: <0K0700IP0ZWKOE68@vms042.mailsrvcs.net> I believe the modules are already compiled in the DLL so they don't need to be recompiled when they are run. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Thursday, May 01, 2008 11:44 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] System not responding for seconds at a time Hi John: Dot Net applications, running off IIS are always slow when they first initialize. After that, the modules are already compiled and stored in memory and any subsequent hits are much quicker. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 9:00 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] System not responding for seconds at a time This did not completely fix the issue but it did make a HUGE difference. I was getting REALLY strange behavior like pauses every time Visual studio would step INTO a function. It appeared to have something to do with initializing objects as well, any time I would initialize an object it would pause for several seconds. I observed this stepping through a program. Needless to say when I just fired up my project and tried to run to a break point buried way down in the code it would not respond for 20-30 seconds... Truly strange. In the end I had to shut down SQL Server and reboot the system. Then the system responded normally. However I have discovered that .Net on x64 systems do not have editing in a running project (forget what that is called). It works in x32 but not x64, which is where I am trying to do my dev at this moment. John W. Colby www.ColbyConsulting.com Jim Lawrence wrote: > That is very good to know... John > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > jwcolby > Sent: Thursday, May 01, 2008 6:31 AM > To: Discussion concerning MS SQL Server; VBA; Discussion of Hardware > and Software issues > Subject: Re: [dba-SQLServer] System not responding for seconds at a > time > > Well... it appears that I have fixed the issue. After Googling "slow > server response time" or something similar I ran across references to > a "Maximum Memory" property for SQL Server. I finally found that and > it was set to something insane like 200000000 MEGABYTES (several > petabytes of server memory). While I can dream of such a machine, it > ain't happening here! > > I adjusted the Maximum Memory down to 2 gigs and the "amount available" > in Task Manager Performance tab popped up to 4 gigs. Having done > that, and after perhaps 30 seconds, suddenly my machine is responding > in a normal way. I am now adjusting that number to "leave" perhaps 2 > gigs available to applications other than SQL Server. I probably > don't even need 2 gigs but it is critical that I don't end up unable > to do anything on that machine. > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: >> I don't quite know where to address this so I am cross posting it. I >> am working on a fairly powerful server running Windows 2003 x64 and >> SQL Server 2003 x64. It has 8 gigs of memory. No malware software, >> software firewall, virus scanner etc. Nothing. >> >> I am running a file shrink on the SQL Server file, trying to remove >> about 140 gigs of empty space. That process has been running since >> last night, well over 8 hours now. It APPEARS that process is using >> all of available memory since task manager shows only about 200 megs >> "available". However if you look at the process tab, no process says >> it is using more than 100 megs of ram. The performance tab shows >> almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, >> and even then only one of the cores appears to be doing anything. >> >> The computer is "stuttering" badly. Try to do anything - change to a >> different program, page up in visual studios code etc, and the >> computer will usually hesitate before doing whatever you requested. >> I am trying to work on a VB project and can't get anything done >> because as I move around in the doc it may take 2 to 5 seconds just >> to respond to my request to move my cursor. >> >> Has anyone seen SQL Server lock up the the system like this, IOW is >> it SQL Server? Does anyone know how long the file shrink could take >> - days, weeks, months? Does anyone know how to cancel the file shrink? >> This is the most powerful server I have, quad core, running x64 >> software, 8 gigs, high speed raid arrays etc. >> >> Unfortunately I was in the middle of a vb.net project yesterday >> before I started the shrink running after work and the server is >> unusable for anything right now. >> > _______________________________________________ > 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 David at sierranevada.com Fri May 2 12:46:56 2008 From: David at sierranevada.com (David Lewis) Date: Fri, 2 May 2008 10:46:56 -0700 Subject: [dba-SQLServer] export query results to csv with dynamic header and footer rows In-Reply-To: References: Message-ID: Hi everyone: I have to create a csv for a weekly ftp upload. I have gotten to where I can use xp command shell and bcp to create the file using a view (no problems there). However I need to add three header rows and four footer rows with the following info: Headers Filename (will not change) File type (will not change) Create date (obviously changes) Footers Filename (will not change) File type (will not change) Create date (obviously changes) Total Rows (ditto) I can find nothing on the web that indicates how I might do this within sql server. I could open the file manually and add them, or perhaps write a vb app that does that, but for obvious reasons I would rather not. Anyone have any experience with this? Many thanks. D. Lewis 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 jwcolby at colbyconsulting.com Sun May 4 07:01:35 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 04 May 2008 08:01:35 -0400 Subject: [dba-SQLServer] SQL Server timeouts Message-ID: <481DA59F.5060503@colbyconsulting.com> I am running this process that updates SQL Server from VB.Net. The process runs normally for tens of millions of records, then SQL Server "hangs" and stops servicing requests (from this process), either reads or writes. It just times out with error messages "Timeout Expired: The timeout period expired prior to completion of the operation or SQL Server is not responding". This is not a once off occurrence, it happens every time I start the process running. Sometimes I get this and then eventually SQL Server will start responding, sometimes it just stops responding. How do I troubleshoot this? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 08:06:01 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 09:06:01 -0400 Subject: [dba-SQLServer] SQL Server WHERE Clause order Message-ID: <481F0639.2090300@colbyconsulting.com> Does it make any difference in SQL Server the order of the WHERE clause items. For example: WHERE (LastName IS NOT NULL) AND (AGE > 30) vs WHERE (AGE > 30) AND (LastName IS NOT NULL) -- John W. Colby www.ColbyConsulting.com From fuller.artful at gmail.com Mon May 5 08:32:28 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 5 May 2008 09:32:28 -0400 Subject: [dba-SQLServer] SQL Server WHERE Clause order In-Reply-To: <481F0639.2090300@colbyconsulting.com> References: <481F0639.2090300@colbyconsulting.com> Message-ID: <29f585dd0805050632j29193c2ag989362e08c897765@mail.gmail.com> Generally the optimizer will figure it out depending on available indexes. For a more complex query you might have to specifically order the WHERE clause according to the indexes, but you can always check what's happening using the optimizer. A. On Mon, May 5, 2008 at 9:06 AM, jwcolby wrote: > Does it make any difference in SQL Server the order of the WHERE clause > items. For example: > > WHERE (LastName IS NOT NULL) AND (AGE > 30) > > vs > > WHERE (AGE > 30) AND (LastName IS NOT NULL) > > > > -- > 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 May 5 08:44:54 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 09:44:54 -0400 Subject: [dba-SQLServer] SQL Server WHERE Clause order In-Reply-To: <29f585dd0805050632j29193c2ag989362e08c897765@mail.gmail.com> References: <481F0639.2090300@colbyconsulting.com> <29f585dd0805050632j29193c2ag989362e08c897765@mail.gmail.com> Message-ID: <481F0F56.1050804@colbyconsulting.com> Thanks Arthur. John W. Colby www.ColbyConsulting.com Arthur Fuller wrote: > Generally the optimizer will figure it out depending on available indexes. > For a more complex query you might have to specifically order the WHERE > clause according to the indexes, but you can always check what's happening > using the optimizer. > > A. > > On Mon, May 5, 2008 at 9:06 AM, jwcolby wrote: > >> Does it make any difference in SQL Server the order of the WHERE clause >> items. For example: >> >> WHERE (LastName IS NOT NULL) AND (AGE > 30) >> >> vs >> >> WHERE (AGE > 30) AND (LastName IS NOT NULL) >> >> >> >> -- >> 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 fuller.artful at gmail.com Mon May 5 10:34:27 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 5 May 2008 11:34:27 -0400 Subject: [dba-SQLServer] Hedging Your Bets Message-ID: <29f585dd0805050834u344ced89q297f8bfb03ec6e58@mail.gmail.com> Sorry for the double-post, but I'm in a need-to-know position. Has anyone done an app related to hedge-funds? I vaguely understand the concept but I want to know if anyone has a model to work from. Should puts and gets be in the same table or separate tables? How should progress be tracked (i.e. IBM moved from $1 to $1.14 in the last three months)? This is a whole new world to me and any advice will be appreciated. I don't even understand the rudiments. Given that I am a hedge participant, how often would I be likely to place a bet? Once an hour, once a day, once a week, once a quarter? Suppose that I am totally convinced that Sun+MySQL is a huge score, and that the current price is $1. I want to buy a million shares, but I also want to hedge my infatuation with a bet going the other way that says maybe I was over-enthused by her breasts or some other quality and I could be wrong, so then I bet that I sell those million shares at some price and the difference between them is what I'm risking, less the broker's fee. Do I have this correct or am I missing key components? I confess to complete ignorance about this stuff. I vaguely comprehend that a put and a get balance each other out with a margin, and that that's what the hedge-bet is all about. But I don't comprehend several other critical factors, such as: Suppose I bet that IBM will be worth $2 on June 1. Suppose that you think IBM will be worth $1 on June 1. Suppose that the current IBM price is $1.50. I'm already dizzy with this stuff. I propose to buy it as a future (I'm not even sure what that means, but I think I have that concept), so I spend no money today but I guarantee to purchase one share of IBM on May 31 so that I have it for sale on June 1. I have made an offer to purchase said one share at $1. Somebody accepts, then I am in a position to sell same at $2 on said day. I realize that the numbers that I have chosen above are unrealistic, but I am just trying to get to the basics of this. As I currently understand it, a hedge is a bet in both directions, and the point is to minimize the distance. I could be wrong, and it would only be the 1758th time in my life, but that's the feeling that I'm getting. You bet both ways, you subtract and that's your piece. Next layer: I'm doing this on behalf of somebody somewhere who has tossed a million Euros into the pile. Now I'm playing with those Euros and I'm guessing that Sun's acquisition of MySQL is a brilliant move and I want to party in this arena. So I plonk a Euro into this party and I'm confident that it will become 2 Euros in a week or month. To hedge this bet, I need to find someone who... I'm dizzy again... I don't understand this stuff... ok so to hedge this bet I need to find someone who doesn't believe that Sun's value will increase due to its acquisition of MySQL... but even that's incorrect. I need to find someone who doesn't believe the value of Sun's shares will increase as much as I think they will. Is all this correct or even close? I'm in a whole new universe here and I have no idea whether my perceptions are accurate or woefully amiss. I know that these lists are mostly about code but this is vaguely related to code, so please allow this off-topic question. A. From jwcolby at colbyconsulting.com Tue May 6 07:28:19 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 06 May 2008 08:28:19 -0400 Subject: [dba-SQLServer] Normalizing a text field Message-ID: <48204EE3.7030202@colbyconsulting.com> I have a spreadsheet with a zip column and a column with 0 to many cities in the format Name1, St Name2, St Name3, St Notice that there is no "field delimiter" between St (state) and the next city name. Is there any way in SQL to do this or is this a job for code? I can write the code, but I am lost on doing this in SQL. -- John W. Colby www.ColbyConsulting.com From robert at webedb.com Tue May 6 15:33:29 2008 From: robert at webedb.com (Robert L. Stewart) Date: Tue, 06 May 2008 15:33:29 -0500 Subject: [dba-SQLServer] Normalizing a text field In-Reply-To: References: Message-ID: <200805062035.m46KZlQ9012414@databaseadvisors.com> Code At 12:00 PM 5/6/2008, you wrote: >Date: Tue, 06 May 2008 08:28:19 -0400 >From: jwcolby >Subject: [dba-SQLServer] Normalizing a text field >To: Access Developers discussion and problem solving > , Dba-Sqlserver > >Message-ID: <48204EE3.7030202 at colbyconsulting.com> >Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >I have a spreadsheet with a zip column and a column with 0 to many >cities in the format Name1, St Name2, St Name3, St > >Notice that there is no "field delimiter" between St (state) and the >next city name. > >Is there any way in SQL to do this or is this a job for code? I can >write the code, but I am lost on doing this in SQL. > >-- >John W. Colby From Gustav at cactus.dk Fri May 9 03:59:37 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 10:59:37 +0200 Subject: [dba-SQLServer] Verify an mdf file Message-ID: Hi all A client has asked if we could verify some SQL Server databases for him after a rebuild of a disk storage. What is the best way to do that? I will receive the mdf files - and perhaps the ldf files too - and will attach these to a running instance of 2005. This will either be possible or not dependant on the condition of the files. For each case I wish some guru advice for the best way to proceed to be able to state a Go or a Nogo for the files. /gustav From fhtapia at gmail.com Fri May 9 08:12:21 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 9 May 2008 06:12:21 -0700 Subject: [dba-SQLServer] Verify an mdf file In-Reply-To: References: Message-ID: Dbcc checkdb this will tell you the condition of the files sent but ideally you'd want to run this on his server because there could be other problems with his system On 5/9/08, Gustav Brock wrote: > Hi all > > A client has asked if we could verify some SQL Server databases for him > after a rebuild of a disk storage. > > What is the best way to do that? > > I will receive the mdf files - and perhaps the ldf files too - and will > attach these to a running instance of 2005. > This will either be possible or not dependant on the condition of the files. > For each case I wish some guru advice for the best way to proceed to be able > to state a Go or a Nogo for the files. > > /gustav > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Sent from Gmail for mobile | mobile.google.com -Francisco http://sqlthis.blogspot.com | Tsql and More... From Gustav at cactus.dk Fri May 9 08:33:33 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 15:33:33 +0200 Subject: [dba-SQLServer] Verify an mdf file Message-ID: Hi Francisco Thanks. Didn't even know of dbcc ... /gustav >>> fhtapia at gmail.com 09-05-2008 15:12 >>> Dbcc checkdb this will tell you the condition of the files sent but ideally you'd want to run this on his server because there could be other problems with his system On 5/9/08, Gustav Brock wrote: > Hi all > > A client has asked if we could verify some SQL Server databases for him > after a rebuild of a disk storage. > > What is the best way to do that? > > I will receive the mdf files - and perhaps the ldf files too - and will > attach these to a running instance of 2005. > This will either be possible or not dependant on the condition of the files. > For each case I wish some guru advice for the best way to proceed to be able > to state a Go or a Nogo for the files. > > /gustav From fuller.artful at gmail.com Fri May 9 18:18:04 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 9 May 2008 19:18:04 -0400 Subject: [dba-SQLServer] .NET Stock Trader Message-ID: <29f585dd0805091618n511fe1f5u350265ba0f6efb33@mail.gmail.com> I have been hunting for a source to dowload this from, and so far all I can find about it is messages, not download sources. This is a Microsoft sample app and I need to have a look at it. Anyone know where it lives? TIA, Arthur From greg at worthey.com Sat May 10 18:47:21 2008 From: greg at worthey.com (Greg Worthey) Date: Sat, 10 May 2008 16:47:21 -0700 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 63, Issue 9 In-Reply-To: References: Message-ID: <005201c8b2f8$31e20a30$1501a8c0@wsp21> Google-- .net stock trader site:Microsoft.com ---------------------------------------------------------------------- Message: 1 Date: Fri, 9 May 2008 19:18:04 -0400 From: "Arthur Fuller" Subject: [dba-SQLServer] .NET Stock Trader To: "Access Developers discussion and problem solving" Message-ID: <29f585dd0805091618n511fe1f5u350265ba0f6efb33 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I have been hunting for a source to dowload this from, and so far all I can find about it is messages, not download sources. This is a Microsoft sample app and I need to have a look at it. Anyone know where it lives? TIA, Arthur ------------------------------ _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver End of dba-SQLServer Digest, Vol 63, Issue 9 ******************************************** From fkkendrick at cox.net Sat May 10 23:38:56 2008 From: fkkendrick at cox.net (F Kay Kendrick) Date: Sat, 10 May 2008 23:38:56 -0500 Subject: [dba-SQLServer] .NET Stock Trader In-Reply-To: <29f585dd0805091618n511fe1f5u350265ba0f6efb33@mail.gmail.com> References: <29f585dd0805091618n511fe1f5u350265ba0f6efb33@mail.gmail.com> Message-ID: <000601c8b320$eca9b750$030aa8c0@dragon> It's offline right now, pending an updated version. Kay K -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Friday, May 09, 2008 6:18 PM To: Access Developers discussion and problem solving Subject: [dba-SQLServer] .NET Stock Trader I have been hunting for a source to dowload this from, and so far all I can find about it is messages, not download sources. This is a Microsoft sample app and I need to have a look at it. Anyone know where it lives? TIA, Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From robert at webedb.com Mon May 12 07:39:42 2008 From: robert at webedb.com (Robert L. Stewart) Date: Mon, 12 May 2008 07:39:42 -0500 Subject: [dba-SQLServer] .NET Stock Trader In-Reply-To: References: Message-ID: <200805121241.m4CCfCVU014892@databaseadvisors.com> http://msdn.microsoft.com/en-us/netframework/bb499684.aspx Coming Soon! StockTrader 2.0 We have removed the the StockTrader 1.0 download in preparation for the imminent release of the StockTrader 2.0 download in the coming days, including the new Configuration Service 2.0. We are working hard to get this new download posted on MSDN, so check back during the next several days. The new download will include the automated setup for StockTrader 2.0 and the Configuration Service 2.0, with associated technical documents that explain how to implement the new Configuration Service in your own applications and services to achieve central configuration management, and dynamic clustering of Windows Communication Foundation Services with application-level failover across clustered nodes. At 12:00 PM 5/10/2008, you wrote: >Date: Fri, 9 May 2008 19:18:04 -0400 >From: "Arthur Fuller" >Subject: [dba-SQLServer] .NET Stock Trader >To: "Access Developers discussion and problem solving" > >Message-ID: > <29f585dd0805091618n511fe1f5u350265ba0f6efb33 at mail.gmail.com> >Content-Type: text/plain; charset=ISO-8859-1 > >I have been hunting for a source to dowload this from, and so far all I can >find about it is messages, not download sources. This is a Microsoft sample >app and I need to have a look at it. Anyone know where it lives? > >TIA, >Arthur > From jwcolby at colbyconsulting.com Tue May 13 11:10:57 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 May 2008 12:10:57 -0400 Subject: [dba-SQLServer] SQL Server not in list of servers Message-ID: <4829BD91.3030604@colbyconsulting.com> I just upgraded Stonehenge, my main server to Windows 2003 x64 / SQL Server x64. This morning I tried to do a copy database, which I have done dozens of times before and now it says that the "destination server is not running", the destination server being (default). Further if I go into the list of servers combo, either source or destination, it does not show Stonehenge in the list of servers, though it does show Stonehenge / SQL Express and M90. To my knowledge M90 (my laptop) is not running SQL Server at the moment. So the So it appears that the list of available servers is not correct. I thought that the SQL Browser service was responsible for finding instances of SQL Server, and that service is running. Any idea what might be going on or how to determine what is going on? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue May 13 11:22:28 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 May 2008 18:22:28 +0200 Subject: [dba-SQLServer] SQL Server not in list of servers Message-ID: Hi John Maybe the upgrade has turned of the option (reset it to default) that allows external connections? Or you may need - in the manager - to type in the IP address of Stonehenge for a beginning. /gustav >>> jwcolby at colbyconsulting.com 13-05-2008 18:10 >>> I just upgraded Stonehenge, my main server to Windows 2003 x64 / SQL Server x64. This morning I tried to do a copy database, which I have done dozens of times before and now it says that the "destination server is not running", the destination server being (default). Further if I go into the list of servers combo, either source or destination, it does not show Stonehenge in the list of servers, though it does show Stonehenge / SQL Express and M90. To my knowledge M90 (my laptop) is not running SQL Server at the moment. So the So it appears that the list of available servers is not correct. I thought that the SQL Browser service was responsible for finding instances of SQL Server, and that service is running. Any idea what might be going on or how to determine what is going on? -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Tue May 13 11:24:55 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 13 May 2008 09:24:55 -0700 Subject: [dba-SQLServer] SQL Server not in list of servers In-Reply-To: <4829BD91.3030604@colbyconsulting.com> References: <4829BD91.3030604@colbyconsulting.com> Message-ID: If the Sql Browser is running, then the next thing I would double check is if you have any firewalls running between the two systems. On Tue, May 13, 2008 at 9:10 AM, jwcolby wrote: > I just upgraded Stonehenge, my main server to Windows 2003 x64 / SQL > Server x64. This morning I tried to do a copy database, which I have > done dozens of times before and now it says that the "destination server > is not running", the destination server being (default). > > Further if I go into the list of servers combo, either source or > destination, it does not show Stonehenge in the list of servers, though > it does show Stonehenge / SQL Express and M90. To my knowledge M90 (my > laptop) is not running SQL Server at the moment. So the > > So it appears that the list of available servers is not correct. I > thought that the SQL Browser service was responsible for finding > instances of SQL Server, and that service is running. > > Any idea what might be going on or how to determine what is going on? > > -- > 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 > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From fuller.artful at gmail.com Tue May 13 11:47:45 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 13 May 2008 12:47:45 -0400 Subject: [dba-SQLServer] Members in Bermuda? Message-ID: <29f585dd0805130947l1540c9e3qa8f0362cc29211c1@mail.gmail.com> I'm moving to Bermuda on or about June 1. It will take me about a month to get established there. I hope that one or two listers here reside there. That would be a good start to moving in. I will still be in touch but in a new location with a whole bunch of new tricks to learn, but that's what keeps old dogs alive. I found a job on a crew that I admire immensely. I don't know exactly why I was the chosen candidate, but I'm very happy with their decision. I'll be in Bermuda on or shortly after June 1. Do we have any listers there? A. From jwcolby at colbyconsulting.com Tue May 13 12:16:04 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 May 2008 13:16:04 -0400 Subject: [dba-SQLServer] SQL Server not in list of servers In-Reply-To: References: <4829BD91.3030604@colbyconsulting.com> Message-ID: <4829CCD4.3020909@colbyconsulting.com> Francisco, It turns out that there was an instance of SQL Server Express (x32) installed by Visual Studio. Not needing that (and since that was listed as an available server) I uninstalled that. Now the job at least begins to run (no error message about the destination server being unavailable) but it does not complete. The only firewall on the server is the Windows Firewall, which is disabled. This is Stonehenge, trying to run a job on Stonehenge, said job to copy a database from StoneHenge to Stonehenge with a rename (copy to different name). I have been using this technique in x32 SQL Server for many months now. Now the job runs but gives an error on the last step saying that the job failed and check the event log. There is a Error entry in the event log but the error message is useless (package xxx failed) and the help lookup returns "no additional information". There is an additional warning AFTER the error which basically says "the job failed, last step run was step 1". Help lookup returns "no additional info". No idea where to turn at this point. It is "just a simple copy". However between now and back when it used to work I have completely reinstalled the Windows (to x64) and SQL Server (x64) and of course my user, though I am using the same username, password and machine name. All of my databases reside out on a RAID array / volume. I unattached all databases before the reinstall, and then reattached them after. I can see the database being copied. I can open the database, open views and see data etc. I just can't copy the database to a new database / name, which is what I do to get a new "blank" order database set up. Not good. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > If the Sql Browser is running, then the next thing I would double check is > if you have any firewalls running between the two systems. > > On Tue, May 13, 2008 at 9:10 AM, jwcolby > wrote: > >> I just upgraded Stonehenge, my main server to Windows 2003 x64 / SQL >> Server x64. This morning I tried to do a copy database, which I have >> done dozens of times before and now it says that the "destination server >> is not running", the destination server being (default). >> >> Further if I go into the list of servers combo, either source or >> destination, it does not show Stonehenge in the list of servers, though >> it does show Stonehenge / SQL Express and M90. To my knowledge M90 (my >> laptop) is not running SQL Server at the moment. So the >> >> So it appears that the list of available servers is not correct. I >> thought that the SQL Browser service was responsible for finding >> instances of SQL Server, and that service is running. >> >> Any idea what might be going on or how to determine what is going on? >> >> -- >> 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 May 13 12:24:19 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 May 2008 13:24:19 -0400 Subject: [dba-SQLServer] SQL Server not in list of servers In-Reply-To: <4829CCD4.3020909@colbyconsulting.com> References: <4829BD91.3030604@colbyconsulting.com> <4829CCD4.3020909@colbyconsulting.com> Message-ID: <4829CEC3.2080307@colbyconsulting.com> Never mind! It seems I was using a different method. There are two ways you can do this. One Detaches the database, copies and reattaches. That is the method I have always used (and works). The other leaves the database attached and somehow does the copy (but does not work, at least on my system). I was trying the "leave attached" method which failed. I don't believe I had ever tried that method before, and did not really intend to do so this time. Hmm.... Anyway, I have my copy and know how to do what I need. Thanks guys. John W. Colby www.ColbyConsulting.com jwcolby wrote: > Francisco, > > It turns out that there was an instance of SQL Server Express (x32) > installed by Visual Studio. Not needing that (and since that was listed > as an available server) I uninstalled that. Now the job at least begins > to run (no error message about the destination server being unavailable) > but it does not complete. > > The only firewall on the server is the Windows Firewall, which is > disabled. This is Stonehenge, trying to run a job on Stonehenge, said > job to copy a database from StoneHenge to Stonehenge with a rename (copy > to different name). I have been using this technique in x32 SQL Server > for many months now. > > Now the job runs but gives an error on the last step saying that the job > failed and check the event log. There is a Error entry in the event log > but the error message is useless (package xxx failed) and the help > lookup returns "no additional information". > > There is an additional warning AFTER the error which basically says "the > job failed, last step run was step 1". Help lookup returns "no > additional info". > > No idea where to turn at this point. It is "just a simple copy". > However between now and back when it used to work I have completely > reinstalled the Windows (to x64) and SQL Server (x64) and of course my > user, though I am using the same username, password and machine name. > > All of my databases reside out on a RAID array / volume. I unattached > all databases before the reinstall, and then reattached them after. I > can see the database being copied. I can open the database, open views > and see data etc. I just can't copy the database to a new database / > name, which is what I do to get a new "blank" order database set up. > > Not good. > > John W. Colby > www.ColbyConsulting.com > > > Francisco Tapia wrote: >> If the Sql Browser is running, then the next thing I would double check is >> if you have any firewalls running between the two systems. >> >> On Tue, May 13, 2008 at 9:10 AM, jwcolby >> wrote: >> >>> I just upgraded Stonehenge, my main server to Windows 2003 x64 / SQL >>> Server x64. This morning I tried to do a copy database, which I have >>> done dozens of times before and now it says that the "destination server >>> is not running", the destination server being (default). >>> >>> Further if I go into the list of servers combo, either source or >>> destination, it does not show Stonehenge in the list of servers, though >>> it does show Stonehenge / SQL Express and M90. To my knowledge M90 (my >>> laptop) is not running SQL Server at the moment. So the >>> >>> So it appears that the list of available servers is not correct. I >>> thought that the SQL Browser service was responsible for finding >>> instances of SQL Server, and that service is running. >>> >>> Any idea what might be going on or how to determine what is going on? >>> >>> -- >>> 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 May 13 14:17:50 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 May 2008 15:17:50 -0400 Subject: [dba-SQLServer] Order of data in views Message-ID: <4829E95E.2000509@colbyconsulting.com> In the past I created a set of count views. For months I have been opening a query window and entering SELECT * FROM SomeView. The order of the fields was always ordered, now it is not. Someone a while back made a comment something like "a view is by its nature unsorted". Why this would be I haven't a clue since there are order by criteria right in the view, but be that as it may, this has worked in the past and now it is not. The issue here is that the client expects to see the data sorted. So now I have to go do something like: SELECT * FROM SomeView Order BY SomeField And voila, sorted data. The issue of course is that it is no longer simple. I gave to discover the name of the order by field and enter that in my query window. Any ideas why it did work and now does not? How to make it just take the order of the underlying view and pass it through? -- John W. Colby www.ColbyConsulting.com From dwaters at usinternet.com Tue May 13 15:14:21 2008 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 13 May 2008 15:14:21 -0500 Subject: [dba-SQLServer] Order of data in views In-Reply-To: <4829E95E.2000509@colbyconsulting.com> References: <4829E95E.2000509@colbyconsulting.com> Message-ID: <000d01c8b535$eea230c0$0300a8c0@danwaters> I'm not a SQL guy, but wouldn't an unordered view reflect the sort of the underlying table? Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, May 13, 2008 2:18 PM To: Dba-Sqlserver Subject: [dba-SQLServer] Order of data in views In the past I created a set of count views. For months I have been opening a query window and entering SELECT * FROM SomeView. The order of the fields was always ordered, now it is not. Someone a while back made a comment something like "a view is by its nature unsorted". Why this would be I haven't a clue since there are order by criteria right in the view, but be that as it may, this has worked in the past and now it is not. The issue here is that the client expects to see the data sorted. So now I have to go do something like: SELECT * FROM SomeView Order BY SomeField And voila, sorted data. The issue of course is that it is no longer simple. I gave to discover the name of the order by field and enter that in my query window. Any ideas why it did work and now does not? How to make it just take the order of the underlying view and pass it through? -- 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 May 13 15:34:21 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 May 2008 16:34:21 -0400 Subject: [dba-SQLServer] Order of data in views In-Reply-To: <000d01c8b535$eea230c0$0300a8c0@danwaters> References: <4829E95E.2000509@colbyconsulting.com> <000d01c8b535$eea230c0$0300a8c0@danwaters> Message-ID: <4829FB4D.7010502@colbyconsulting.com> Well, we are talking about a GroupBy Cnt query here. The GroupBy field is what is ordered on, and is specifically ordered on that field in the underlying view. Unfortunately I cannot execute the view since the view takes about 40 seconds to complete and MS times out in 30, which no one here has managed to show me how to prevent. Therefore I am forced to create a query and paste the query into that in a SELECT * FROM SomeView SQL statement. Given that the view is ordered, you (I) would expect a query directly based on that to be ordered unles specifically reordered in some manner. Not so for whatever reason. John W. Colby www.ColbyConsulting.com Dan Waters wrote: > I'm not a SQL guy, but wouldn't an unordered view reflect the sort of the > underlying table? > > Dan > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, May 13, 2008 2:18 PM > To: Dba-Sqlserver > Subject: [dba-SQLServer] Order of data in views > > In the past I created a set of count views. For months I have been > opening a query window and entering > > SELECT * FROM SomeView. > > The order of the fields was always ordered, now it is not. > > Someone a while back made a comment something like "a view is by its > nature unsorted". Why this would be I haven't a clue since there are > order by criteria right in the view, but be that as it may, this has > worked in the past and now it is not. > > The issue here is that the client expects to see the data sorted. So > now I have to go do something like: > > SELECT * FROM SomeView Order BY SomeField > > And voila, sorted data. The issue of course is that it is no longer > simple. I gave to discover the name of the order by field and enter > that in my query window. > > Any ideas why it did work and now does not? How to make it just take > the order of the underlying view and pass it through? > From stuart at lexacorp.com.pg Tue May 13 18:22:55 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 14 May 2008 09:22:55 +1000 Subject: [dba-SQLServer] Order of data in views In-Reply-To: <4829FB4D.7010502@colbyconsulting.com> References: <4829E95E.2000509@colbyconsulting.com>, <000d01c8b535$eea230c0$0300a8c0@danwaters>, <4829FB4D.7010502@colbyconsulting.com> Message-ID: <482AAF6F.22297.5388068@stuart.lexacorp.com.pg> On 13 May 2008 at 16:34, jwcolby wrote: > Well, we are talking about a GroupBy Cnt query here. The GroupBy field > is what is ordered on, and is specifically ordered on that field in the > underlying view. > > Unfortunately I cannot execute the view since the view takes about 40 > seconds to complete and MS times out in 30, which no one here has > managed to show me how to prevent. > Enterprise Manager, select the Server, right click and select properties, check the "query timeout" field on the "Connection" tab ? > Therefore I am forced to create a query and paste the query into that in > a SELECT * FROM SomeView SQL statement. Given that the view is ordered, > you (I) would expect a query directly based on that to be ordered unles > specifically reordered in some manner. Not so for whatever reason. > Use "SELECT TOP (99.9999999999999) PERCENT..." see http://executioniseverything.blogspot.com/2007/01/order-by-in-views-sql-server-2005.html From jwcolby at colbyconsulting.com Wed May 14 04:20:32 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 May 2008 05:20:32 -0400 Subject: [dba-SQLServer] Order of data in views In-Reply-To: <482AAF6F.22297.5388068@stuart.lexacorp.com.pg> References: <4829E95E.2000509@colbyconsulting.com>, <000d01c8b535$eea230c0$0300a8c0@danwaters>, <4829FB4D.7010502@colbyconsulting.com> <482AAF6F.22297.5388068@stuart.lexacorp.com.pg> Message-ID: <482AAEE0.8090209@colbyconsulting.com> Stuart, > Enterprise Manager, select the Server, right click and select properties, check the "query timeout" field on the "Connection" tab ? Query timeout is set to 600 (seconds). These views are only taking ~2:40 minutes to run. I have been down this road before. Apparently that setting is for QUERIES, and apparently the SSMS treats views by a different set of rules than queries. > Use "SELECT TOP (99.9999999999999) PERCENT..." Interesting. Even more interesting, once I did that in one query, the rest of the queries sort "properly" even though the underlying view has no TOP() statement at all. Perhaps behind the scenes SSMS is leaving the last used TOP statement hanging around (sounds like another bug). So the takeaway is that it is a "feature" of SSMS that a sorted view works at all and don't depend on it. Just to straighten me out on this though... the theory is that a view is "just another table" and tables are by their nature unsorted? I do understand the "tables are by their nature unsorted" thing. Because a view is based on a SQL Statement, I always considered a view "a query" (a la Access), which appears to be untrue for whatever reason. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > On 13 May 2008 at 16:34, jwcolby wrote: > >> Well, we are talking about a GroupBy Cnt query here. The GroupBy field >> is what is ordered on, and is specifically ordered on that field in the >> underlying view. >> >> Unfortunately I cannot execute the view since the view takes about 40 >> seconds to complete and MS times out in 30, which no one here has >> managed to show me how to prevent. >> > > Enterprise Manager, select the Server, right click and select properties, check the "query > timeout" field on the "Connection" tab ? > > >> Therefore I am forced to create a query and paste the query into that in >> a SELECT * FROM SomeView SQL statement. Given that the view is ordered, >> you (I) would expect a query directly based on that to be ordered unles >> specifically reordered in some manner. Not so for whatever reason. >> > > Use "SELECT TOP (99.9999999999999) PERCENT..." > see > http://executioniseverything.blogspot.com/2007/01/order-by-in-views-sql-server-2005.html > > > _______________________________________________ > 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 Wed May 14 04:47:01 2008 From: mwp.reid at qub.ac.uk (Martin W Reid) Date: Wed, 14 May 2008 10:47:01 +0100 Subject: [dba-SQLServer] Order of data in views In-Reply-To: <482AAEE0.8090209@colbyconsulting.com> References: <4829E95E.2000509@colbyconsulting.com>, <000d01c8b535$eea230c0$0300a8c0@danwaters>, <4829FB4D.7010502@colbyconsulting.com> <482AAF6F.22297.5388068@stuart.lexacorp.com.pg>, <482AAEE0.8090209@colbyconsulting.com> Message-ID: John I always treated a view as a virtual table created at the point the statement is executed. The use orderby on the statement hitting the view. Martin Martin WP Reid Information Services Queen's University Riddel Hall 185 Stranmillis Road Belfast BT9 5EE Tel : 02890974465 Email : mwp.reid at qub.ac.uk ________________________________________ From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby [jwcolby at colbyconsulting.com] Sent: 14 May 2008 10:20 To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Order of data in views Stuart, > Enterprise Manager, select the Server, right click and select properties, check the "query timeout" field on the "Connection" tab ? Query timeout is set to 600 (seconds). These views are only taking ~2:40 minutes to run. I have been down this road before. Apparently that setting is for QUERIES, and apparently the SSMS treats views by a different set of rules than queries. > Use "SELECT TOP (99.9999999999999) PERCENT..." Interesting. Even more interesting, once I did that in one query, the rest of the queries sort "properly" even though the underlying view has no TOP() statement at all. Perhaps behind the scenes SSMS is leaving the last used TOP statement hanging around (sounds like another bug). So the takeaway is that it is a "feature" of SSMS that a sorted view works at all and don't depend on it. Just to straighten me out on this though... the theory is that a view is "just another table" and tables are by their nature unsorted? I do understand the "tables are by their nature unsorted" thing. Because a view is based on a SQL Statement, I always considered a view "a query" (a la Access), which appears to be untrue for whatever reason. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > On 13 May 2008 at 16:34, jwcolby wrote: > >> Well, we are talking about a GroupBy Cnt query here. The GroupBy field >> is what is ordered on, and is specifically ordered on that field in the >> underlying view. >> >> Unfortunately I cannot execute the view since the view takes about 40 >> seconds to complete and MS times out in 30, which no one here has >> managed to show me how to prevent. >> > > Enterprise Manager, select the Server, right click and select properties, check the "query > timeout" field on the "Connection" tab ? > > >> Therefore I am forced to create a query and paste the query into that in >> a SELECT * FROM SomeView SQL statement. Given that the view is ordered, >> you (I) would expect a query directly based on that to be ordered unles >> specifically reordered in some manner. Not so for whatever reason. >> > > Use "SELECT TOP (99.9999999999999) PERCENT..." > see > http://executioniseverything.blogspot.com/2007/01/order-by-in-views-sql-server-2005.html > > > _______________________________________________ > 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 May 14 04:59:57 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 May 2008 05:59:57 -0400 Subject: [dba-SQLServer] Order of data in views In-Reply-To: <482AAEE0.8090209@colbyconsulting.com> References: <4829E95E.2000509@colbyconsulting.com>, <000d01c8b535$eea230c0$0300a8c0@danwaters>, <4829FB4D.7010502@colbyconsulting.com> <482AAF6F.22297.5388068@stuart.lexacorp.com.pg> <482AAEE0.8090209@colbyconsulting.com> Message-ID: <482AB81D.5090009@colbyconsulting.com> Stuart, This one is fascinating: > Enterprise Manager, select the Server, right click and select properties, check the "query timeout" field on the "Connection" tab ? http://blogs.msdn.com/ialonso/archive/2007/12/04/sql-execution-error-timeout-expired-the-timeout-period-elapsed-while-opening-view-from-ssms.aspx Apparently SQL Server uses some third party code in it which references a registry key for this value. However... while the value does exist in the registry, and I can change the value, and the value shows that it changed when I close and reopen RegEdit... After closing and reopening SSMS, the value is set back to 30. I guess SSMS REALLY wants that value set to 30? ;-) John W. Colby www.ColbyConsulting.com jwcolby wrote: > Stuart, > > > Enterprise Manager, select the Server, right click and select > properties, check the "query timeout" field on the "Connection" tab ? > > Query timeout is set to 600 (seconds). These views are only taking > ~2:40 minutes to run. I have been down this road before. Apparently > that setting is for QUERIES, and apparently the SSMS treats views by a > different set of rules than queries. > > > Use "SELECT TOP (99.9999999999999) PERCENT..." > > Interesting. Even more interesting, once I did that in one query, the > rest of the queries sort "properly" even though the underlying view has > no TOP() statement at all. > > Perhaps behind the scenes SSMS is leaving the last used TOP statement > hanging around (sounds like another bug). > > So the takeaway is that it is a "feature" of SSMS that a sorted view > works at all and don't depend on it. > > Just to straighten me out on this though... the theory is that a view is > "just another table" and tables are by their nature unsorted? I do > understand the "tables are by their nature unsorted" thing. Because a > view is based on a SQL Statement, I always considered a view "a query" > (a la Access), which appears to be untrue for whatever reason. > > John W. Colby > www.ColbyConsulting.com > > > Stuart McLachlan wrote: >> On 13 May 2008 at 16:34, jwcolby wrote: >> >>> Well, we are talking about a GroupBy Cnt query here. The GroupBy field >>> is what is ordered on, and is specifically ordered on that field in the >>> underlying view. >>> >>> Unfortunately I cannot execute the view since the view takes about 40 >>> seconds to complete and MS times out in 30, which no one here has >>> managed to show me how to prevent. >>> >> Enterprise Manager, select the Server, right click and select properties, check the "query >> timeout" field on the "Connection" tab ? >> >> >>> Therefore I am forced to create a query and paste the query into that in >>> a SELECT * FROM SomeView SQL statement. Given that the view is ordered, >>> you (I) would expect a query directly based on that to be ordered unles >>> specifically reordered in some manner. Not so for whatever reason. >>> >> Use "SELECT TOP (99.9999999999999) PERCENT..." >> see >> http://executioniseverything.blogspot.com/2007/01/order-by-in-views-sql-server-2005.html >> >> >> _______________________________________________ >> 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 May 14 05:12:43 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 May 2008 06:12:43 -0400 Subject: [dba-SQLServer] Order of data in views In-Reply-To: References: <4829E95E.2000509@colbyconsulting.com>, <000d01c8b535$eea230c0$0300a8c0@danwaters>, <4829FB4D.7010502@colbyconsulting.com> <482AAF6F.22297.5388068@stuart.lexacorp.com.pg>, <482AAEE0.8090209@colbyconsulting.com> Message-ID: <482ABB1B.2040902@colbyconsulting.com> Martin, In the end it really doesn't matter, reality is, and reality says that SQL treats a view as a "table". I guess we get into semantics here. What is a query (and to be frank, I certainly don't know, behind the scenes)? Is it not a "virtual table"? A set of data pulled out of the database. WHATEVER ELSE IT IS, it is a SQL statement with a SELECT clause. Everything else that can be used with a SELECT clause works correct? Why not the Order By clause? It is just a steenkin SQL Statement, the ORDER BY clause should function too. The answer to that question is probably lost in the mists of time and the members of some standards body who defined SQL syntax and operation decades ago. Some Purist likely had some reason not to want a view sorted and had a LOT of pull on the committee and so here we are, decades later, saying "of course a view is ALWAYS unsorted". LOGICALLY a view is a SELECT SQL statement, and the last time I looked SELECT SQL statements have an ORDER BY clause defined in the SQL syntax... but NOT if saved as a view. Silly if you ask me. But I don't get a vote. John W. Colby www.ColbyConsulting.com Martin W Reid wrote: > John > > I always treated a view as a virtual table created at the point the statement is executed. The use orderby on the statement hitting the view. > > Martin > > > Martin WP Reid > Information Services > Queen's University > Riddel Hall > 185 Stranmillis Road > Belfast > BT9 5EE > Tel : 02890974465 > Email : mwp.reid at qub.ac.uk From mwp.reid at qub.ac.uk Wed May 14 05:23:48 2008 From: mwp.reid at qub.ac.uk (Martin W Reid) Date: Wed, 14 May 2008 11:23:48 +0100 Subject: [dba-SQLServer] Order of data in views In-Reply-To: <482ABB1B.2040902@colbyconsulting.com> References: <4829E95E.2000509@colbyconsulting.com>, <000d01c8b535$eea230c0$0300a8c0@danwaters>, <4829FB4D.7010502@colbyconsulting.com> <482AAF6F.22297.5388068@stuart.lexacorp.com.pg>, <482AAEE0.8090209@colbyconsulting.com> , <482ABB1B.2040902@colbyconsulting.com> Message-ID: John Have you seen this http://support.microsoft.com/kb/926292 Martin Martin WP Reid Information Services Queen's University Riddel Hall 185 Stranmillis Road Belfast BT9 5EE Tel : 02890974465 Email : mwp.reid at qub.ac.uk ________________________________________ From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby [jwcolby at colbyconsulting.com] Sent: 14 May 2008 11:12 To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Order of data in views Martin, In the end it really doesn't matter, reality is, and reality says that SQL treats a view as a "table". I guess we get into semantics here. What is a query (and to be frank, I certainly don't know, behind the scenes)? Is it not a "virtual table"? A set of data pulled out of the database. WHATEVER ELSE IT IS, it is a SQL statement with a SELECT clause. Everything else that can be used with a SELECT clause works correct? Why not the Order By clause? It is just a steenkin SQL Statement, the ORDER BY clause should function too. The answer to that question is probably lost in the mists of time and the members of some standards body who defined SQL syntax and operation decades ago. Some Purist likely had some reason not to want a view sorted and had a LOT of pull on the committee and so here we are, decades later, saying "of course a view is ALWAYS unsorted". LOGICALLY a view is a SELECT SQL statement, and the last time I looked SELECT SQL statements have an ORDER BY clause defined in the SQL syntax... but NOT if saved as a view. Silly if you ask me. But I don't get a vote. John W. Colby www.ColbyConsulting.com Martin W Reid wrote: > John > > I always treated a view as a virtual table created at the point the statement is executed. The use orderby on the statement hitting the view. > > Martin > > > Martin WP Reid > Information Services > Queen's University > Riddel Hall > 185 Stranmillis Road > Belfast > BT9 5EE > Tel : 02890974465 > Email : mwp.reid at qub.ac.uk _______________________________________________ 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 May 14 05:31:16 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 May 2008 06:31:16 -0400 Subject: [dba-SQLServer] Order of data in views In-Reply-To: References: <4829E95E.2000509@colbyconsulting.com>, <000d01c8b535$eea230c0$0300a8c0@danwaters>, <4829FB4D.7010502@colbyconsulting.com> <482AAF6F.22297.5388068@stuart.lexacorp.com.pg>, <482AAEE0.8090209@colbyconsulting.com> , <482ABB1B.2040902@colbyconsulting.com> Message-ID: <482ABF74.8000508@colbyconsulting.com> Yes, I ran across this this morning in fact. It appears to be a "bug fix" to cause 2005 to be like 2000. Now the question is, is 2000's behavior "intentional" or is it a bug that must be emulate forever. Not that it matters. John W. Colby www.ColbyConsulting.com Martin W Reid wrote: > John > > Have you seen this > > http://support.microsoft.com/kb/926292 > > Martin > > > Martin WP Reid > Information Services > Queen's University > Riddel Hall > 185 Stranmillis Road > Belfast > BT9 5EE > Tel : 02890974465 > Email : mwp.reid at qub.ac.uk > ________________________________________ > From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby [jwcolby at colbyconsulting.com] > Sent: 14 May 2008 11:12 > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] Order of data in views > > Martin, > > In the end it really doesn't matter, reality is, and reality says that > SQL treats a view as a "table". > > I guess we get into semantics here. What is a query (and to be frank, I > certainly don't know, behind the scenes)? Is it not a "virtual table"? > A set of data pulled out of the database. WHATEVER ELSE IT IS, it is > a SQL statement with a SELECT clause. Everything else that can be used > with a SELECT clause works correct? Why not the Order By clause? It is > just a steenkin SQL Statement, the ORDER BY clause should function too. > > The answer to that question is probably lost in the mists of time and > the members of some standards body who defined SQL syntax and operation > decades ago. Some Purist likely had some reason not to want a view > sorted and had a LOT of pull on the committee and so here we are, > decades later, saying "of course a view is ALWAYS unsorted". > > LOGICALLY a view is a SELECT SQL statement, and the last time I looked > SELECT SQL statements have an ORDER BY clause defined in the SQL > syntax... but NOT if saved as a view. > > Silly if you ask me. But I don't get a vote. > > John W. Colby > www.ColbyConsulting.com > > > Martin W Reid wrote: >> John >> >> I always treated a view as a virtual table created at the point the statement is executed. The use orderby on the statement hitting the view. >> >> Martin >> >> >> Martin WP Reid >> Information Services >> Queen's University >> Riddel Hall >> 185 Stranmillis Road >> Belfast >> BT9 5EE >> Tel : 02890974465 >> Email : mwp.reid at qub.ac.uk > _______________________________________________ > 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 ssharkins at gmail.com Wed May 14 07:32:42 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Wed, 14 May 2008 08:32:42 -0400 Subject: [dba-SQLServer] question on data types Message-ID: <003601c8b5be$9c485960$6500a8c0@SusanOne> Why use money or smallmoney instead of decimal? Susan H. From robert at webedb.com Wed May 14 07:38:13 2008 From: robert at webedb.com (Robert L. Stewart) Date: Wed, 14 May 2008 07:38:13 -0500 Subject: [dba-SQLServer] Order of data in views In-Reply-To: References: Message-ID: <200805141240.m4ECearp001086@databaseadvisors.com> Actually, this is by design. And, it is not limited to SSMS. Using the TOP(99.999999999999999) PERCENT tricks it into working like we would normally expect. Robert At 04:47 AM 5/14/2008, you wrote: >Date: Wed, 14 May 2008 05:20:32 -0400 >From: jwcolby >Subject: Re: [dba-SQLServer] Order of data in views >To: Discussion concerning MS SQL Server > >Message-ID: <482AAEE0.8090209 at colbyconsulting.com> >Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >Stuart, > > > Enterprise Manager, select the Server, right click and select >properties, check the "query timeout" field on the "Connection" tab ? > >Query timeout is set to 600 (seconds). These views are only taking >~2:40 minutes to run. I have been down this road before. Apparently >that setting is for QUERIES, and apparently the SSMS treats views by a >different set of rules than queries. > > > Use "SELECT TOP (99.9999999999999) PERCENT..." > >Interesting. Even more interesting, once I did that in one query, the >rest of the queries sort "properly" even though the underlying view has >no TOP() statement at all. > >Perhaps behind the scenes SSMS is leaving the last used TOP statement >hanging around (sounds like another bug). > >So the takeaway is that it is a "feature" of SSMS that a sorted view >works at all and don't depend on it. > >Just to straighten me out on this though... the theory is that a view is >"just another table" and tables are by their nature unsorted? I do >understand the "tables are by their nature unsorted" thing. Because a >view is based on a SQL Statement, I always considered a view "a query" >(a la Access), which appears to be untrue for whatever reason. > >John W. Colby From fhtapia at gmail.com Wed May 14 08:39:21 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 14 May 2008 06:39:21 -0700 Subject: [dba-SQLServer] Order of data in views In-Reply-To: <482AAEE0.8090209@colbyconsulting.com> References: <4829E95E.2000509@colbyconsulting.com> <000d01c8b535$eea230c0$0300a8c0@danwaters> <4829FB4D.7010502@colbyconsulting.com> <482AAF6F.22297.5388068@stuart.lexacorp.com.pg> <482AAEE0.8090209@colbyconsulting.com> Message-ID: John, The basics haven't changed in that views are not sorted until you yourself sort it, it could be that the results are in line with the order of your indexes Further, when you base a query off a view are you only changing the where clause or are you joining against another table/ view? On 5/14/08, jwcolby wrote: > Stuart, > > > Enterprise Manager, select the Server, right click and select > properties, check the "query timeout" field on the "Connection" tab ? > > Query timeout is set to 600 (seconds). These views are only taking > ~2:40 minutes to run. I have been down this road before. Apparently > that setting is for QUERIES, and apparently the SSMS treats views by a > different set of rules than queries. > > > Use "SELECT TOP (99.9999999999999) PERCENT..." > > Interesting. Even more interesting, once I did that in one query, the > rest of the queries sort "properly" even though the underlying view has > no TOP() statement at all. > > Perhaps behind the scenes SSMS is leaving the last used TOP statement > hanging around (sounds like another bug). > > So the takeaway is that it is a "feature" of SSMS that a sorted view > works at all and don't depend on it. > > Just to straighten me out on this though... the theory is that a view is > "just another table" and tables are by their nature unsorted? I do > understand the "tables are by their nature unsorted" thing. Because a > view is based on a SQL Statement, I always considered a view "a query" > (a la Access), which appears to be untrue for whatever reason. > > John W. Colby > www.ColbyConsulting.com > > > Stuart McLachlan wrote: >> On 13 May 2008 at 16:34, jwcolby wrote: >> >>> Well, we are talking about a GroupBy Cnt query here. The GroupBy field >>> is what is ordered on, and is specifically ordered on that field in the >>> underlying view. >>> >>> Unfortunately I cannot execute the view since the view takes about 40 >>> seconds to complete and MS times out in 30, which no one here has >>> managed to show me how to prevent. >>> >> >> Enterprise Manager, select the Server, right click and select properties, >> check the "query >> timeout" field on the "Connection" tab ? >> >> >>> Therefore I am forced to create a query and paste the query into that in >>> a SELECT * FROM SomeView SQL statement. Given that the view is ordered, >>> you (I) would expect a query directly based on that to be ordered unles >>> specifically reordered in some manner. Not so for whatever reason. >>> >> >> Use "SELECT TOP (99.9999999999999) PERCENT..." >> see >> http://executioniseverything.blogspot.com/2007/01/order-by-in-views-sql-server-2005.html >> >> >> _______________________________________________ >> 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 > > -- Sent from Gmail for mobile | mobile.google.com -Francisco http://sqlthis.blogspot.com | Tsql and More... From jwcolby at colbyconsulting.com Wed May 14 10:00:11 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 May 2008 11:00:11 -0400 Subject: [dba-SQLServer] Order of data in views In-Reply-To: References: <4829E95E.2000509@colbyconsulting.com> <000d01c8b535$eea230c0$0300a8c0@danwaters> <4829FB4D.7010502@colbyconsulting.com> <482AAF6F.22297.5388068@stuart.lexacorp.com.pg> <482AAEE0.8090209@colbyconsulting.com> Message-ID: <482AFE7B.6080709@colbyconsulting.com> Francisco, I am not sure exactly what you are trying to discover. When I discussed the timeout issue long ago (here in this forum IIRC) I was told to simply to a: SELECT * FROM SomeView to get around the timeout. That is what I have been doing ever since. At the query level there is no join going on, it is exactly as described above. In fact these are GroupBy Somefield count PKID views back at the top view level. The orderby is on the SomeField (groupby field) down in that top level view. There are about 18 or so of these count queries which I run, then cut and paste the result set into pages of a spreadsheet. In the vast majority of cases the GroupBy is a number code 1 through 7 which represents an age (apparently). In other cases it is a state, zip or income code etc. I need to OrderBy that code, which I do in the top level view. If I were able to run the view (I can't because of the timeout issue) it would be sorted because SQL Server apparently allows an order by clause in a view even though it is not "approved of" by the SQL world. When I work with a view directly in SSMS, I can sort any view as I wish. It is just a SELECT SQL statement to SSMS, and SELECT syntax allows an Order By. In those cases where my views do not take longer than 30 seconds to execute, the views sort as directed, each and every time (so far, which is in the thousands of times) As for how I perform the end result, I build the SELECT * FROM SOMEVIEW in a query in that db, then simply replace SomeView with SomeOtherView with Some3rdView. I get result sets, cut to the paste buffer, paste into a sheet in a spreadsheet (template I built) and when I have run / cut / pasted all 18 or so views, I send the spreadsheet off to the customer. John W. Colby www.ColbyConsulting.com Francisco Tapia wrote: > John, > The basics haven't changed in that views are not sorted until you > yourself sort it, it could be that the results are in line with the > order of your indexes > > Further, when you base a query off a view are you only changing the > where clause or are you joining against another table/ view? > > > From jwcolby at colbyconsulting.com Wed May 14 10:34:20 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 May 2008 11:34:20 -0400 Subject: [dba-SQLServer] Reporting services login error Message-ID: <482B067C.60704@colbyconsulting.com> I am attempting to apply SP2 to one of my two x64 services. The first server (Stonehenge) installed fine. The second shows the SP attempting (and failing) to log in to something called Reporting Services on Colby-W2k3x64. It does manage to log into the "rest" of SQL Server however. I renamed this server to Azul, which was my previous name for this machine when it was x32, just to keep things "normal". The name of the machine BEFORE the rename was indeed Colby-W2K3x64. When I look in the Services, I find a SQL Server Reporting Services (MSSQLServer). I am guessing that something in the registry got munged or failed to rename when I renamed the server OS. I thought perhaps I could uninstall / reinstall just the reporting services but it is not a separate program in add/remove programs. Am I going to need to uninstall the whole shooting match? -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Wed May 14 13:37:20 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 14 May 2008 11:37:20 -0700 Subject: [dba-SQLServer] question on data types In-Reply-To: <003601c8b5be$9c485960$6500a8c0@SusanOne> References: <003601c8b5be$9c485960$6500a8c0@SusanOne> Message-ID: I've always used money as they tend to be accurate to accounting standards. -- Francisco On Wed, May 14, 2008 at 5:32 AM, Susan Harkins wrote: > Why use money or smallmoney instead of decimal? > > Susan H. > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From ssharkins at gmail.com Wed May 14 15:32:37 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Wed, 14 May 2008 16:32:37 -0400 Subject: [dba-SQLServer] question on data types References: <003601c8b5be$9c485960$6500a8c0@SusanOne> Message-ID: <04c201c8b601$da6517e0$6500a8c0@SusanOne> And decimal wouldn't be? Susan H. > I've always used money as they tend to be accurate to accounting > standards. From stuart at lexacorp.com.pg Wed May 14 18:14:07 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 15 May 2008 09:14:07 +1000 Subject: [dba-SQLServer] question on data types In-Reply-To: <003601c8b5be$9c485960$6500a8c0@SusanOne> References: <003601c8b5be$9c485960$6500a8c0@SusanOne> Message-ID: <482BFEDF.27292.A56CE85@stuart.lexacorp.com.pg> Storage requirements. Money and small money are effectively subsets of decimal. Only use Decimal if you need more precision or scale than the other two can provide. Smallmoney requires 4 bytes, money requires 8 bytes, decimal requires 9 bytes. Stuart On 14 May 2008 at 8:32, Susan Harkins wrote: > Why use money or smallmoney instead of decimal? > > 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 Wed May 14 18:59:20 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Wed, 14 May 2008 19:59:20 -0400 Subject: [dba-SQLServer] question on data types References: <003601c8b5be$9c485960$6500a8c0@SusanOne> <482BFEDF.27292.A56CE85@stuart.lexacorp.com.pg> Message-ID: <05d601c8b61e$d5818b10$6500a8c0@SusanOne> Okay -- that makes sense. Thanks! Susan H. > Storage requirements. Money and small money are effectively subsets of > decimal. > > Only use Decimal if you need more precision or scale than the other two > can provide. > > Smallmoney requires 4 bytes, money requires 8 bytes, decimal requires 9 > bytes. > > Stuart > > > > On 14 May 2008 at 8:32, Susan Harkins wrote: > >> Why use money or smallmoney instead of decimal? >> >> 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 Gustav at cactus.dk Wed May 28 04:23:33 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 28 May 2008 11:23:33 +0200 Subject: [dba-SQLServer] SQL Server 2008: New data types Message-ID: Hi all Noticed this article about the new data types of SQL Server 2008 for date/time, hierarchy, and spatial (geometry and geography): http://technet.microsoft.com/en-us/magazine/cc434692.aspx It seems as if the old US date/time format is left in favour of the ISO 8601 format. That alone is a progress. And time precision is now down to 100ns - well beyond the previous 3.33 ms and the 1ms of JET. /gustav From ssharkins at gmail.com Wed May 28 13:36:50 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Wed, 28 May 2008 14:36:50 -0400 Subject: [dba-SQLServer] confirmation about DBCC CHECKIDENT Message-ID: <03c201c8c0f1$cde5cd20$6500a8c0@SusanOne> I'm running some test DBCC CHECKIDENT statements. Now, the documentation says that you can't create a duplicate identity value if the identity column is part of a primary key -- says doing so will return a violation error. Therefore, I expected the DBCC CHECKIDENT statement to return the error, when this was the case, but it didn't. Of course, when I tried to insert a new record, I got the violation error, which I expected. I was expecting the DBCC CHECKIDENT to return some kind of error or warning, but it didn't. Just checking to make sure that IS how it's supposed to work. Susan H. From Elizabeth.J.Doering at wellsfargo.com Wed May 28 16:38:53 2008 From: Elizabeth.J.Doering at wellsfargo.com (Elizabeth.J.Doering at wellsfargo.com) Date: Wed, 28 May 2008 16:38:53 -0500 Subject: [dba-SQLServer] Encryption & SQL Server 2005 Message-ID: Dear List, This ought to be simple: I have 90000+ records in a table called CallerAccount. There's also an identity primary key, CallerAccountID, and a foreign key CallerID which links to the rest of the information about our caller. Not surprisingly, I need to search for records in the table pertaining to one account. This may actually span several calls, and several callers, and many days, so there may be several entries with the same account number. If I were searching cleartext account numbers, this would be a piece of cake: Select * from CallerAccount where AccountNumber = '1234567890'. Sadly, I am not searching cleartext account numbers. AccountNumber is a sensitive piece of data around here, so it is necessary that it be encrypted, hence the table also contains a field EAccountNumber, containing the binary encrypted value for AccountNumber. I could decrypt all the account numbers in the table, write them to a new field and search that. But since 90000+ records is only the very beginning of this table, it seemed like it OUGHT to be more sensible to encrypt the one account number that I know, using the same certificate and key that I have used on the whole table, then search for the matching encrypted value. To make this easy, I wrote the encrypted value out to another table. Then, I thought, I could arrive at the records I am interested in with a join like this: SELECT CallerAccount.CallerID, CallerAccount.EAccountNumber FROM CallerAccount INNER JOIN tempAccount ON CallerAccount.EAccountNumber = tempAccount.tempEAccountNumber Apparently however, the same data encrypted with the same certificate and the same key does not actually turn out to the same binary value twice. It's taken me all afternoon to arrive, kicking and screaming, at this conclusion, but I suppose it makes sense. So I'm at a standstill, back at decrypting all the records in the table before searching. Do any of you have any advice, workarounds, wisdom or comfort for me? Thanks, Liz Liz Doering elizabeth.j.doering at wellsfargo.com 612.667.2447 This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From fhtapia at gmail.com Wed May 28 17:48:44 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 28 May 2008 15:48:44 -0700 Subject: [dba-SQLServer] Encryption & SQL Server 2005 In-Reply-To: References: Message-ID: This is a puzzler, a while back I had to create a system that would encrypt credit card numbers, but I had chosen an outside algorithm so I was not using the MS encryption routines. This provided me with two choices for encrypted data, one where it was all hexidecimal and I was able to easily use the searched id encrypted in my own sipher, then used the results to search the database. I'm going to guess you don't get this luxury, but none the less I wanted to chime in with what I have done in the past. What kind of hardware are you dealing with? -- Francisco On Wed, May 28, 2008 at 2:38 PM, wrote: > Dear List, > > This ought to be simple: > > I have 90000+ records in a table called CallerAccount. There's also an > identity primary key, CallerAccountID, and a foreign key CallerID which > links to the rest of the information about our caller. > > Not surprisingly, I need to search for records in the table pertaining > to one account. This may actually span several calls, and several > callers, and many days, so there may be several entries with the same > account number. > > If I were searching cleartext account numbers, this would be a piece of > cake: Select * from CallerAccount where AccountNumber = '1234567890'. > > Sadly, I am not searching cleartext account numbers. AccountNumber is a > sensitive piece of data around here, so it is necessary that it be > encrypted, hence the table also contains a field EAccountNumber, > containing the binary encrypted value for AccountNumber. > > I could decrypt all the account numbers in the table, write them to a > new field and search that. But since 90000+ records is only the very > beginning of this table, it seemed like it OUGHT to be more sensible to > encrypt the one account number that I know, using the same certificate > and key that I have used on the whole table, then search for the > matching encrypted value. To make this easy, I wrote the encrypted > value out to another table. Then, I thought, I could arrive at the > records I am interested in with a join like this: > > SELECT CallerAccount.CallerID, > CallerAccount.EAccountNumber > FROM CallerAccount INNER JOIN > tempAccount ON > CallerAccount.EAccountNumber = tempAccount.tempEAccountNumber > > Apparently however, the same data encrypted with the same certificate > and the same key does not actually turn out to the same binary value > twice. It's taken me all afternoon to arrive, kicking and screaming, at > this conclusion, but I suppose it makes sense. So I'm at a standstill, > back at decrypting all the records in the table before searching. > > Do any of you have any advice, workarounds, wisdom or comfort for me? > > Thanks, > > > Liz > > > Liz Doering > elizabeth.j.doering at wellsfargo.com > > 612.667.2447 > > This message may contain confidential and/or privileged information. If > you are not the addressee or authorized to receive this for the > addressee, you must not use, copy, disclose, or take any action based on > this message or any information herein. If you have received this > message in error, please advise the sender immediately by reply e-mail > and delete this message. Thank you for your cooperation. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From Gustav at cactus.dk Thu May 29 04:26:05 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 29 May 2008 11:26:05 +0200 Subject: [dba-SQLServer] How to Import 16 Billion Rows into a Single Table Message-ID: Hi all This is described in the current issue of SQL Server Magazine: http://sqlmag-pwf.texterity.com/sqlmag/200806/?sub_id=D3TX03joiTtMl Locate in the menu: Reader-To-Reader. Adventure with big data. Some good advice on indexing and sorting. /gustav From paul.hartland at googlemail.com Fri May 30 09:25:22 2008 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 30 May 2008 15:25:22 +0100 Subject: [dba-SQLServer] Get A Value From A Table & Use In Stored Procedure Message-ID: <38c884770805300725m658abe3bp4e8946351a3c2b63@mail.gmail.com> To all, I have never really dealt with cursors etc as yet in SQL Server, but from what I have had a quick read of you can use a cursor as a type of recordset (please correct me if I am wrong). I have a table called tblParameters in which has two fields ParameterName & ParameterValue, one of the parameter names is EXPIRY_MONTHS. I have an update procedure called mysp_update_expirydate which is similar to the following: mysp_update_expirydate @intValue [int] AS BEGIN SET NOCOUNT ON UPDATE dbo.MyTable SET ExpiryDate=DATEADD(month, at intValue,GETDATE()) WHERE MyCriteria SET NOCOUNT OFF END I am using Visual Basic 6.0 using a recordset to get the value from tblParameters, then execute the store procedure passing it the value from my recordset. What I need to do if possible (and would be grateful of some sample code if possible) is instead of the parameter @intValue get the value from tblParameters inside the stored procedure ? Has anyone done this or similar before and can point me in the right direction please. Thank you in advance for any help on this... -- Paul Hartland paul.hartland at googlemail.com From jwcolby at colbyconsulting.com Fri May 30 09:37:20 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 May 2008 10:37:20 -0400 Subject: [dba-SQLServer] How to Import 16 Billion Rows into a Single Table In-Reply-To: References: Message-ID: <48401120.7070704@colbyconsulting.com> I have exceeded my accepted usage of this magazine. (protected site). ;-) John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > This is described in the current issue of SQL Server Magazine: > > http://sqlmag-pwf.texterity.com/sqlmag/200806/?sub_id=D3TX03joiTtMl > > Locate in the menu: > Reader-To-Reader. Adventure with big data. > > Some good advice on indexing and sorting. > > /gustav > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From ridermark at gmail.com Fri May 30 09:46:38 2008 From: ridermark at gmail.com (Mark Rider) Date: Fri, 30 May 2008 09:46:38 -0500 Subject: [dba-SQLServer] How to Import 16 Billion Rows into a Single Table In-Reply-To: <48401120.7070704@colbyconsulting.com> References: <48401120.7070704@colbyconsulting.com> Message-ID: Looks like we all have - I get the same error page. -- Mark Rider http://commonsensesecurity.info If you're not part of the solution, you're part of the precipitate. - Henry J. Tillman On Fri, May 30, 2008 at 9:37 AM, jwcolby wrote: > I have exceeded my accepted usage of this magazine. From fuller.artful at gmail.com Fri May 30 09:49:40 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 30 May 2008 10:49:40 -0400 Subject: [dba-SQLServer] Get A Value From A Table & Use In Stored Procedure In-Reply-To: <38c884770805300725m658abe3bp4e8946351a3c2b63@mail.gmail.com> References: <38c884770805300725m658abe3bp4e8946351a3c2b63@mail.gmail.com> Message-ID: <29f585dd0805300749p520aa07dg756ab9d7bf085036@mail.gmail.com> Declare the variable inside the sproc and use a simple SELECT statement to set its value, then plug it into the DateAdd() expression. hth, Arthur On 5/30/08, Paul Hartland wrote: > > To all, > > I have never really dealt with cursors etc as yet in SQL Server, but from > what I have had a quick read of you can use a cursor as a type of recordset > (please correct me if I am wrong). > > I have a table called tblParameters in which has two fields ParameterName & > ParameterValue, one of the parameter names is EXPIRY_MONTHS. I have an > update procedure called mysp_update_expirydate which is similar to the > following: > > mysp_update_expirydate > @intValue [int] > AS > BEGIN > SET NOCOUNT ON > UPDATE dbo.MyTable > SET ExpiryDate=DATEADD(month, at intValue,GETDATE()) > WHERE MyCriteria > SET NOCOUNT OFF > END > > I am using Visual Basic 6.0 using a recordset to get the value from > tblParameters, then execute the store procedure passing it the value from > my > recordset. > > What I need to do if possible (and would be grateful of some sample code if > possible) is instead of the parameter @intValue get the value from > tblParameters inside the stored procedure ? > > Has anyone done this or similar before and can point me in the right > direction please. > > Thank you 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 Gustav at cactus.dk Fri May 30 12:15:34 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 19:15:34 +0200 Subject: [dba-SQLServer] How to Import 16 Billion Rows into a Single Table Message-ID: Hi all Works here, but I subscribe (for free). How about this link: http://sqlmag-pwf.texterity.com/sqlmag/200806/ /gustav >>> ridermark at gmail.com 30-05-2008 16:46 >>> Looks like we all have - I get the same error page. -- Mark Rider http://commonsensesecurity.info If you're not part of the solution, you're part of the precipitate. - Henry J. Tillman On Fri, May 30, 2008 at 9:37 AM, jwcolby wrote: > I have exceeded my accepted usage of this magazine. From jwcolby at colbyconsulting.com Fri May 30 12:26:38 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 May 2008 13:26:38 -0400 Subject: [dba-SQLServer] How to Import 16 Billion Rows into a Single Table In-Reply-To: References: Message-ID: <484038CE.8010801@colbyconsulting.com> Nope, same error. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > Works here, but I subscribe (for free). > How about this link: > > http://sqlmag-pwf.texterity.com/sqlmag/200806/ > > /gustav > >>>> ridermark at gmail.com 30-05-2008 16:46 >>> > Looks like we all have - I get the same error page. > From Gustav at cactus.dk Fri May 30 12:49:10 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 19:49:10 +0200 Subject: [dba-SQLServer] How to Import 16 Billion Rows into a Single Table Message-ID: Hi all One more try: http://sqlmag-pwf.texterity.com/sqlmag/200806/?pg=1&pm=1&u1=friend&sub_id=BH31Nq3vIAoUq /gustav >>> Gustav at cactus.dk 30-05-2008 19:15 >>> Hi all Works here, but I subscribe (for free). How about this link: http://sqlmag-pwf.texterity.com/sqlmag/200806/ /gustav >>> ridermark at gmail.com 30-05-2008 16:46 >>> Looks like we all have - I get the same error page. -- Mark Rider http://commonsensesecurity.info If you're not part of the solution, you're part of the precipitate. - Henry J. Tillman On Fri, May 30, 2008 at 9:37 AM, jwcolby wrote: > I have exceeded my accepted usage of this magazine. _______________________________________________ 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 May 30 12:56:53 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 May 2008 13:56:53 -0400 Subject: [dba-SQLServer] How to Import 16 Billion Rows into a Single Table In-Reply-To: References: Message-ID: <48403FE5.7040305@colbyconsulting.com> Well I can now see something, but clicking on any of the hotlinks goes nowhere. That could be a firefox vs IE issue though. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > One more try: > > http://sqlmag-pwf.texterity.com/sqlmag/200806/?pg=1&pm=1&u1=friend&sub_id=BH31Nq3vIAoUq > > /gustav > >>>> Gustav at cactus.dk 30-05-2008 19:15 >>> > Hi all > > Works here, but I subscribe (for free). > How about this link: > > http://sqlmag-pwf.texterity.com/sqlmag/200806/ > > /gustav > >>>> ridermark at gmail.com 30-05-2008 16:46 >>> > Looks like we all have - I get the same error page. > From fuller.artful at gmail.com Fri May 30 13:48:27 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 30 May 2008 14:48:27 -0400 Subject: [dba-SQLServer] Momentary Adieu Message-ID: <29f585dd0805301148n77b50202u5f91d5bbfcd27db5@mail.gmail.com> Sorry for the Cross-post, but I wanted to ensure that I touch all my friends on these lists. On Sunday morning I am moving to Bermuda to take a job as a SQL developer. It's a dream job and the money is excellent and the people are all really smart and the dress-code is very casual (tee shirt and shorts and sandals), and there is neither snow nor taxes. Where's the down side? So, consider this official notice of the creation of the Bermuda chapter of our group. My email will remain the same, so I won't lose touch, but it may take me a few days to get the Internet etc. installed. But fair warning, I'll be back in your faces within a few days. And we could always plan an dbAdvisor's conference in Bermuda, although the hotel prices are rather steep. Arthur From jwcolby at colbyconsulting.com Fri May 30 13:49:34 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 May 2008 14:49:34 -0400 Subject: [dba-SQLServer] How to Import 16 Billion Rows into a Single Table In-Reply-To: References: Message-ID: <48404C3E.5020907@colbyconsulting.com> ROTFLMAO! That sounds like me!!! "28 hours later I ran out of disk and 24 hours later the roll back completed". 8-)) It is good to know I am not the only one out there with these kinds of issues. I have to further laugh at the raw times involved in trying to do all this stuff. Imagine trying to bill the customer $100 / hour. That would buy a nice Mercedez. Gustav, thanks for all the work getting the link figured out. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > One more try: > > http://sqlmag-pwf.texterity.com/sqlmag/200806/?pg=1&pm=1&u1=friend&sub_id=BH31Nq3vIAoUq > > /gustav > >>>> Gustav at cactus.dk 30-05-2008 19:15 >>> > Hi all > > Works here, but I subscribe (for free). > How about this link: > > http://sqlmag-pwf.texterity.com/sqlmag/200806/ > > /gustav > >>>> ridermark at gmail.com 30-05-2008 16:46 >>> > Looks like we all have - I get the same error page. > From davidmcafee at gmail.com Fri May 30 15:58:08 2008 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 30 May 2008 13:58:08 -0700 Subject: [dba-SQLServer] Momentary Adieu In-Reply-To: <29f585dd0805301148n77b50202u5f91d5bbfcd27db5@mail.gmail.com> References: <29f585dd0805301148n77b50202u5f91d5bbfcd27db5@mail.gmail.com> Message-ID: <8786a4c00805301358l5ca68a97y93e3a42320624a91@mail.gmail.com> Arthur, you did get a place with a guest room, right? :) Good luck with your new job! Sounds great! David McAfee On Fri, May 30, 2008 at 11:48 AM, Arthur Fuller wrote: > Sorry for the Cross-post, but I wanted to ensure that I touch all my friends > on these lists. > > On Sunday morning I am moving to Bermuda to take a job as a SQL developer. > It's a dream job and the money is excellent and the people are all really > smart and the dress-code is very casual (tee shirt and shorts and sandals), > and there is neither snow nor taxes. Where's the down side? > > So, consider this official notice of the creation of the Bermuda chapter of > our group. My email will remain the same, so I won't lose touch, but it may > take me a few days to get the Internet etc. installed. But fair warning, > I'll be back in your faces within a few days. > > And we could always plan an dbAdvisor's conference in Bermuda, although the > hotel prices are rather steep. > > Arthur > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From stuart at lexacorp.com.pg Fri May 30 19:36:00 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 31 May 2008 10:36:00 +1000 Subject: [dba-SQLServer] Get A Value From A Table & Use In Stored Procedure In-Reply-To: <38c884770805300725m658abe3bp4e8946351a3c2b63@mail.gmail.com> References: <38c884770805300725m658abe3bp4e8946351a3c2b63@mail.gmail.com> Message-ID: <48412A10.15161.3C519411@stuart.lexacorp.com.pg> mysp_update_expirydate AS BEGIN Declare @IntValue Int Set @Intvalue = (Select ParameterValue from tblParameters where ParameterName = 'EXPIRY_MONTHS') ..... On 30 May 2008 at 15:25, Paul Hartland wrote: > To all, > > I have never really dealt with cursors etc as yet in SQL Server, but from > what I have had a quick read of you can use a cursor as a type of recordset > (please correct me if I am wrong). > > I have a table called tblParameters in which has two fields ParameterName & > ParameterValue, one of the parameter names is EXPIRY_MONTHS. I have an > update procedure called mysp_update_expirydate which is similar to the > following: > > mysp_update_expirydate > @intValue [int] > AS > BEGIN > SET NOCOUNT ON > UPDATE dbo.MyTable > SET ExpiryDate=DATEADD(month, at intValue,GETDATE()) > WHERE MyCriteria > SET NOCOUNT OFF > END > > I am using Visual Basic 6.0 using a recordset to get the value from > tblParameters, then execute the store procedure passing it the value from my > recordset. > > What I need to do if possible (and would be grateful of some sample code if > possible) is instead of the parameter @intValue get the value from > tblParameters inside the stored procedure ? > > Has anyone done this or similar before and can point me in the right > direction please. > > Thank you 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 fuller.artful at gmail.com Fri May 30 23:13:24 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sat, 31 May 2008 00:13:24 -0400 Subject: [dba-SQLServer] Momentary Adieu In-Reply-To: <8786a4c00805301358l5ca68a97y93e3a42320624a91@mail.gmail.com> References: <29f585dd0805301148n77b50202u5f91d5bbfcd27db5@mail.gmail.com> <8786a4c00805301358l5ca68a97y93e3a42320624a91@mail.gmail.com> Message-ID: <29f585dd0805302113n4ef9e56dy30ce390ead16651d@mail.gmail.com> Yup. On 5/30/08, David McAfee wrote: > > Arthur, you did get a place with a guest room, right? :) > > Good luck with your new job! Sounds great! > > David McAfee > From fhtapia at gmail.com Sat May 31 09:24:18 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Sat, 31 May 2008 07:24:18 -0700 Subject: [dba-SQLServer] Momentary Adieu In-Reply-To: <29f585dd0805301148n77b50202u5f91d5bbfcd27db5@mail.gmail.com> References: <29f585dd0805301148n77b50202u5f91d5bbfcd27db5@mail.gmail.com> Message-ID: Arthur, I hope you have an excellent trip! Take care during your relocation, and if you ever need an on-site sql admin/developer be sure to let me know! ;-) On 5/30/08, Arthur Fuller wrote: > Sorry for the Cross-post, but I wanted to ensure that I touch all my friends > on these lists. > > On Sunday morning I am moving to Bermuda to take a job as a SQL developer. > It's a dream job and the money is excellent and the people are all really > smart and the dress-code is very casual (tee shirt and shorts and sandals), > and there is neither snow nor taxes. Where's the down side? > > So, consider this official notice of the creation of the Bermuda chapter of > our group. My email will remain the same, so I won't lose touch, but it may > take me a few days to get the Internet etc. installed. But fair warning, > I'll be back in your faces within a few days. > > And we could always plan an dbAdvisor's conference in Bermuda, although the > hotel prices are rather steep. > > Arthur > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Sent from Gmail for mobile | mobile.google.com -Francisco http://sqlthis.blogspot.com | Tsql and More... From fuller.artful at gmail.com Sat May 31 10:45:29 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sat, 31 May 2008 11:45:29 -0400 Subject: [dba-SQLServer] Momentary Adieu In-Reply-To: References: <29f585dd0805301148n77b50202u5f91d5bbfcd27db5@mail.gmail.com> Message-ID: <29f585dd0805310845y7561991at422b73cb21e5688d@mail.gmail.com> You'll be first I call, Francisco. To hell with all these other losers on this list LOL. Thanks to the net, I won't be far. In fact I'll actually be closer. The company has a T3 connection, so I shall be right in your face, almost. Thanks for the good wishes, Francisco, and if you feel the need for a vacation, you'll be most welcome to come visit. Arthur On 5/31/08, Francisco Tapia wrote: > > Arthur, > I hope you have an excellent trip! Take care during your > relocation, and if you ever need an on-site sql admin/developer be > sure to let me know! ;-) >