From jwcolby at colbyconsulting.com Sun Jul 1 13:37:50 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 1 Jul 2007 14:37:50 -0400 Subject: [dba-SQLServer] OpenRowset Message-ID: <20070701183759.0C4D0BC6C@smtp-auth.no-ip.com> Guys, I am trying to do the following, straight in a query window in SQL Server 2005: SELECT * FROM OpenRowset('MSDASQL','Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=C:\aTestFTP\;','select * from Infutor1.txt') I get the following error: OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.". Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)". So what did I do wrong this time? ;-) John W. Colby Colby Consulting www.ColbyConsulting.com From fuller.artful at gmail.com Sun Jul 1 14:08:04 2007 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 1 Jul 2007 15:08:04 -0400 Subject: [dba-SQLServer] OpenRowset In-Reply-To: <20070701183759.0C4D0BC6C@smtp-auth.no-ip.com> References: <20070701183759.0C4D0BC6C@smtp-auth.no-ip.com> Message-ID: <29f585dd0707011208i6cd46749g45fd0932e5a76155@mail.gmail.com> I'm not sure, JC. But perhaps this might help. It's another approach: Using the OPENROWSET BULK provider with a format file to retrieve rows from a text file Using the OPENROWSET BULK provider with a format file to retrieve rows from a text file The following example uses a format file to retrieve rows from a tab-delimited text file, values.txt that contains the following data: 1 Data Item 1 2 Data Item 2 3 Data Item 3 The format file, values.fmt, describes the columns in values.txt: 9.0 2 1 SQLCHAR 0 10 "\t" 1 ID SQL_Latin1_General_Cp437_BIN 2 SQLCHAR 0 40 "\r\n" 2 Description SQL_Latin1_General_Cp437_BIN This is the query that retrieves that data: SELECT a.* FROM OPENROWSET( BULK 'c:\test\values.txt', FORMATFILE = 'c:\test\values.fmt') AS a; ... which of course demands a format file. I'm not sure what the 9.0 means. The 2 means column count. The "\t" means tab, I think, and the "\r\n" means return + newline. For more info on using format files, see ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/2956df78- 833f-45fa-8a10-41d6522562b9.htm. hth, Arthur On 7/1/07, jwcolby wrote: > > Guys, > > I am trying to do the following, straight in a query window in SQL Server > 2005: > > SELECT * FROM > OpenRowset('MSDASQL','Driver={Microsoft Text Driver (*.txt; > *.csv)};DefaultDir=C:\aTestFTP\;','select * from Infutor1.txt') > > I get the following error: > > OLE DB provider "MSDASQL" for linked server "(null)" returned message > "[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure > that the path name is spelled correctly and that you are connected to the > server on which the file resides.". > Msg 7303, Level 16, State 1, Line 1 > Cannot initialize the data source object of OLE DB provider "MSDASQL" for > linked server "(null)". > > So what did I do wrong this time? ;-) > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From martyconnelly at shaw.ca Sun Jul 1 15:44:58 2007 From: martyconnelly at shaw.ca (MartyConnelly) Date: Sun, 01 Jul 2007 13:44:58 -0700 Subject: [dba-SQLServer] OpenRowset In-Reply-To: <20070701183759.0C4D0BC6C@smtp-auth.no-ip.com> References: <20070701183759.0C4D0BC6C@smtp-auth.no-ip.com> Message-ID: <4688124A.3090003@shaw.ca> Database Engine Architect InfoCenter http://msdn2.microsoft.com/en-us/library/ms175560/(SQL.90/).aspx then to About Bulk Import and Bulk Export Operations http://msdn2.microsoft.com/en-us/library/ms187042.aspx SQL Server 2005 Books Online OPENROWSET (Transact-SQL) Way at bottom text file import examples http://msdn2.microsoft.com/en-us/library/ms190312.aspx jwcolby wrote: >Guys, > >I am trying to do the following, straight in a query window in SQL Server >2005: > >SELECT * FROM >OpenRowset('MSDASQL','Driver={Microsoft Text Driver (*.txt; >*.csv)};DefaultDir=C:\aTestFTP\;','select * from Infutor1.txt') > >I get the following error: > >OLE DB provider "MSDASQL" for linked server "(null)" returned message >"[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure >that the path name is spelled correctly and that you are connected to the >server on which the file resides.". >Msg 7303, Level 16, State 1, Line 1 >Cannot initialize the data source object of OLE DB provider "MSDASQL" for >linked server "(null)". > >So what did I do wrong this time? ;-) > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > > > > -- Marty Connelly Victoria, B.C. Canada From jwcolby at colbyconsulting.com Sun Jul 1 20:12:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 1 Jul 2007 21:12:23 -0400 Subject: [dba-SQLServer] OpenRowset In-Reply-To: <4688124A.3090003@shaw.ca> Message-ID: <20070702011232.C2EFFBC07@smtp-auth.no-ip.com> Marty, Been there, looked at that, no workee. Thanks anyway. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of MartyConnelly Sent: Sunday, July 01, 2007 4:45 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] OpenRowset Database Engine Architect InfoCenter http://msdn2.microsoft.com/en-us/library/ms175560/(SQL.90/).aspx then to About Bulk Import and Bulk Export Operations http://msdn2.microsoft.com/en-us/library/ms187042.aspx SQL Server 2005 Books Online OPENROWSET (Transact-SQL) Way at bottom text file import examples http://msdn2.microsoft.com/en-us/library/ms190312.aspx jwcolby wrote: >Guys, > >I am trying to do the following, straight in a query window in SQL >Server >2005: > >SELECT * FROM >OpenRowset('MSDASQL','Driver={Microsoft Text Driver (*.txt; >*.csv)};DefaultDir=C:\aTestFTP\;','select * from Infutor1.txt') > >I get the following error: > >OLE DB provider "MSDASQL" for linked server "(null)" returned message >"[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make >sure that the path name is spelled correctly and that you are connected >to the server on which the file resides.". >Msg 7303, Level 16, State 1, Line 1 >Cannot initialize the data source object of OLE DB provider "MSDASQL" >for linked server "(null)". > >So what did I do wrong this time? ;-) > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > > > > -- Marty Connelly Victoria, B.C. Canada _______________________________________________ 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 Jul 2 07:59:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 2 Jul 2007 08:59:37 -0400 Subject: [dba-SQLServer] (no subject) Message-ID: <20070702125948.4F905BF56@smtp-auth.no-ip.com> Folks, I am trying to import (through the wizard) a file path into a field in SQL Server and am getting the following error. This is literally one of the strings: \\Stonehenge\PSM\Data\infutor\CSVExport\Infutor1.txt . The error message indicates that SQL Server doesn't like the \ or . character. Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "FileSpec" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard) Any idea how to make this OK with SQL Server? John W. Colby Colby Consulting www.ColbyConsulting.com From fuller.artful at gmail.com Mon Jul 2 09:06:46 2007 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 2 Jul 2007 10:06:46 -0400 Subject: [dba-SQLServer] (no subject) In-Reply-To: <20070702125948.4F905BF56@smtp-auth.no-ip.com> References: <20070702125948.4F905BF56@smtp-auth.no-ip.com> Message-ID: <29f585dd0707020706w3a8cd8d9v2a0440a3229d1487@mail.gmail.com> Wrap it in single quotes. I think that should do it. On 7/2/07, jwcolby wrote: > > Folks, > > I am trying to import (through the wizard) a file path into a field in SQL > Server and am getting the following error. This is literally one of the > strings: \\Stonehenge\PSM\Data\infutor\CSVExport\Infutor1.txt . The error > message indicates that SQL Server doesn't like the \ or . character. > > Error 0xc02020a1: Data Flow Task: Data conversion failed. The data > conversion for column "FileSpec" returned status value 4 and status text > "Text was truncated or one or more characters had no match in the target > code page.". > (SQL Server Import and Export Wizard) > > Any idea how to make this OK with SQL Server? > > John W. Colby > Colby Consulting > www.ColbyConsulting.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 Mon Jul 2 09:23:57 2007 From: ebarro at verizon.net (Eric Barro) Date: Mon, 02 Jul 2007 07:23:57 -0700 Subject: [dba-SQLServer] (no subject) In-Reply-To: <20070702125948.4F905BF56@smtp-auth.no-ip.com> Message-ID: <0JKK00KI72O2T4N8@vms046.mailsrvcs.net> John, I think you asked this question before... My recommendation is to assign the command to a variable and re-write it like this... SET @sql ='BULK INSERT YoueTable FROM ' + CHAR(39) + @DataFileName + CHAR(39) ...and then run the command like this... EXEC (@sql) Eric -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 02, 2007 6:00 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] (no subject) Folks, I am trying to import (through the wizard) a file path into a field in SQL Server and am getting the following error. This is literally one of the strings: \\Stonehenge\PSM\Data\infutor\CSVExport\Infutor1.txt . The error message indicates that SQL Server doesn't like the \ or . character. Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "FileSpec" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard) Any idea how to make this OK with SQL Server? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.9.14/883 - Release Date: 7/1/2007 12:19 PM From rl_stewart at highstream.net Mon Jul 2 09:46:04 2007 From: rl_stewart at highstream.net (Robert) Date: Mon, 02 Jul 2007 09:46:04 -0500 Subject: [dba-SQLServer] 64 bit MYSql on 64 bit linux In-Reply-To: References: Message-ID: <200707021451.l62EpEU0002634@databaseadvisors.com> John, I would suggest getting an MSDN subscription, 2800 for 2 years. It includes all versions of the software. Since you are using the at "home," there really is not a licensing issue with them. Technically, they are for use in a development environment only. Robert At 12:00 PM 6/30/2007, you wrote: >Date: Fri, 29 Jun 2007 16:45:02 -0400 >From: "jwcolby" >Subject: [dba-SQLServer] 64 bit MYSql on 64 bit linux >To: "'Access Developers discussion and problem solving'" > , "'Discussion of > Hardware and Software > issues'" , > >Message-ID: <20070629204507.1CB9EBF80 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Is anyone using 64 bit database / OS software? My databases are so large >that having 2 mb memory constraints are killing me (gut feeling here). But >once I start looking at x64 versions of Windows Server and in particular x64 >versions of SQL Server the prices skyrocket. I will be paying more for the >licenses for those two things (for EACH processor chip) than I will for the >entire machine hardware, and it is pretty heavy duty hardware. > >Thus I need to at least examine Linux / MySQL assuming that I can get 64 bit >versions. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Jul 2 12:25:06 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 2 Jul 2007 13:25:06 -0400 Subject: [dba-SQLServer] OpenRowset In-Reply-To: <29f585dd0707011208i6cd46749g45fd0932e5a76155@mail.gmail.com> Message-ID: <20070702172517.5E9EABE59@smtp-auth.no-ip.com> Thanks for the reply Arthur. Unfortunately I am working on importing files where the content is not known to me, thus knowing the format just doesn't really work long term. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Sunday, July 01, 2007 3:08 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] OpenRowset I'm not sure, JC. But perhaps this might help. It's another approach: Using the OPENROWSET BULK provider with a format file to retrieve rows from a text file Using the OPENROWSET BULK provider with a format file to retrieve rows from a text file The following example uses a format file to retrieve rows from a tab-delimited text file, values.txt that contains the following data: 1 Data Item 1 2 Data Item 2 3 Data Item 3 The format file, values.fmt, describes the columns in values.txt: 9.0 2 1 SQLCHAR 0 10 "\t" 1 ID SQL_Latin1_General_Cp437_BIN 2 SQLCHAR 0 40 "\r\n" 2 Description SQL_Latin1_General_Cp437_BIN This is the query that retrieves that data: SELECT a.* FROM OPENROWSET( BULK 'c:\test\values.txt', FORMATFILE = 'c:\test\values.fmt') AS a; ... which of course demands a format file. I'm not sure what the 9.0 means. The 2 means column count. The "\t" means tab, I think, and the "\r\n" means return + newline. For more info on using format files, see ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/2956df78- 833f-45fa-8a10-41d6522562b9.htm. hth, Arthur On 7/1/07, jwcolby wrote: > > Guys, > > I am trying to do the following, straight in a query window in SQL > Server > 2005: > > SELECT * FROM > OpenRowset('MSDASQL','Driver={Microsoft Text Driver (*.txt; > *.csv)};DefaultDir=C:\aTestFTP\;','select * from Infutor1.txt') > > I get the following error: > > OLE DB provider "MSDASQL" for linked server "(null)" returned message > "[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make > sure that the path name is spelled correctly and that you are > connected to the server on which the file resides.". > Msg 7303, Level 16, State 1, Line 1 > Cannot initialize the data source object of OLE DB provider "MSDASQL" > for linked server "(null)". > > So what did I do wrong this time? ;-) > > John W. Colby > Colby Consulting > 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 rl_stewart at highstream.net Mon Jul 2 13:50:12 2007 From: rl_stewart at highstream.net (Robert) Date: Mon, 02 Jul 2007 13:50:12 -0500 Subject: [dba-SQLServer] OpenRowset In-Reply-To: References: Message-ID: <200707021851.l62IpCC4031964@databaseadvisors.com> John, From the linked server "null" returned, I would guess that you did not have a linked server defined for the file you are looking for. Robert At 12:00 PM 7/2/2007, you wrote: >Date: Sun, 1 Jul 2007 14:37:50 -0400 >From: "jwcolby" >Subject: [dba-SQLServer] OpenRowset >To: >Message-ID: <20070701183759.0C4D0BC6C at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Guys, > >I am trying to do the following, straight in a query window in SQL Server >2005: > >SELECT * FROM >OpenRowset('MSDASQL','Driver={Microsoft Text Driver (*.txt; >*.csv)};DefaultDir=C:\aTestFTP\;','select * from Infutor1.txt') > >I get the following error: > >OLE DB provider "MSDASQL" for linked server "(null)" returned message >"[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure >that the path name is spelled correctly and that you are connected to the >server on which the file resides.". >Msg 7303, Level 16, State 1, Line 1 >Cannot initialize the data source object of OLE DB provider "MSDASQL" for >linked server "(null)". > >So what did I do wrong this time? ;-) From accessd at shaw.ca Mon Jul 2 14:02:28 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 02 Jul 2007 12:02:28 -0700 Subject: [dba-SQLServer] (no subject) In-Reply-To: <20070702125948.4F905BF56@smtp-auth.no-ip.com> Message-ID: <0JKK00C4VFCJPJL0@l-daemon> Hi John: What happens when you remove the extension and period? Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 02, 2007 6:00 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] (no subject) Folks, I am trying to import (through the wizard) a file path into a field in SQL Server and am getting the following error. This is literally one of the strings: \\Stonehenge\PSM\Data\infutor\CSVExport\Infutor1.txt . The error message indicates that SQL Server doesn't like the \ or . character. Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "FileSpec" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard) Any idea how to make this OK with SQL Server? John W. Colby Colby Consulting 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 Jul 2 14:42:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 2 Jul 2007 15:42:15 -0400 Subject: [dba-SQLServer] OpenRowset In-Reply-To: <200707021851.l62IpCC4031964@databaseadvisors.com> Message-ID: <20070702194226.6EDB3BD56@smtp-auth.no-ip.com> I would take it you are right. The file is just a (CSV) file. It is on a mapped drive. What is this "linked server" and why do I need one to open a file? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Monday, July 02, 2007 2:50 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] OpenRowset John, From the linked server "null" returned, I would guess that you did not have a linked server defined for the file you are looking for. Robert At 12:00 PM 7/2/2007, you wrote: >Date: Sun, 1 Jul 2007 14:37:50 -0400 >From: "jwcolby" >Subject: [dba-SQLServer] OpenRowset >To: >Message-ID: <20070701183759.0C4D0BC6C at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Guys, > >I am trying to do the following, straight in a query window in SQL >Server >2005: > >SELECT * FROM >OpenRowset('MSDASQL','Driver={Microsoft Text Driver (*.txt; >*.csv)};DefaultDir=C:\aTestFTP\;','select * from Infutor1.txt') > >I get the following error: > >OLE DB provider "MSDASQL" for linked server "(null)" returned message >"[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make >sure that the path name is spelled correctly and that you are connected >to the server on which the file resides.". >Msg 7303, Level 16, State 1, Line 1 >Cannot initialize the data source object of OLE DB provider "MSDASQL" >for linked server "(null)". > >So what did I do wrong this time? ;-) _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at setel.com Mon Jul 2 15:10:21 2007 From: ssharkins at setel.com (Susan Harkins) Date: Mon, 2 Jul 2007 16:10:21 -0400 Subject: [dba-SQLServer] OpenRowset In-Reply-To: <20070702194226.6EDB3BD56@smtp-auth.no-ip.com> References: <200707021851.l62IpCC4031964@databaseadvisors.com> <20070702194226.6EDB3BD56@smtp-auth.no-ip.com> Message-ID: <005f01c7bce5$07949860$93b62ad1@SusanOne> John, a linked server is a permanent connection that's always open if the database is "open." I just wrote about it for TR. I can send you the article if you like. Susan H. I would take it you are right. The file is just a (CSV) file. It is on a mapped drive. What is this "linked server" and why do I need one to open a file? From jwcolby at colbyconsulting.com Mon Jul 2 20:20:40 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 2 Jul 2007 21:20:40 -0400 Subject: [dba-SQLServer] OpenRowset In-Reply-To: <005f01c7bce5$07949860$93b62ad1@SusanOne> Message-ID: <20070703012052.C0E27BC87@smtp-auth.no-ip.com> Sure. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Monday, July 02, 2007 4:10 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] OpenRowset John, a linked server is a permanent connection that's always open if the database is "open." I just wrote about it for TR. I can send you the article if you like. Susan H. I would take it you are right. The file is just a (CSV) file. It is on a mapped drive. What is this "linked server" and why do I need one to open a file? _______________________________________________ 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 Jul 3 08:03:10 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 3 Jul 2007 09:03:10 -0400 Subject: [dba-SQLServer] (no subject) In-Reply-To: <0JKK00KI72O2T4N8@vms046.mailsrvcs.net> Message-ID: <20070703130322.EAE25BD43@smtp-auth.no-ip.com> Eric, >I think you asked this question before... No, in fact this is a different situation. I am trying to load a (CSV, kind of) text file into a table. Inside of that text file there is a filespec column. THAT COLUMN is being barfed on when SQL Server tries to import it. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Monday, July 02, 2007 10:24 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] (no subject) John, I think you asked this question before... My recommendation is to assign the command to a variable and re-write it like this... SET @sql ='BULK INSERT YoueTable FROM ' + CHAR(39) + @DataFileName + CHAR(39) ...and then run the command like this... EXEC (@sql) Eric -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 02, 2007 6:00 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] (no subject) Folks, I am trying to import (through the wizard) a file path into a field in SQL Server and am getting the following error. This is literally one of the strings: \\Stonehenge\PSM\Data\infutor\CSVExport\Infutor1.txt . The error message indicates that SQL Server doesn't like the \ or . character. Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "FileSpec" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard) Any idea how to make this OK with SQL Server? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.9.14/883 - Release Date: 7/1/2007 12:19 PM _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From rl_stewart at highstream.net Tue Jul 3 12:19:01 2007 From: rl_stewart at highstream.net (Robert) Date: Tue, 03 Jul 2007 12:19:01 -0500 Subject: [dba-SQLServer] OpenRowset In-Reply-To: References: Message-ID: <200707031724.l63HO1Eu001982@databaseadvisors.com> The openrowset is for linked servers. Think of it as the same as linking an entire database at once in Access. If you go to server object in the object browser, you will see linked servers. You can use the text oledb or (I think odbc drivers to link the text file from there. Robert At 12:00 PM 7/3/2007, you wrote: >Date: Mon, 2 Jul 2007 15:42:15 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] OpenRowset >To: >Message-ID: <20070702194226.6EDB3BD56 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >I would take it you are right. The file is just a (CSV) file. It is on a >mapped drive. What is this "linked server" and why do I need one to open a >file? > > >John W. Colby From nick at frasiervan.com Tue Jul 3 21:14:02 2007 From: nick at frasiervan.com (Nick) Date: Tue, 3 Jul 2007 21:14:02 -0500 Subject: [dba-SQLServer] (no subject) In-Reply-To: <20070703130322.EAE25BD43@smtp-auth.no-ip.com> References: <0JKK00KI72O2T4N8@vms046.mailsrvcs.net> <20070703130322.EAE25BD43@smtp-auth.no-ip.com> Message-ID: <008b01c7bde1$0056ac80$6700a8c0@NickLaptop> If you are using SQL Server 2000 and DTS, you can try attaching an activex vbscript to handle the "//" which is probably causing the problem as it's a double escape character. Check these articles. http://msdn2.microsoft.com/en-us/library/aa933488(SQL.80).aspx http://msdn2.microsoft.com/en-us/library/aa933459(SQL.80).aspx Inside the wizard it might offer an option to modify the import specs for certain field mappings in the same way, but I'd need to check against which version of SQL Server, it's different depending on if you are using EM or SQL Management Studio. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 03, 2007 8:03 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] (no subject) Eric, >I think you asked this question before... No, in fact this is a different situation. I am trying to load a (CSV, kind of) text file into a table. Inside of that text file there is a filespec column. THAT COLUMN is being barfed on when SQL Server tries to import it. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Monday, July 02, 2007 10:24 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] (no subject) John, I think you asked this question before... My recommendation is to assign the command to a variable and re-write it like this... SET @sql ='BULK INSERT YoueTable FROM ' + CHAR(39) + @DataFileName + CHAR(39) ...and then run the command like this... EXEC (@sql) Eric -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 02, 2007 6:00 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] (no subject) Folks, I am trying to import (through the wizard) a file path into a field in SQL Server and am getting the following error. This is literally one of the strings: \\Stonehenge\PSM\Data\infutor\CSVExport\Infutor1.txt . The error message indicates that SQL Server doesn't like the \ or . character. Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "FileSpec" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard) Any idea how to make this OK with SQL Server? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.9.14/883 - Release Date: 7/1/2007 12:19 PM _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jlawrenc1 at shaw.ca Thu Jul 5 22:20:59 2007 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Thu, 05 Jul 2007 20:20:59 -0700 Subject: [dba-SQLServer] Isolating matching and related records In-Reply-To: <008b01c7bde1$0056ac80$6700a8c0@NickLaptop> Message-ID: <0JKQ00GVTMF08K30@l-daemon> Hi All: The following question seems like a simple SQL question but I just can not find the appropriate answer at this minute... too many long nights. Given: 1. A table of many records, with each record having a couple fields called {section] and [code]. 2. The content of field [section] has only three possible entries of "A1","B1" and "C1". The contents of field [code] can be any of a variety of codes. 3. There will always be records for group "A1" and "C1" but not always for "B1" What SQL code would find the group where there are no matching "B1" records and delete all the records in the "C1" group An example of data could be; 5 records of [section] = "A1", [code] = "TTR" 4 records of [section] = "B1", [code] = "TTR" 30 records of [section] = "C1", [code] = "TTR" 3 records of [section] = "A1", [code] = "CYR" 47 records of [section] = "C1", [code] = "CYR" 5 records of [section] = "A1", [code] = "PIJ" 4 records of [section] = "B1", [code] = "PIJ" 30 records of [section] = "C1", [code] = "PIJ" After the SQL code was run all 47 records with [section] = "C1' and [code] = "CYR" would be gone. It does not seem like a difficult process but... MTIA Jim From markamatte at hotmail.com Fri Jul 6 07:48:36 2007 From: markamatte at hotmail.com (Mark A Matte) Date: Fri, 06 Jul 2007 12:48:36 +0000 Subject: [dba-SQLServer] Isolating matching and related records In-Reply-To: <0JKQ00GVTMF08K30@l-daemon> Message-ID: Jim, Wrote in access...syntax should be similar. I used a sub query to find ALL Codes for Section B1...then deleted all records where section was C1 and codes where NOT in my subquery. Hope it helps, Mark A. Matte >From: Jim Lawrence >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: [dba-SQLServer] Isolating matching and related records >Date: Thu, 05 Jul 2007 20:20:59 -0700 > >Hi All: > >The following question seems like a simple SQL question but I just can not >find the appropriate answer at this minute... too many long nights. > >Given: > >1. A table of many records, with each record having a couple fields called >{section] and [code]. > >2. The content of field [section] has only three possible entries of >"A1","B1" and "C1". The contents of field [code] can be any of a variety of >codes. > >3. There will always be records for group "A1" and "C1" but not always for >"B1" > >What SQL code would find the group where there are no matching "B1" records >and delete all the records in the "C1" group > >An example of data could be; > >5 records of [section] = "A1", [code] = "TTR" >4 records of [section] = "B1", [code] = "TTR" >30 records of [section] = "C1", [code] = "TTR" >3 records of [section] = "A1", [code] = "CYR" >47 records of [section] = "C1", [code] = "CYR" >5 records of [section] = "A1", [code] = "PIJ" >4 records of [section] = "B1", [code] = "PIJ" >30 records of [section] = "C1", [code] = "PIJ" > >After the SQL code was run all 47 records with [section] = "C1' and [code] >= >"CYR" would be gone. > >It does not seem like a difficult process but... > >MTIA > >Jim > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Local listings, incredible imagery, and driving directions - all in one place! http://maps.live.com/?wip=69&FORM=MGAC01 From markamatte at hotmail.com Fri Jul 6 15:16:18 2007 From: markamatte at hotmail.com (Mark A Matte) Date: Fri, 06 Jul 2007 20:16:18 +0000 Subject: [dba-SQLServer] Isolating matching and related records In-Reply-To: Message-ID: Sorry Jim, Forgot to include SQL...sent to accessD also...Here is the single query approach... **************SQL*************** DELETE tblTest.Section, tblTest.code FROM tblTest WHERE (((tblTest.Section)="C1") AND ((tblTest.code) Not In (SELECT tblTest1.code FROM tblTest AS tblTest1 GROUP BY tblTest1.Section, tblTest1.code HAVING (((tblTest1.Section)="B1"));))); **************SQL*************** >From: "Mark A Matte" >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Isolating matching and related records >Date: Fri, 06 Jul 2007 12:48:36 +0000 > >Jim, > >Wrote in access...syntax should be similar. I used a sub query to find ALL >Codes for Section B1...then deleted all records where section was C1 and >codes where NOT in my subquery. > >Hope it helps, > >Mark A. Matte > > > >From: Jim Lawrence > >Reply-To: dba-sqlserver at databaseadvisors.com > >To: dba-sqlserver at databaseadvisors.com > >Subject: [dba-SQLServer] Isolating matching and related records > >Date: Thu, 05 Jul 2007 20:20:59 -0700 > > > >Hi All: > > > >The following question seems like a simple SQL question but I just can >not > >find the appropriate answer at this minute... too many long nights. > > > >Given: > > > >1. A table of many records, with each record having a couple fields >called > >{section] and [code]. > > > >2. The content of field [section] has only three possible entries of > >"A1","B1" and "C1". The contents of field [code] can be any of a variety >of > >codes. > > > >3. There will always be records for group "A1" and "C1" but not always >for > >"B1" > > > >What SQL code would find the group where there are no matching "B1" >records > >and delete all the records in the "C1" group > > > >An example of data could be; > > > >5 records of [section] = "A1", [code] = "TTR" > >4 records of [section] = "B1", [code] = "TTR" > >30 records of [section] = "C1", [code] = "TTR" > >3 records of [section] = "A1", [code] = "CYR" > >47 records of [section] = "C1", [code] = "CYR" > >5 records of [section] = "A1", [code] = "PIJ" > >4 records of [section] = "B1", [code] = "PIJ" > >30 records of [section] = "C1", [code] = "PIJ" > > > >After the SQL code was run all 47 records with [section] = "C1' and >[code] > >= > >"CYR" would be gone. > > > >It does not seem like a difficult process but... > > > >MTIA > > > >Jim > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > >_________________________________________________________________ >Local listings, incredible imagery, and driving directions - all in one >place! http://maps.live.com/?wip=69&FORM=MGAC01 > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ http://im.live.com/messenger/im/home/?source=hmtextlinkjuly07 From accessd at shaw.ca Sat Jul 7 11:09:17 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 07 Jul 2007 09:09:17 -0700 Subject: [dba-SQLServer] Isolating matching and related records In-Reply-To: Message-ID: <0JKT00IESGNBV5H0@l-daemon> Hi Mark: That looks like the solution. Brilliant, Thanks you very much. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark A Matte Sent: Friday, July 06, 2007 1:16 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Isolating matching and related records Sorry Jim, Forgot to include SQL...sent to accessD also...Here is the single query approach... **************SQL*************** DELETE tblTest.Section, tblTest.code FROM tblTest WHERE (((tblTest.Section)="C1") AND ((tblTest.code) Not In (SELECT tblTest1.code FROM tblTest AS tblTest1 GROUP BY tblTest1.Section, tblTest1.code HAVING (((tblTest1.Section)="B1"));))); **************SQL*************** >From: "Mark A Matte" >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Isolating matching and related records >Date: Fri, 06 Jul 2007 12:48:36 +0000 > >Jim, > >Wrote in access...syntax should be similar. I used a sub query to find ALL >Codes for Section B1...then deleted all records where section was C1 and >codes where NOT in my subquery. > >Hope it helps, > >Mark A. Matte > > > >From: Jim Lawrence > >Reply-To: dba-sqlserver at databaseadvisors.com > >To: dba-sqlserver at databaseadvisors.com > >Subject: [dba-SQLServer] Isolating matching and related records > >Date: Thu, 05 Jul 2007 20:20:59 -0700 > > > >Hi All: > > > >The following question seems like a simple SQL question but I just can >not > >find the appropriate answer at this minute... too many long nights. > > > >Given: > > > >1. A table of many records, with each record having a couple fields >called > >{section] and [code]. > > > >2. The content of field [section] has only three possible entries of > >"A1","B1" and "C1". The contents of field [code] can be any of a variety >of > >codes. > > > >3. There will always be records for group "A1" and "C1" but not always >for > >"B1" > > > >What SQL code would find the group where there are no matching "B1" >records > >and delete all the records in the "C1" group > > > >An example of data could be; > > > >5 records of [section] = "A1", [code] = "TTR" > >4 records of [section] = "B1", [code] = "TTR" > >30 records of [section] = "C1", [code] = "TTR" > >3 records of [section] = "A1", [code] = "CYR" > >47 records of [section] = "C1", [code] = "CYR" > >5 records of [section] = "A1", [code] = "PIJ" > >4 records of [section] = "B1", [code] = "PIJ" > >30 records of [section] = "C1", [code] = "PIJ" > > > >After the SQL code was run all 47 records with [section] = "C1' and >[code] > >= > >"CYR" would be gone. > > > >It does not seem like a difficult process but... > > > >MTIA > > > >Jim > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > >_________________________________________________________________ >Local listings, incredible imagery, and driving directions - all in one >place! http://maps.live.com/?wip=69&FORM=MGAC01 > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ http://im.live.com/messenger/im/home/?source=hmtextlinkjuly07 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From accessd at shaw.ca Sun Jul 8 17:57:30 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 08 Jul 2007 15:57:30 -0700 Subject: [dba-SQLServer] Delete all records of a particular type from a table except for one copy. In-Reply-To: Message-ID: <0JKV00ITGU7JZSK4@l-daemon> Hi All: This is a SQL question. It should be fairly easy but... How would you delete all records from a table with a field set to a specific value, all except one matching record? Given: MyTable has 100 records with field MyCode set to either A, B or C. There just happens, at this time, to be 37 records in the table with field MyCode set to 'C'. Required: A SQL statement that when run deletes all matching records with field MyCode equal to 'C' except for 1 record. (The number of records with field MyCode set to 'C' varies of course.) TIA Jim From ssharkins at setel.com Sun Jul 8 18:07:27 2007 From: ssharkins at setel.com (Susan Harkins) Date: Sun, 8 Jul 2007 19:07:27 -0400 Subject: [dba-SQLServer] Delete all records of a particular type from a table except for one copy. In-Reply-To: <0JKV00ITGU7JZSK4@l-daemon> References: <0JKV00ITGU7JZSK4@l-daemon> Message-ID: <000601c7c1b4$c1d2a4f0$3532fad1@SusanOne> How do you determine "which" record doesn't get deleted -- does it even matter? If not, I'd just temporarily change the MyCode value, run a delete, and then reset the temp Mycode value. Susan H. Required: A SQL statement that when run deletes all matching records with field MyCode equal to 'C' except for 1 record. (The number of records with field MyCode set to 'C' varies of course.) From jlawrenc1 at shaw.ca Sun Jul 8 20:14:47 2007 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Sun, 08 Jul 2007 18:14:47 -0700 Subject: [dba-SQLServer] Delete all records of a particular type from atable except for one copy. In-Reply-To: <000601c7c1b4$c1d2a4f0$3532fad1@SusanOne> Message-ID: <0JKW0060O0KAP2B1@l-daemon> Hi Susan: It may sound funny but I do not care which record is the record left. I was hoping that another step of adding an 'autoNumber' field was not necessary but maybe it is... Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Sunday, July 08, 2007 4:07 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Delete all records of a particular type from atable except for one copy. How do you determine "which" record doesn't get deleted -- does it even matter? If not, I'd just temporarily change the MyCode value, run a delete, and then reset the temp Mycode value. Susan H. Required: A SQL statement that when run deletes all matching records with field MyCode equal to 'C' except for 1 record. (The number of records with field MyCode set to 'C' varies of course.) _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at setel.com Sun Jul 8 20:32:39 2007 From: ssharkins at setel.com (Susan Harkins) Date: Sun, 8 Jul 2007 21:32:39 -0400 Subject: [dba-SQLServer] Delete all records of a particular type from atable except for one copy. In-Reply-To: <0JKW0060O0KAP2B1@l-daemon> References: <000601c7c1b4$c1d2a4f0$3532fad1@SusanOne> <0JKW0060O0KAP2B1@l-daemon> Message-ID: <001501c7c1c9$0e6f7040$93b82ad1@SusanOne> Why would you need an AutoNumber field? Find the records that match MyCode -- grab the top record and change its MyCode value -- run the first query as a delete, reset the top record's MyCode value. Or, count the records and grab the count -1 in your delete -- can you do that? Susan H. It may sound funny but I do not care which record is the record left. I was hoping that another step of adding an 'autoNumber' field was not necessary but maybe it is... From accessd at shaw.ca Sun Jul 8 21:04:33 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 08 Jul 2007 19:04:33 -0700 Subject: [dba-SQLServer] Delete all records of a particular type fromatable except for one copy. In-Reply-To: <001501c7c1c9$0e6f7040$93b82ad1@SusanOne> Message-ID: <0JKW006GU2V9X1F4@l-daemon> Hi Susan: I am not sure what you mean? I was just noting that the simplest way to differentiate records is to have a unique field and an autoNumber field would do... How do you build a piece of SQL code that will use the Count aggregate function to delete records? Please send an example. TIA Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Sunday, July 08, 2007 6:33 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Delete all records of a particular type fromatable except for one copy. Why would you need an AutoNumber field? Find the records that match MyCode -- grab the top record and change its MyCode value -- run the first query as a delete, reset the top record's MyCode value. Or, count the records and grab the count -1 in your delete -- can you do that? Susan H. It may sound funny but I do not care which record is the record left. I was hoping that another step of adding an 'autoNumber' field was not necessary but maybe it is... _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at setel.com Sun Jul 8 21:15:15 2007 From: ssharkins at setel.com (Susan Harkins) Date: Sun, 8 Jul 2007 22:15:15 -0400 Subject: [dba-SQLServer] Delete all records of a particular type fromatable except for one copy. In-Reply-To: <0JKW006GU2V9X1F4@l-daemon> References: <001501c7c1c9$0e6f7040$93b82ad1@SusanOne> <0JKW006GU2V9X1F4@l-daemon> Message-ID: <002001c7c1ce$fdc469c0$93b82ad1@SusanOne> How do you build a piece of SQL code that will use the Count aggregate function to delete records? =========Not sure you can. That's why I asked. :) I was just thinking -- can you save the number of matching records to a variable. Also, can you run a DELETE with TOP? If so, perhaps you could do something like countvar = SELECT Count(*) blah, blah, WHERE MyCode = value DELETE TOP countvar - 1 I don't know if TOP with DELETE is allowed and if you went this route, you'd need a sp to store countvar. This may be total nonsense in T-SQL. Susan H. From David at sierranevada.com Mon Jul 9 12:35:03 2007 From: David at sierranevada.com (David Lewis) Date: Mon, 9 Jul 2007 10:35:03 -0700 Subject: [dba-SQLServer] deleting an unknown number of duplicates In-Reply-To: References: Message-ID: This should get you up and running. HTH D. Lewis /* Here is an example of the first sql statement that runs to determine how many duplicates there are. You will need to first build this statement to fit your data. The table I am working with has a 'somewhat' unique brewnumber (they begin again at 0 each year): SELECT COUNT(*) AS Amount, BrewNumber, StartTimeRest, StartTimeWhirlEnd FROM tblRptWhirlpoolAll GROUP BY BrewNumber,StartTimeRest,Probrewid,STartTimeWhirlEnd HAVING COUNT(*) > 1 Order by brewnumber, probrewid Once I have the row count, I subtract 1 from that and delete all the rows. I build a cursor to loop through because I run this after a batch import each week, and usually there are any number of brews with duplicate records. */ -- declare all variables DECLARE @iErrorVar int, @iCount int, @vchBrewid varchar(10), @vchmalttypeid varchar(2), @vchsilo varchar(3), @vchPounds varchar(6), @chCount char(3), @nvchCommand nvarchar(4000), @intCounter int -- set initial environment SET @intCounter=0 SET ROWCOUNT 0 SET NOCOUNT ON --Notice that in declaring the cursor, the data in the select query are all --cast as varchar's. This is because I later concatenate all these variable --values into one sql string, and t-sql won't concatenate non-characters. DECLARE DelDupe CURSOR FOR SELECT COUNT(*) AS Amount, CONVERT(varchar(10),Brewid), CONVERT(varchar(2),malttypeid), CONVERT(varchar(6),pounds), CONVERT(varchar(3),silo) FROM tblBrewMalt GROUP BY Brewid, malttypeid,pounds,silo HAVING COUNT(*) > 1 OPEN DelDupe FETCH NEXT FROM DelDupe INTO @iCount, at vchBrewid, @vchmalttypeid, @vchpounds, at vchsilo WHILE (@@fetch_status = 0) BEGIN -- Calculate number of rows to delete for each grouping by subtracting -- 1 from the total count for a given group. -- Every iteration through the cursor will generate a delete statement. -- Often, though, it is deleting '0' rows, because there are no duplicates. -- It was easier to just have one bit of code than having it branch. -- Note that the number of rows to delete is set by the "SET ROWCOUNT" SELECT @iCount = @iCount - 1 SELECT @chCount = CONVERT(char(3), at iCount) -- now build the rowcount and delete statements. SELECT @nvchCommand = N'SET ROWCOUNT ' + @chCount + 'DELETE tblBrewMalt ' + ' WHERE Brewid = ' + '''' + @vchBrewid + '''' + ' AND Malttypeid = ' + '''' + @vchmalttypeid + '''' + ' AND pounds = ' + '''' + @vchPounds + '''' + ' AND silo = ' + '''' + @vchsilo + '''' -- print the statement. For debugging. PRINT Convert(varchar(5), at intCounter) + ' ' + @nvchCommand -- execute the statement. EXEC sp_executesql @nvchCommand SELECT @intCounter=@intCounter+1 SELECT @iErrorVar = @@Error IF @iErrorVar <> 0 BEGIN RETURN END FETCH NEXT FROM DelDupe INTO @iCount, at vchBrewid, @vchmalttypeid, @vchpounds, at vchsilo END CLOSE DelDupe DEALLOCATE DelDupe RETURN From rl_stewart at highstream.net Mon Jul 9 14:03:08 2007 From: rl_stewart at highstream.net (Robert) Date: Mon, 09 Jul 2007 14:03:08 -0500 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 53, Issue 6 In-Reply-To: References: Message-ID: <200707091908.l69J8ZJT013403@databaseadvisors.com> What she is saying is change one record to a valuse of D. Delete all the C's. change the one record that is D back to C At 12:00 PM 7/9/2007, you wrote: >Date: Sun, 8 Jul 2007 21:32:39 -0400 >From: "Susan Harkins" >Subject: Re: [dba-SQLServer] Delete all records of a particular type > from atable except for one copy. >To: >Message-ID: <001501c7c1c9$0e6f7040$93b82ad1 at SusanOne> >Content-Type: text/plain; charset="us-ascii" > >Why would you need an AutoNumber field? > >Find the records that match MyCode -- grab the top record and change its >MyCode value -- run the first query as a delete, reset the top record's >MyCode value. > >Or, count the records and grab the count -1 in your delete -- can you do >that? > >Susan H. > >It may sound funny but I do not care which record is the record left. I was >hoping that another step of adding an 'autoNumber' field was not necessary >but maybe it is... From fkkendrick at cox.net Mon Jul 9 14:41:46 2007 From: fkkendrick at cox.net (F Kay Kendrick) Date: Mon, 9 Jul 2007 14:41:46 -0500 Subject: [dba-SQLServer] Delete all records of a particular type from a table except for one copy. In-Reply-To: <0JKV00ITGU7JZSK4@l-daemon> References: <0JKV00ITGU7JZSK4@l-daemon> Message-ID: <003701c7c261$2f8a7d90$020aa8c0@dragon> Jim, You'll want to try this out on a copy of the table, of course, but I believe it will accomplish what you want to do. I created the @MyCode variable, thinking perhaps there might be times when you would want to delete all except one record with MyCode values other than 'C'. CREATE PROCEDURE [dbo].[sprocDelete_MyCode] (@MyCode nvarchar(50)) AS Delete FROM MyTable where ID IN(SELECT ID FROM dbo.MyTable WHERE (MyCode = @MyCode) AND (NOT (ID IN (SELECT TOP (1) ID FROM dbo.MyTable AS t WHERE (MyCode = @MyCode))))) Kay -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 08, 2007 5:58 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Delete all records of a particular type from a table except for one copy. Hi All: This is a SQL question. It should be fairly easy but... How would you delete all records from a table with a field set to a specific value, all except one matching record? Given: MyTable has 100 records with field MyCode set to either A, B or C. There just happens, at this time, to be 37 records in the table with field MyCode set to 'C'. Required: A SQL statement that when run deletes all matching records with field MyCode equal to 'C' except for 1 record. (The number of records with field MyCode set to 'C' varies of course.) TIA Jim _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at setel.com Mon Jul 9 16:52:43 2007 From: ssharkins at setel.com (Susan Harkins) Date: Mon, 9 Jul 2007 17:52:43 -0400 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 53, Issue 6 In-Reply-To: <200707091908.l69J8ZJT013403@databaseadvisors.com> References: <200707091908.l69J8ZJT013403@databaseadvisors.com> Message-ID: <002c01c7c273$7cec7f90$e7b82ad1@SusanOne> Exactly. ;) Susan H. What she is saying is change one record to a valuse of D. Delete all the C's. change the one record that is D back to C From rockysmolin at bchacc.com Mon Jul 9 18:24:50 2007 From: rockysmolin at bchacc.com (Rocky Smolin at Beach Access Software) Date: Mon, 9 Jul 2007 16:24:50 -0700 Subject: [dba-SQLServer] FW: [AccessD] Converting to MySql Message-ID: <005401c7c280$5949ce00$0301a8c0@HAL9005> Copied from the AccessD list. I think this question is more appropriate here. Rocky Rocky Smolin at Beach Access Software wrote: > Dear List: > > I have a request to make my manufacturing package compatible with > MySql. I use some bound forms, and a lot of DAO. The app is split > FE/BE with linked tables pointing to the BE. I also allow the user to > select the BE they want so they can run multiple BEs if desired. > > What would be involved in doing this? Would it be enough of a rewrite > that it would require a separate product? Or can the current product > be made 'switchable' between an Access BE and a MySql BE? MTIA, Rocky From fhtapia at gmail.com Mon Jul 9 23:15:45 2007 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 9 Jul 2007 21:15:45 -0700 Subject: [dba-SQLServer] Temp Tables In-Reply-To: <20070630132808.2BC00BC79@smtp-auth.no-ip.com> References: <20070630132808.2BC00BC79@smtp-auth.no-ip.com> Message-ID: As with all tech questions. It depends Largely in the quantity that you dump over to the temp table, how much space is available on disk for the tempdb how fast the i/o is for the tempdb On 6/30/07, jwcolby wrote: > It just occurred to me that perhaps I need to be working with temp tables > more. > > I have queries against 65 million record tables with WHERE clauses with > anywhere from 4 to 20 fields. If I broke my queries against my huge tables > into base query that pulled a data set into a temp table based on one of > those fields, and then ran the remainder of my where clause against the > smaller temp table I think I might get a speed bump. > > Any thoughts on that? > > John W. Colby > Colby Consulting > 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 accessd at shaw.ca Tue Jul 10 01:21:54 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 09 Jul 2007 23:21:54 -0700 Subject: [dba-SQLServer] Delete all records of a particular type from atable except for one copy. In-Reply-To: <003701c7c261$2f8a7d90$020aa8c0@dragon> Message-ID: <0JKY00C7E9G1V730@l-daemon> Hi F. Kay Kendrick: Thanks for your help. That looks like it will definitely do the job. I did solve the problem and your version looks very similar. Thanks again Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of F Kay Kendrick Sent: Monday, July 09, 2007 12:42 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Delete all records of a particular type from atable except for one copy. Jim, You'll want to try this out on a copy of the table, of course, but I believe it will accomplish what you want to do. I created the @MyCode variable, thinking perhaps there might be times when you would want to delete all except one record with MyCode values other than 'C'. CREATE PROCEDURE [dbo].[sprocDelete_MyCode] (@MyCode nvarchar(50)) AS Delete FROM MyTable where ID IN(SELECT ID FROM dbo.MyTable WHERE (MyCode = @MyCode) AND (NOT (ID IN (SELECT TOP (1) ID FROM dbo.MyTable AS t WHERE (MyCode = @MyCode))))) Kay -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 08, 2007 5:58 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Delete all records of a particular type from a table except for one copy. Hi All: This is a SQL question. It should be fairly easy but... How would you delete all records from a table with a field set to a specific value, all except one matching record? Given: MyTable has 100 records with field MyCode set to either A, B or C. There just happens, at this time, to be 37 records in the table with field MyCode set to 'C'. Required: A SQL statement that when run deletes all matching records with field MyCode equal to 'C' except for 1 record. (The number of records with field MyCode set to 'C' varies of course.) TIA Jim _______________________________________________ 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 rl_stewart at highstream.net Tue Jul 10 13:34:32 2007 From: rl_stewart at highstream.net (Robert) Date: Tue, 10 Jul 2007 13:34:32 -0500 Subject: [dba-SQLServer] Converting to MySql In-Reply-To: References: Message-ID: <200707101840.l6AIe7AT010018@databaseadvisors.com> Rocky, The only thing you can do to test it is to do just that. Create a MySql database and test your app linked to it. Robert At 12:00 PM 7/10/2007, you wrote: >Date: Mon, 9 Jul 2007 16:24:50 -0700 >From: "Rocky Smolin at Beach Access Software" >Subject: [dba-SQLServer] FW: [AccessD] Converting to MySql >To: >Message-ID: <005401c7c280$5949ce00$0301a8c0 at HAL9005> >Content-Type: text/plain; charset="US-ASCII" > > > > >Copied from the AccessD list. I think this question is more appropriate >here. > >Rocky > > > >Rocky Smolin at Beach Access Software wrote: > > Dear List: > > > > I have a request to make my manufacturing package compatible with > > MySql. I use some bound forms, and a lot of DAO. The app is split > > FE/BE with linked tables pointing to the BE. I also allow the user to > > select the BE they want so they can run multiple BEs if desired. > > > > What would be involved in doing this? Would it be enough of a rewrite > > that it would require a separate product? Or can the current product > > be made 'switchable' between an Access BE and a MySql BE? > >MTIA, > >Rocky From fkkendrick at cox.net Tue Jul 10 14:15:24 2007 From: fkkendrick at cox.net (F Kay Kendrick) Date: Tue, 10 Jul 2007 14:15:24 -0500 Subject: [dba-SQLServer] FW: [AccessD] Converting to MySql In-Reply-To: <005401c7c280$5949ce00$0301a8c0@HAL9005> References: <005401c7c280$5949ce00$0301a8c0@HAL9005> Message-ID: <000301c7c326$ab260e40$030aa8c0@dragon> Rocky, >From http://www.kitebird.com/articles/access-migrate.html#TOC_2: ...if you install the MySQL Connector/ODBC driver (formerly known as MyODBC), Access can make ODBC connections to MySQL servers over the network. You can still use the contents of your tables through Access, but the tables themselves are hosted by the MySQL server. The MySQL Connector/ODBC driver can be downloaded from http://www.mysql.com/products/connector/odbc/. There is also a migration toolkit available from http://www.mysql.com/products/tools/migration-toolkit/. HTH, Kay -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Monday, July 09, 2007 6:25 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] FW: [AccessD] Converting to MySql Copied from the AccessD list. I think this question is more appropriate here. Rocky Rocky Smolin at Beach Access Software wrote: > Dear List: > > I have a request to make my manufacturing package compatible with > MySql. I use some bound forms, and a lot of DAO. The app is split > FE/BE with linked tables pointing to the BE. I also allow the user to > select the BE they want so they can run multiple BEs if desired. > > What would be involved in doing this? Would it be enough of a rewrite > that it would require a separate product? Or can the current product > be made 'switchable' between an Access BE and a MySql BE? MTIA, Rocky _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Jul 10 15:05:29 2007 From: rockysmolin at bchacc.com (Rocky Smolin at Beach Access Software) Date: Tue, 10 Jul 2007 13:05:29 -0700 Subject: [dba-SQLServer] Converting to MySql In-Reply-To: <200707101840.l6AIe7AT010018@databaseadvisors.com> Message-ID: <002b01c7c32d$aa794f50$0301a8c0@HAL9005> I'll give it a whirl. If forced. :) Rocky -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Tuesday, July 10, 2007 11:35 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Converting to MySql Rocky, The only thing you can do to test it is to do just that. Create a MySql database and test your app linked to it. Robert At 12:00 PM 7/10/2007, you wrote: >Date: Mon, 9 Jul 2007 16:24:50 -0700 >From: "Rocky Smolin at Beach Access Software" >Subject: [dba-SQLServer] FW: [AccessD] Converting to MySql >To: >Message-ID: <005401c7c280$5949ce00$0301a8c0 at HAL9005> >Content-Type: text/plain; charset="US-ASCII" > > > > >Copied from the AccessD list. I think this question is more >appropriate here. > >Rocky > > > >Rocky Smolin at Beach Access Software wrote: > > Dear List: > > > > I have a request to make my manufacturing package compatible with > > MySql. I use some bound forms, and a lot of DAO. The app is split > > FE/BE with linked tables pointing to the BE. I also allow the user > > to select the BE they want so they can run multiple BEs if desired. > > > > What would be involved in doing this? Would it be enough of a > > rewrite that it would require a separate product? Or can the > > current product be made 'switchable' between an Access BE and a MySql BE? > >MTIA, > >Rocky _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.2/893 - Release Date: 7/9/2007 5:22 PM From rockysmolin at bchacc.com Tue Jul 10 15:06:42 2007 From: rockysmolin at bchacc.com (Rocky Smolin at Beach Access Software) Date: Tue, 10 Jul 2007 13:06:42 -0700 Subject: [dba-SQLServer] FW: [AccessD] Converting to MySql In-Reply-To: <000301c7c326$ab260e40$030aa8c0@dragon> Message-ID: <002c01c7c32d$d5f9c8d0$0301a8c0@HAL9005> That looks real helpful. I think that SQL is overkill for my market segment, but this is coming from a potential distributor in Singapore who thinks otherwise. So if the market is there, I guess I'll dive in. Rocky -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of F Kay Kendrick Sent: Tuesday, July 10, 2007 12:15 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] FW: [AccessD] Converting to MySql Rocky, >From http://www.kitebird.com/articles/access-migrate.html#TOC_2: ...if you install the MySQL Connector/ODBC driver (formerly known as MyODBC), Access can make ODBC connections to MySQL servers over the network. You can still use the contents of your tables through Access, but the tables themselves are hosted by the MySQL server. The MySQL Connector/ODBC driver can be downloaded from http://www.mysql.com/products/connector/odbc/. There is also a migration toolkit available from http://www.mysql.com/products/tools/migration-toolkit/. HTH, Kay -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Monday, July 09, 2007 6:25 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] FW: [AccessD] Converting to MySql Copied from the AccessD list. I think this question is more appropriate here. Rocky Rocky Smolin at Beach Access Software wrote: > Dear List: > > I have a request to make my manufacturing package compatible with > MySql. I use some bound forms, and a lot of DAO. The app is split > FE/BE with linked tables pointing to the BE. I also allow the user to > select the BE they want so they can run multiple BEs if desired. > > What would be involved in doing this? Would it be enough of a rewrite > that it would require a separate product? Or can the current product > be made 'switchable' between an Access BE and a MySql BE? MTIA, Rocky _______________________________________________ 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.2/893 - Release Date: 7/9/2007 5:22 PM From askolits at ot.com Tue Jul 10 22:21:48 2007 From: askolits at ot.com (John Skolits) Date: Tue, 10 Jul 2007 23:21:48 -0400 Subject: [dba-SQLServer] Newer Common Dialog box In-Reply-To: <002c01c7c32d$d5f9c8d0$0301a8c0@HAL9005> Message-ID: <000201c7c36a$9de15b10$0f01a8c0@officexp> I've been using comdlg32.ocx for years. Now I would like to use the newer one I see when I try to open a file using something like Word 2002. Anyone have code for the new common dialog? John Skolits From fuller.artful at gmail.com Wed Jul 11 06:40:08 2007 From: fuller.artful at gmail.com (Arthur Fuller) Date: Wed, 11 Jul 2007 07:40:08 -0400 Subject: [dba-SQLServer] A weird Access + SQL puzzle Message-ID: <29f585dd0707110440y2e9f9490wd483ca115611f98c@mail.gmail.com> I have been developing an app for a client on my own box, using winXP SP2, Access 2000 SR1, SQL 2005. On my machine it runs just fine. I did a backup on my machine and restored that to the client's machine, also running the identical Access and SQL 2005 (as far as I can tell). The app runs ok, and from inside Management Studio everything looks identical. But from within the Access app on the client's machine, all the stored procedure names have an unexplained suffix of ";1". This is not visible in Management Studio. This problem does not affect the views, only the stored procedures. Fortunately, lots of the app uses views and not stored procedures. I've a lot of Access + SQL Server work and never seen this before. I tried renaming the procedures from within Access, but no go. I tried re-establishing the connection. No go. I have no idea what is going on here. Anyone? TIA, Arthur From jwcolby at colbyconsulting.com Wed Jul 11 09:19:36 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 10:19:36 -0400 Subject: [dba-SQLServer] Visual studio help Message-ID: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Jul 11 10:01:27 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 11:01:27 -0400 Subject: [dba-SQLServer] Build a database Message-ID: <20070711150131.2D5FEBD26@smtp-auth.no-ip.com> Is there SQL code to programmatically build a database container in SQL Server? If not, is it possible at all, i.e. stored procedure etc, and if so, what would the code for that look like? John W. Colby Colby Consulting www.ColbyConsulting.com From ebarro at verizon.net Wed Jul 11 10:05:04 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 11 Jul 2007 08:05:04 -0700 Subject: [dba-SQLServer] Build a database In-Reply-To: <20070711150131.2D5FEBD26@smtp-auth.no-ip.com> Message-ID: <0JL00078JSKPFCC0@vms042.mailsrvcs.net> CREATE DATABASE [dbname] ON (NAME = 'dbname_Data', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\data\dbname.MDF', SIZE = 21, FILEGROWTH = 10%) LOG ON (NAME = 'dbname_Log', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\data\dbname_Log.LDF' , SIZE = 1, FILEGROWTH = 10%) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:01 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Build a database Is there SQL code to programmatically build a database container in SQL Server? If not, is it possible at all, i.e. stored procedure etc, and if so, what would the code for that look like? John W. Colby Colby Consulting 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 Wed Jul 11 10:43:35 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 11:43:35 -0400 Subject: [dba-SQLServer] Build a database In-Reply-To: <0JL00078JSKPFCC0@vms042.mailsrvcs.net> Message-ID: <20070711154338.E7B31BEDB@smtp-auth.no-ip.com> Cool! I'll give it a try. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 11, 2007 11:05 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Build a database CREATE DATABASE [dbname] ON (NAME = 'dbname_Data', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\data\dbname.MDF', SIZE = 21, FILEGROWTH = 10%) LOG ON (NAME = 'dbname_Log', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\data\dbname_Log.LDF' , SIZE = 1, FILEGROWTH = 10%) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:01 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Build a database Is there SQL code to programmatically build a database container in SQL Server? If not, is it possible at all, i.e. stored procedure etc, and if so, what would the code for that look like? John W. Colby Colby Consulting 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 Wed Jul 11 10:51:28 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 11:51:28 -0400 Subject: [dba-SQLServer] [dba-VB] Visual studio help In-Reply-To: Message-ID: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From rl_stewart at highstream.net Wed Jul 11 10:59:57 2007 From: rl_stewart at highstream.net (Robert) Date: Wed, 11 Jul 2007 10:59:57 -0500 Subject: [dba-SQLServer] Visual studio help In-Reply-To: References: Message-ID: <200707111605.l6BG50a6018086@databaseadvisors.com> John, The help files for Visual Studio are not installed automatically. You have to run the install on the MSDN disk(s) that came with it to get help of any kind. Robert At 10:51 AM 7/11/2007, you wrote: >Date: Wed, 11 Jul 2007 11:51:28 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] [dba-VB] Visual studio help >To: , > , "'Access Developers discussion and > problem solving'" >Message-ID: <20070711155131.9F8C9BE74 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Yes, but if you hit F1 then it opens a help file of some sort. I can say >whether it is going to use the local help or the internet help first etc. >As for books online, well... I only know that term in terms of SQL Server. > >1) Go into code. >2) Select some something, keyword, whatever. >3) Hit F1. > >What do you see? > >I see a help window. On the top blue bar it says "Microsoft Visual Studio >2005 Documentation". That is a good sign. > >However on the left hand side there is a Pane (or PAIN depending on your >point of view), which has a "filter by" combo. The ONLY CHOICES (for me) >are: > >SQL Server 2005 >SQL Server Analysis Service >SQL Server... >SQL Server... >SQL Server... >Etc etc. > >I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER >HELP, I WANT VB HELP. > >Actually I want to be able to select VB, C#, Java, SQL Server and whatever >else is appropriate in the context I am using. I am flying Visual Studio >blind, unless all I am interested in is SQL Server help in which case I am >ducky. > >John W. Colby From jwcolby at colbyconsulting.com Wed Jul 11 11:05:43 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:05:43 -0400 Subject: [dba-SQLServer] Build a database In-Reply-To: <0JL00078JSKPFCC0@vms042.mailsrvcs.net> Message-ID: <20070711160547.58469BD72@smtp-auth.no-ip.com> Worked great. I discovered that it can only create databases on the machine that is running the server instance used to execute the command, and the path has to already exist. After discovering these two things it works GREAT. Thanks! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 11, 2007 11:05 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Build a database CREATE DATABASE [dbname] ON (NAME = 'dbname_Data', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\data\dbname.MDF', SIZE = 21, FILEGROWTH = 10%) LOG ON (NAME = 'dbname_Log', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\data\dbname_Log.LDF' , SIZE = 1, FILEGROWTH = 10%) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:01 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Build a database Is there SQL code to programmatically build a database container in SQL Server? If not, is it possible at all, i.e. stored procedure etc, and if so, what would the code for that look like? John W. Colby Colby Consulting 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 Wed Jul 11 11:15:49 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:15:49 -0400 Subject: [dba-SQLServer] Visual studio help In-Reply-To: <200707111605.l6BG50a6018086@databaseadvisors.com> Message-ID: <20070711161553.0FA69BCD9@smtp-auth.no-ip.com> LOL, OF COURSE, who could possibly need help with visual Studio? Silly me! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Wednesday, July 11, 2007 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Visual studio help John, The help files for Visual Studio are not installed automatically. You have to run the install on the MSDN disk(s) that came with it to get help of any kind. Robert At 10:51 AM 7/11/2007, you wrote: >Date: Wed, 11 Jul 2007 11:51:28 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] [dba-VB] Visual studio help >To: , > , "'Access Developers discussion and > problem solving'" >Message-ID: <20070711155131.9F8C9BE74 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Yes, but if you hit F1 then it opens a help file of some sort. I can >say whether it is going to use the local help or the internet help first etc. >As for books online, well... I only know that term in terms of SQL Server. > >1) Go into code. >2) Select some something, keyword, whatever. >3) Hit F1. > >What do you see? > >I see a help window. On the top blue bar it says "Microsoft Visual >Studio >2005 Documentation". That is a good sign. > >However on the left hand side there is a Pane (or PAIN depending on >your point of view), which has a "filter by" combo. The ONLY CHOICES >(for me) >are: > >SQL Server 2005 >SQL Server Analysis Service >SQL Server... >SQL Server... >SQL Server... >Etc etc. > >I am locked in to filtering on SQL Server help. I DON'T WANT SQL >SERVER HELP, I WANT VB HELP. > >Actually I want to be able to select VB, C#, Java, SQL Server and >whatever else is appropriate in the context I am using. I am flying >Visual Studio blind, unless all I am interested in is SQL Server help >in which case I am ducky. > >John W. Colby _______________________________________________ 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 Wed Jul 11 11:20:21 2007 From: ridermark at gmail.com (Mark Rider) Date: Wed, 11 Jul 2007 11:20:21 -0500 Subject: [dba-SQLServer] Visual studio help In-Reply-To: <20070711161553.0FA69BCD9@smtp-auth.no-ip.com> References: <200707111605.l6BG50a6018086@databaseadvisors.com> <20070711161553.0FA69BCD9@smtp-auth.no-ip.com> Message-ID: You might try reinstalling MSDN again and see if that helps. -- Mark Rider http://dfwmdug.org Don't anthropomorphize computers. They don't like it. From jwcolby at colbyconsulting.com Wed Jul 11 11:29:03 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:29:03 -0400 Subject: [dba-SQLServer] Visual studio help In-Reply-To: <200707111605.l6BG50a6018086@databaseadvisors.com> Message-ID: <20070711162907.4016CBE1D@smtp-auth.no-ip.com> Robert, Yep, a reinstall of MSDN fixed the problem. Thanks for the heads up John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Wednesday, July 11, 2007 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Visual studio help John, The help files for Visual Studio are not installed automatically. You have to run the install on the MSDN disk(s) that came with it to get help of any kind. Robert At 10:51 AM 7/11/2007, you wrote: >Date: Wed, 11 Jul 2007 11:51:28 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] [dba-VB] Visual studio help >To: , > , "'Access Developers discussion and > problem solving'" >Message-ID: <20070711155131.9F8C9BE74 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Yes, but if you hit F1 then it opens a help file of some sort. I can >say whether it is going to use the local help or the internet help first etc. >As for books online, well... I only know that term in terms of SQL Server. > >1) Go into code. >2) Select some something, keyword, whatever. >3) Hit F1. > >What do you see? > >I see a help window. On the top blue bar it says "Microsoft Visual >Studio >2005 Documentation". That is a good sign. > >However on the left hand side there is a Pane (or PAIN depending on >your point of view), which has a "filter by" combo. The ONLY CHOICES >(for me) >are: > >SQL Server 2005 >SQL Server Analysis Service >SQL Server... >SQL Server... >SQL Server... >Etc etc. > >I am locked in to filtering on SQL Server help. I DON'T WANT SQL >SERVER HELP, I WANT VB HELP. > >Actually I want to be able to select VB, C#, Java, SQL Server and >whatever else is appropriate in the context I am using. I am flying >Visual Studio blind, unless all I am interested in is SQL Server help >in which case I am ducky. > >John W. Colby _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From rl_stewart at highstream.net Wed Jul 11 14:01:02 2007 From: rl_stewart at highstream.net (Robert) Date: Wed, 11 Jul 2007 14:01:02 -0500 Subject: [dba-SQLServer] Visual studio help In-Reply-To: References: Message-ID: <200707111904.l6BJ4eFM008484@databaseadvisors.com> Great At 12:00 PM 7/11/2007, you wrote: >Date: Wed, 11 Jul 2007 12:29:03 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] Visual studio help >To: , "'Access Developers > discussion and problem > solving'" , > >Message-ID: <20070711162907.4016CBE1D at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Robert, > >Yep, a reinstall of MSDN fixed the problem. Thanks for the heads up From tuxedoman888 at gmail.com Wed Jul 11 18:37:31 2007 From: tuxedoman888 at gmail.com (Billy Pang) Date: Wed, 11 Jul 2007 16:37:31 -0700 Subject: [dba-SQLServer] A weird Access + SQL puzzle In-Reply-To: <29f585dd0707110440y2e9f9490wd483ca115611f98c@mail.gmail.com> References: <29f585dd0707110440y2e9f9490wd483ca115611f98c@mail.gmail.com> Message-ID: <7c8826480707111637t65b2a7f9s47fe9230fac1348c@mail.gmail.com> were the stored procedure created with 1; suffix on it? i think i've read about it somewhere where you can created two stored procedures with the same name but different parameters as long as an integer suffix is attached to it (but i've never had the need to implement it). http://msdn2.microsoft.com/En-US/library/aa258259(SQL.80).aspx On 7/11/07, Arthur Fuller wrote: > > I have been developing an app for a client on my own box, using winXP SP2, > Access 2000 SR1, SQL 2005. On my machine it runs just fine. I did a backup > on my machine and restored that to the client's machine, also running the > identical Access and SQL 2005 (as far as I can tell). The app runs ok, and > from inside Management Studio everything looks identical. But from within > the Access app on the client's machine, all the stored procedure names > have > an unexplained suffix of ";1". This is not visible in Management Studio. > This problem does not affect the views, only the stored procedures. > Fortunately, lots of the app uses views and not stored procedures. > > I've a lot of Access + SQL Server work and never seen this before. I tried > renaming the procedures from within Access, but no go. I tried > re-establishing the connection. No go. > > I have no idea what is going on here. > > Anyone? > > TIA, > Arthur > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Billy Pang http://dbnotes.blogspot.com/ "Once the game is over, the King and the pawn go back in the same box." - Italian proverb From fuller.artful at gmail.com Wed Jul 11 19:16:46 2007 From: fuller.artful at gmail.com (Arthur Fuller) Date: Wed, 11 Jul 2007 20:16:46 -0400 Subject: [dba-SQLServer] FW: [AccessD] Converting to MySql In-Reply-To: <002c01c7c32d$d5f9c8d0$0301a8c0@HAL9005> References: <000301c7c326$ab260e40$030aa8c0@dragon> <002c01c7c32d$d5f9c8d0$0301a8c0@HAL9005> Message-ID: <29f585dd0707111716h4ea77c6fl3b1a4dfc6c2cdf86@mail.gmail.com> For what it's worth, anyone interested in MySQL is invited to visit my co-authored e-book at www.artfulsoftware.com. Arthur On 7/10/07, Rocky Smolin at Beach Access Software wrote: > > That looks real helpful. I think that SQL is overkill for my market > segment, but this is coming from a potential distributor in Singapore who > thinks otherwise. So if the market is there, I guess I'll dive in. > > Rocky > > > > > > > > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of F Kay > Kendrick > Sent: Tuesday, July 10, 2007 12:15 PM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] FW: [AccessD] Converting to MySql > > Rocky, > > >From http://www.kitebird.com/articles/access-migrate.html#TOC_2: > ...if you install the MySQL Connector/ODBC driver (formerly known as > MyODBC), Access can make ODBC connections to MySQL servers over the > network. > You can still use the contents of your tables through Access, but the > tables > themselves are hosted by the MySQL server. > > The MySQL Connector/ODBC driver can be downloaded from > http://www.mysql.com/products/connector/odbc/. There is also a migration > toolkit available from > http://www.mysql.com/products/tools/migration-toolkit/. > > HTH, > > Kay > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Rocky > Smolin at Beach Access Software > Sent: Monday, July 09, 2007 6:25 PM > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer] FW: [AccessD] Converting to MySql > > > > > Copied from the AccessD list. I think this question is more appropriate > here. > > Rocky > > > > Rocky Smolin at Beach Access Software wrote: > > Dear List: > > > > I have a request to make my manufacturing package compatible with > > MySql. I use some bound forms, and a lot of DAO. The app is split > > FE/BE with linked tables pointing to the BE. I also allow the user to > > select the BE they want so they can run multiple BEs if desired. > > > > What would be involved in doing this? Would it be enough of a rewrite > > that it would require a separate product? Or can the current product > > be made 'switchable' between an Access BE and a MySql BE? > > MTIA, > > Rocky > > _______________________________________________ > 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 > > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.10.2/893 - Release Date: 7/9/2007 > 5:22 PM > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fuller.artful at gmail.com Wed Jul 11 19:21:20 2007 From: fuller.artful at gmail.com (Arthur Fuller) Date: Wed, 11 Jul 2007 20:21:20 -0400 Subject: [dba-SQLServer] A weird Access + SQL puzzle In-Reply-To: <7c8826480707111637t65b2a7f9s47fe9230fac1348c@mail.gmail.com> References: <29f585dd0707110440y2e9f9490wd483ca115611f98c@mail.gmail.com> <7c8826480707111637t65b2a7f9s47fe9230fac1348c@mail.gmail.com> Message-ID: <29f585dd0707111721m7617b6d5x5a8b961f885a0a70@mail.gmail.com> Good leads, Billy, but in this case I believe, off the mark. I re-restored the database and then ran it from A2K and A2K3 and guess what? It turns out for some odd reason to be A2K-specific. A2K3 has no issue, and therefore ultimately neither do I. The only reason I devolved in this case was I dislike the native colour scheme in A2K3 -- tabls coloured white -- bloddy L. Ghostly and ghastly. There must be some way out of here, said the coder to the thief. A. On 7/11/07, Billy Pang wrote: > > were the stored procedure created with 1; suffix on it? > > i think i've read about it somewhere where you can created two stored > procedures with the same name but different parameters as long as an > integer > suffix is attached to it (but i've never had the need to implement it). > > http://msdn2.microsoft.com/En-US/library/aa258259(SQL.80).aspx > > > On 7/11/07, Arthur Fuller wrote: > > > > I have been developing an app for a client on my own box, using winXP > SP2, > > Access 2000 SR1, SQL 2005. On my machine it runs just fine. I did a > backup > > on my machine and restored that to the client's machine, also running > the > > identical Access and SQL 2005 (as far as I can tell). The app runs ok, > and > > from inside Management Studio everything looks identical. But from > within > > the Access app on the client's machine, all the stored procedure names > > have > > an unexplained suffix of ";1". This is not visible in Management Studio. > > This problem does not affect the views, only the stored procedures. > > Fortunately, lots of the app uses views and not stored procedures. > > > > I've a lot of Access + SQL Server work and never seen this before. I > tried > > renaming the procedures from within Access, but no go. I tried > > re-establishing the connection. No go. > > > > I have no idea what is going on here. > > > > Anyone? > > > > TIA, > > Arthur > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > -- > Billy Pang > http://dbnotes.blogspot.com/ > "Once the game is over, the King and the pawn go back in the same box." - > Italian proverb > _______________________________________________ > 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 Jul 11 22:03:42 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 23:03:42 -0400 Subject: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 Message-ID: <20070712030347.0B7E8BDA9@smtp-auth.no-ip.com> Is anyone out there running Windows 2003 X64? If so would you care to comment on what was involved in getting it to happen, drivers, getting the software etc. Same question for SQl Server 2005 X64. John W. Colby Colby Consulting www.ColbyConsulting.com From rl_stewart at highstream.net Thu Jul 12 12:34:05 2007 From: rl_stewart at highstream.net (Robert) Date: Thu, 12 Jul 2007 12:34:05 -0500 Subject: [dba-SQLServer] A weird Access + SQL puzzle In-Reply-To: References: Message-ID: <200707121737.l6CHbdcA028173@databaseadvisors.com> Change the schema on your machine to Windows standard. You are seeing the XP schema. At 12:00 PM 7/12/2007, you wrote: >Date: Wed, 11 Jul 2007 20:21:20 -0400 >From: "Arthur Fuller" >Subject: Re: [dba-SQLServer] A weird Access + SQL puzzle >To: dba-sqlserver at databaseadvisors.com >Message-ID: > <29f585dd0707111721m7617b6d5x5a8b961f885a0a70 at mail.gmail.com> >Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >Good leads, Billy, but in this case I believe, off the mark. I re-restored >the database and then ran it from A2K and A2K3 and guess what? It turns out >for some odd reason to be A2K-specific. A2K3 has no issue, and therefore >ultimately neither do I. The only reason I devolved in this case was I >dislike the native colour scheme in A2K3 -- tabls coloured white -- bloddy >L. Ghostly and ghastly. There must be some way out of here, said the coder >to the thief. > >A. From rl_stewart at highstream.net Thu Jul 12 12:36:54 2007 From: rl_stewart at highstream.net (Robert) Date: Thu, 12 Jul 2007 12:36:54 -0500 Subject: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 In-Reply-To: References: Message-ID: <200707121742.l6CHggOW030049@databaseadvisors.com> We just upgraded from Win x32, SQL 2000 x32 to Win 2003 x64 and SQL 2005 x64. Nothing special was involved. We are using a Dell dual/dual core processor machine with 8gb of ram. Since it is the primary SQL server, no other software is running on it. At 12:00 PM 7/12/2007, you wrote: >Date: Wed, 11 Jul 2007 23:03:42 -0400 >From: "jwcolby" >Subject: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 >To: "'Access Developers discussion and problem solving'" > , "'Discussion of > Hardware and Software > issues'" , > , >Message-ID: <20070712030347.0B7E8BDA9 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Is anyone out there running Windows 2003 X64? If so would you care to >comment on what was involved in getting it to happen, drivers, getting the >software etc. > >Same question for SQl Server 2005 X64. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 13:36:22 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 12 Jul 2007 14:36:22 -0400 Subject: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 In-Reply-To: <200707121742.l6CHggOW030049@databaseadvisors.com> Message-ID: <20070712183623.419D1BFB2@smtp-auth.no-ip.com> Robert, Have you done any timing testing for large data sets? Any "gut feelings" for speed differences? Did you have to purchase a different version of SQL Server or does the 64 bit come with the 32 bit and "just start working"? Or did you get brand new machines with preinstalled software? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Thursday, July 12, 2007 1:37 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 We just upgraded from Win x32, SQL 2000 x32 to Win 2003 x64 and SQL 2005 x64. Nothing special was involved. We are using a Dell dual/dual core processor machine with 8gb of ram. Since it is the primary SQL server, no other software is running on it. At 12:00 PM 7/12/2007, you wrote: >Date: Wed, 11 Jul 2007 23:03:42 -0400 >From: "jwcolby" >Subject: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 >To: "'Access Developers discussion and problem solving'" > , "'Discussion of > Hardware and Software > issues'" , > , > >Message-ID: <20070712030347.0B7E8BDA9 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Is anyone out there running Windows 2003 X64? If so would you care to >comment on what was involved in getting it to happen, drivers, getting >the software etc. > >Same question for SQl Server 2005 X64. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From rl_stewart at highstream.net Fri Jul 13 12:17:45 2007 From: rl_stewart at highstream.net (Robert) Date: Fri, 13 Jul 2007 12:17:45 -0500 Subject: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 In-Reply-To: References: Message-ID: <200707131721.l6DHLtPI031526@databaseadvisors.com> John, See answers below... Old server was Dual PIII 1 ghz, 4 GIG ram At 12:00 PM 7/13/2007, you wrote: >Date: Thu, 12 Jul 2007 14:36:22 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 >To: >Message-ID: <20070712183623.419D1BFB2 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Robert, > >Have you done any timing testing for large data sets? Our largest query is against a current and archive table of Logins. It has over 32 million records in a union query. on the new server, it took about 1/10 the time. >Any "gut feelings" for speed differences? The first comment was that the Access app that was running against it was so fast the users might complain. (smile) I would say overall, about 4 times faster. > >Did you have to purchase a different version of SQL Server or does the 64 >bit come with the 32 bit and "just start working"? You have to have both x64 Windows and x64 SQL. They are separate, not just the x32. Although, you can install x32 SQL on a x64 OS. > >Or did you get brand new machines with preinstalled software? We got the software ourselves because we could get it cheaper. >John W. Colby From jwcolby at colbyconsulting.com Fri Jul 13 16:51:47 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 17:51:47 -0400 Subject: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 In-Reply-To: <200707131721.l6DHLtPI031526@databaseadvisors.com> Message-ID: <20070713215149.8B44DBD49@smtp-auth.no-ip.com> Robert, So it is really tough to say how much comes from 64 bit software and how much from new hardware. Moving from a PIII 1 GHz 4 gig ram to a modern dual core, probably close to 4 or 5 GHz equivalent, plus 8 gig memory, it might ALL be from the better hardware. I am going to have to try myself though. I am waiting (impatiently) for AMD to release their "true quad core" processor to try to get a feel for how it competes with the currently available quad core from Intel. Once I can get that sense I will be making a purchase decision on a new server to run x64 bit OS and SQL Server. I am running queries on 50 million record tables with anywhere from 2 to 20 or more fields in where clauses, joined to similar sized tables doing wheres on (typically) a zip field. The result sets are then often counted, and sometimes address data is pulled into result sets for export. My query run times are just horrendous. I can't help but feel that if I could run x64 and 32 GByte of ram vs. x32 and 4 GB ram (current config) that the difference would be worth the expense. I simply cannot do that though without the x64 OS / SQL Server. To some extent I am going to be in the same boat re hardware vs. software speed increase though. I can possibly run Windows Server x64 on my current hardware, but that hardware is a dual core AMD limited to 8 gb of RAM. So while even that (moving to 8 gb) would no doubt make a difference it would probably not be enough difference to be worth doing all by itself, especially given the cost of the software. OTOH if I could go to a dual processor quad core with 32 GB (or even 64 gb), THAT should open things up for me. And interestingly, the cost of the hardware to do that is reasonable, at least "build it yourself". I can build a system for about $4500 for a dual processor quad core Intel with 32 gb of RAM (no disks / raid controller - which I already have) and around $7000 with 64 gb of ram. Of course that is WITHOUT the X64 OS and SQL Server. Do you know how much you paid for the X64 software? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Friday, July 13, 2007 1:18 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 John, See answers below... Old server was Dual PIII 1 ghz, 4 GIG ram At 12:00 PM 7/13/2007, you wrote: >Date: Thu, 12 Jul 2007 14:36:22 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 >To: >Message-ID: <20070712183623.419D1BFB2 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Robert, > >Have you done any timing testing for large data sets? Our largest query is against a current and archive table of Logins. It has over 32 million records in a union query. on the new server, it took about 1/10 the time. >Any "gut feelings" for speed differences? The first comment was that the Access app that was running against it was so fast the users might complain. (smile) I would say overall, about 4 times faster. > >Did you have to purchase a different version of SQL Server or does the >64 bit come with the 32 bit and "just start working"? You have to have both x64 Windows and x64 SQL. They are separate, not just the x32. Although, you can install x32 SQL on a x64 OS. > >Or did you get brand new machines with preinstalled software? We got the software ourselves because we could get it cheaper. >John W. Colby _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fhtapia at gmail.com Sat Jul 14 08:02:20 2007 From: fhtapia at gmail.com (Francisco Tapia) Date: Sat, 14 Jul 2007 06:02:20 -0700 Subject: [dba-SQLServer] [dba-VB] Windows 2003 x64; SQL Server 2005 X64 In-Reply-To: <20070713215149.8B44DBD49@smtp-auth.no-ip.com> References: <200707131721.l6DHLtPI031526@databaseadvisors.com> <20070713215149.8B44DBD49@smtp-auth.no-ip.com> Message-ID: John, I think that the biggest performance increased you will find will be from the hardware. Although some is related to the 64 Bit environment, such as the ability to address the upper memory above 3gb without having to go through /pae. In our situation we have hp servers on opterons. We're on sap now so we get triplicate servers for all environments, such as dev/test/prod. In the prod and test environment things just zip along (and they should) we have 4 cpus (dual core) and the system is plugged into our high performance san. The dev boxes have only 2 (dual core) and local disk high performance raid 5 with dedicated buses for the tlogs. The result our test and prod servers scream performance while our dev server struggles to keep up. On 7/13/07, jwcolby wrote: > Robert, > > So it is really tough to say how much comes from 64 bit software and how > much from new hardware. Moving from a PIII 1 GHz 4 gig ram to a modern dual > core, probably close to 4 or 5 GHz equivalent, plus 8 gig memory, it might > ALL be from the better hardware. > > I am going to have to try myself though. I am waiting (impatiently) for AMD > to release their "true quad core" processor to try to get a feel for how it > competes with the currently available quad core from Intel. Once I can get > that sense I will be making a purchase decision on a new server to run x64 > bit OS and SQL Server. I am running queries on 50 million record tables > with anywhere from 2 to 20 or more fields in where clauses, joined to > similar sized tables doing wheres on (typically) a zip field. The result > sets are then often counted, and sometimes address data is pulled into > result sets for export. My query run times are just horrendous. I can't > help but feel that if I could run x64 and 32 GByte of ram vs. x32 and 4 GB > ram (current config) that the difference would be worth the expense. I > simply cannot do that though without the x64 OS / SQL Server. > > To some extent I am going to be in the same boat re hardware vs. software > speed increase though. I can possibly run Windows Server x64 on my current > hardware, but that hardware is a dual core AMD limited to 8 gb of RAM. So > while even that (moving to 8 gb) would no doubt make a difference it would > probably not be enough difference to be worth doing all by itself, > especially given the cost of the software. OTOH if I could go to a dual > processor quad core with 32 GB (or even 64 gb), THAT should open things up > for me. > > And interestingly, the cost of the hardware to do that is reasonable, at > least "build it yourself". I can build a system for about $4500 for a dual > processor quad core Intel with 32 gb of RAM (no disks / raid controller - > which I already have) and around $7000 with 64 gb of ram. Of course that is > WITHOUT the X64 OS and SQL Server. > > Do you know how much you paid for the X64 software? > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert > Sent: Friday, July 13, 2007 1:18 PM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 > > John, > > See answers below... > > Old server was > Dual PIII 1 ghz, 4 GIG ram > > At 12:00 PM 7/13/2007, you wrote: > >Date: Thu, 12 Jul 2007 14:36:22 -0400 > >From: "jwcolby" > >Subject: Re: [dba-SQLServer] Windows 2003 x64; SQL Server 2005 X64 > >To: > >Message-ID: <20070712183623.419D1BFB2 at smtp-auth.no-ip.com> > >Content-Type: text/plain; charset="us-ascii" > > > >Robert, > > > >Have you done any timing testing for large data sets? > > Our largest query is against a current and archive table of Logins. > It has over 32 million records in a union query. on the new server, it took > about 1/10 the time. > > >Any "gut feelings" for speed differences? > > The first comment was that the Access app that was running against it was so > fast the users might complain. (smile) I would say overall, about 4 times > faster. > > > > >Did you have to purchase a different version of SQL Server or does the > >64 bit come with the 32 bit and "just start working"? > > You have to have both x64 Windows and x64 SQL. > They are separate, not just the x32. Although, you can install x32 SQL on a > x64 OS. > > > > >Or did you get brand new machines with preinstalled software? > > We got the software ourselves because we could get it cheaper. > > > >John W. Colby > > _______________________________________________ > 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 > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From jwcolby at colbyconsulting.com Thu Jul 19 12:02:55 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 13:02:55 -0400 Subject: [dba-SQLServer] Renaming the database / files Message-ID: <20070719170257.DD00CBD21@smtp-auth.no-ip.com> I want to rename a database, both at the file level and at the name level (what SQL Server sees it as). I am afraid to just rename the files themselves lest there be some something somewhere that causes it to fail to reattach. How is this done "the right way"? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 19 12:32:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 13:32:23 -0400 Subject: [dba-SQLServer] Renaming the database / files In-Reply-To: <20070719170257.DD00CBD21@smtp-auth.no-ip.com> Message-ID: <20070719173226.64410BF6B@smtp-auth.no-ip.com> Never mind. I tried just renaming the files and reattaching them which (once I "found them" with file find) worked just fine. It set it up in the database tree as the old name. I then just renamed the file and voila. Sorry for the ring. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 1:03 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Renaming the database / files I want to rename a database, both at the file level and at the name level (what SQL Server sees it as). I am afraid to just rename the files themselves lest there be some something somewhere that causes it to fail to reattach. How is this done "the right way"? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 14:15:54 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:15:54 -0400 Subject: [dba-SQLServer] Advantages to separate databases Message-ID: <20070719191556.95C2BBCCB@smtp-auth.no-ip.com> I have a situation where I import tens of millions of records of raw data (as I call it) into SQL Server. I turn right around and send the name / address out for processing and when I get that back I import that back into SQL Server in a separate table. Is there any advantage to bringing that second table (addresses) back in to the same database that I have the raw data in? The way I use the data is that I add a PK long autoincrement to the raw data table and export that with the name / address. Thus when the data comes back in from address processing each record coming back has a PKID that matches a record in the raw data table. When I build queries I often do a join on PKID between raw and address and then select fields from both. It appears to me that having them in separate database files is actually an advantage in many ways. For one, the data in the raw data file can be archived once and never touched again as far as backup is concerned. The data in that table never changes. Also it seems that I might be able to place the two files (raw and address) on separate machines and get some parallelism going in processing where clauses etc. It may in fact be exactly the opposite and I would NOT want to set the two databases on separate machines though, I am certainly no expert on anything SQL Server related. Any thoughts on the pros and cons here? John W. Colby Colby Consulting www.ColbyConsulting.com From ebarro at verizon.net Thu Jul 19 14:52:30 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 19 Jul 2007 12:52:30 -0700 Subject: [dba-SQLServer] Advantages to separate databases In-Reply-To: <20070719191556.95C2BBCCB@smtp-auth.no-ip.com> Message-ID: <0JLF006L4Z70KLDA@vms048.mailsrvcs.net> If you set up the database to be on two different machines or instances of SQL server you will need to use linked servers and will need to reference objects in this manner... Server.database.dbo.object You won't be able to use nolock hints when you use linked servers. If you use separate databases on the same SQL server instance then you can reference objects in this manner... Database.dbo.object You will be able to use nolock hints in your queries, sprocs, udfs, etc... -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:16 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Advantages to separate databases I have a situation where I import tens of millions of records of raw data (as I call it) into SQL Server. I turn right around and send the name / address out for processing and when I get that back I import that back into SQL Server in a separate table. Is there any advantage to bringing that second table (addresses) back in to the same database that I have the raw data in? The way I use the data is that I add a PK long autoincrement to the raw data table and export that with the name / address. Thus when the data comes back in from address processing each record coming back has a PKID that matches a record in the raw data table. When I build queries I often do a join on PKID between raw and address and then select fields from both. It appears to me that having them in separate database files is actually an advantage in many ways. For one, the data in the raw data file can be archived once and never touched again as far as backup is concerned. The data in that table never changes. Also it seems that I might be able to place the two files (raw and address) on separate machines and get some parallelism going in processing where clauses etc. It may in fact be exactly the opposite and I would NOT want to set the two databases on separate machines though, I am certainly no expert on anything SQL Server related. Any thoughts on the pros and cons here? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 15:00:07 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 16:00:07 -0400 Subject: [dba-SQLServer] Advantages to separate databases In-Reply-To: <0JLF006L4Z70KLDA@vms048.mailsrvcs.net> Message-ID: <20070719200009.7EDAEBF78@smtp-auth.no-ip.com> OK. Thanks for that. Now, do I get any processing power from the remote server if the two tables are on separate machines? I often run queries on my laptop. I build a database (if none exists) into which I build views (just for ease of use and storage of the SQL). I currently have all of the databases on a single machine but I have considered trying to place various databases on different servers simply to see if I could get each server to perform some part of the processing of the query. Distribution of processing load. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, July 19, 2007 3:53 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Advantages to separate databases If you set up the database to be on two different machines or instances of SQL server you will need to use linked servers and will need to reference objects in this manner... Server.database.dbo.object You won't be able to use nolock hints when you use linked servers. If you use separate databases on the same SQL server instance then you can reference objects in this manner... Database.dbo.object You will be able to use nolock hints in your queries, sprocs, udfs, etc... -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:16 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Advantages to separate databases I have a situation where I import tens of millions of records of raw data (as I call it) into SQL Server. I turn right around and send the name / address out for processing and when I get that back I import that back into SQL Server in a separate table. Is there any advantage to bringing that second table (addresses) back in to the same database that I have the raw data in? The way I use the data is that I add a PK long autoincrement to the raw data table and export that with the name / address. Thus when the data comes back in from address processing each record coming back has a PKID that matches a record in the raw data table. When I build queries I often do a join on PKID between raw and address and then select fields from both. It appears to me that having them in separate database files is actually an advantage in many ways. For one, the data in the raw data file can be archived once and never touched again as far as backup is concerned. The data in that table never changes. Also it seems that I might be able to place the two files (raw and address) on separate machines and get some parallelism going in processing where clauses etc. It may in fact be exactly the opposite and I would NOT want to set the two databases on separate machines though, I am certainly no expert on anything SQL Server related. Any thoughts on the pros and cons here? John W. Colby Colby Consulting 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 john at winhaven.net Fri Jul 20 10:01:37 2007 From: john at winhaven.net (John Bartow) Date: Fri, 20 Jul 2007 10:01:37 -0500 Subject: [dba-SQLServer] Request for new DBA List to discuss specific subjects Message-ID: <00fe01c7cade$e0dae1e0$6402a8c0@ScuzzPaq> If anyone has a request for a new DBA list to discuss a specific subject please email me directly. Also, please leave this subject line in tact so I can sort these messages into a new email folder. Thanks, John Bartow, President Database Advisors, Inc. Email: mailto:president at databaseadvisors.com Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 11:10:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 12:10:37 -0400 Subject: [dba-SQLServer] [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070724161047.DA2F0BC81@smtp-auth.no-ip.com> One issue I am running into is that I really want to be able to log the start / stop PKID of each record imported. I use an autoincrement in SQL Server, but I do not know how to get at the last PKID in these values "live" as the SQLBulkInsert runs. Is it possible to pull the value of a field back out of the SQLBulkInsert object? Do I have to execute a sql statement to "get" the value of the PKID of the last record before the import and the last record after the import? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jul 24 12:35:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 13:35:56 -0400 Subject: [dba-SQLServer] The command object exception Message-ID: <20070724173606.D7354BCD1@smtp-auth.no-ip.com> I am trying to execute queries that build databases, build tables etc. When I executed the ExecuteNonQuery method with a query that built a database and the database already exists, I got an error returned of -2147217900. When I tried to execute a sql statement with a general error I got the same error returned. How do I get meaningful error codes back from ExecuteNonQuery? Try mobjCmd.ExecuteNonQuery() Catch ex As OleDbException Select Case ex.ErrorCode Case -2147217900 'database already exists so ignore the error Case Else MessageBox.Show(ex.Message) Return -3 End Select End Try John W. Colby Colby Consulting www.ColbyConsulting.com From fuller.artful at gmail.com Wed Jul 25 12:23:32 2007 From: fuller.artful at gmail.com (Arthur Fuller) Date: Wed, 25 Jul 2007 13:23:32 -0400 Subject: [dba-SQLServer] [dba-VB] How I'm approaching the problem In-Reply-To: <20070724161047.DA2F0BC81@smtp-auth.no-ip.com> References: <001101c7cd63$a3ae3d30$6401a8c0@nant> <20070724161047.DA2F0BC81@smtp-auth.no-ip.com> Message-ID: <29f585dd0707251023hb9f9d4emf36c646da322b2b2@mail.gmail.com> My computer is a bit wonky currently, not to mention my memory, but I think that you need to investigate SET IDENTITY INSERT on/off in BOL. It's something like your theory about the zero'th row. You can force identity keys in using this. If my exact syntax was wrong, I apologize, but I'm currently rebuilding this box so only certain things work at the moment. Hopefully, this will lead you toward a solution. A. On 7/24/07, jwcolby wrote: > > One issue I am running into is that I really want to be able to log the > start / stop PKID of each record imported. I use an autoincrement in SQL > Server, but I do not know how to get at the last PKID in these values > "live" > as the SQLBulkInsert runs. Is it possible to pull the value of a field > back > out of the SQLBulkInsert object? Do I have to execute a sql statement to > "get" the value of the PKID of the last record before the import and the > last record after the import? > > From jwcolby at colbyconsulting.com Thu Jul 26 10:09:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 26 Jul 2007 11:09:30 -0400 Subject: [dba-SQLServer] Temp db Message-ID: <20070726150944.5BB49BBF5@smtp-auth.no-ip.com> Under what condition is a tempdb created? How can I predict the size? I am looking at using a hardware ram disk to store the tempdb but I don't want to get into this only to find out that the tempdb is larger than the available ram disk (4 or possibly 8 gbytes max). John W. Colby Colby Consulting www.ColbyConsulting.com From tuxedoman888 at gmail.com Thu Jul 26 11:22:27 2007 From: tuxedoman888 at gmail.com (Billy Pang) Date: Thu, 26 Jul 2007 09:22:27 -0700 Subject: [dba-SQLServer] Temp db In-Reply-To: <20070726150944.5BB49BBF5@smtp-auth.no-ip.com> References: <20070726150944.5BB49BBF5@smtp-auth.no-ip.com> Message-ID: <7c8826480707260922h6d4f023dw37bc7294f556412b@mail.gmail.com> tempdb is created when sql server service starts (old one is dropped) tempdb is copied from the model db http://www.microsoft.com/technet/prodtechnol/sql/2005/workingwithtempdb.mspx On 7/26/07, jwcolby wrote: > > Under what condition is a tempdb created? How can I predict the size? > > I am looking at using a hardware ram disk to store the tempdb but I don't > want to get into this only to find out that the tempdb is larger than the > available ram disk (4 or possibly 8 gbytes max). > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Billy Pang http://dbnotes.blogspot.com/ "Once the game is over, the King and the pawn go back in the same box." - Italian proverb From fuller.artful at gmail.com Thu Jul 26 22:18:38 2007 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 26 Jul 2007 23:18:38 -0400 Subject: [dba-SQLServer] Temp db In-Reply-To: <7c8826480707260922h6d4f023dw37bc7294f556412b@mail.gmail.com> References: <20070726150944.5BB49BBF5@smtp-auth.no-ip.com> <7c8826480707260922h6d4f023dw37bc7294f556412b@mail.gmail.com> Message-ID: <29f585dd0707262018p792846d4v2f2d759ed6bcf049@mail.gmail.com> Quite right, Billy. I meant to say a temp table. Sorry for any confusion there. On 7/26/07, Billy Pang wrote: > > tempdb is created when sql server service starts (old one is dropped) > tempdb is copied from the model db > > > http://www.microsoft.com/technet/prodtechnol/sql/2005/workingwithtempdb.mspx > > > On 7/26/07, jwcolby wrote: > > > > Under what condition is a tempdb created? How can I predict the size? > > > > I am looking at using a hardware ram disk to store the tempdb but I > don't > > want to get into this only to find out that the tempdb is larger than > the > > available ram disk (4 or possibly 8 gbytes max). > > > > John W. Colby > > Colby Consulting > > www.ColbyConsulting.com > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > -- > Billy Pang > http://dbnotes.blogspot.com/ > "Once the game is over, the King and the pawn go back in the same box." - > Italian proverb > _______________________________________________ > 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 Sun Jul 29 00:46:58 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 29 Jul 2007 01:46:58 -0400 Subject: [dba-SQLServer] Accessing SQL Server over the internet Message-ID: <20070729054701.DCF13BDDF@smtp-auth.no-ip.com> Is it possible to connect to a SQL Server database over a HAMACHI VPN connection? If so how? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sun Jul 29 00:53:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 29 Jul 2007 01:53:30 -0400 Subject: [dba-SQLServer] Windows shutdown Message-ID: <20070729055333.7F146BD63@smtp-auth.no-ip.com> It appears that once SQL Server is accessed from another computer, it hangs windows attempting to shut down. IOW the server shuts down just fine until I access SQL Server - look at data, try to design a table etc. After that point Windows 2003 simply refuses to shut down / restart. Often it will completely clear the screen, explorer itself will shut down (and not reopen) but the server simply will not reboot and a hard reboot (push the power button is the only way to get it to reboot. Furthermore, while it is in this state, you can get back in to SQL Server from another machine which again indicates that SQL Server services are refusing to shut down. Any thoughts or suggestions on how to force the shutdown / reboot? John W. Colby Colby Consulting www.ColbyConsulting.com From spike at tenbus.co.uk Sun Jul 29 01:33:14 2007 From: spike at tenbus.co.uk (Webadmin - Tenbus) Date: Sun, 29 Jul 2007 07:33:14 +0100 Subject: [dba-SQLServer] Windows shutdown In-Reply-To: <20070729055333.7F146BD63@smtp-auth.no-ip.com> References: <20070729055333.7F146BD63@smtp-auth.no-ip.com> Message-ID: <46AC34AA.1070905@tenbus.co.uk> Hi John! This is WAY outside of my field of experience! But I wonder if the SQL Server is stopping the OS shutting down if it thinks someone (your other computer) is still connected. Maybe your other machine needs to positivly disconnect - a bit like the recordset=none (or whatever) we use in Access. Just a total WAG John! Regards Chris Foote jwcolby wrote: > It appears that once SQL Server is accessed from another computer, it hangs > windows attempting to shut down. IOW the server shuts down just fine until > I access SQL Server - look at data, try to design a table etc. After that > point Windows 2003 simply refuses to shut down / restart. Often it will > completely clear the screen, explorer itself will shut down (and not reopen) > but the server simply will not reboot and a hard reboot (push the power > button is the only way to get it to reboot. Furthermore, while it is in > this state, you can get back in to SQL Server from another machine which > again indicates that SQL Server services are refusing to shut down. > > Any thoughts or suggestions on how to force the shutdown / reboot? > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > From spike at tenbus.co.uk Sun Jul 29 01:45:45 2007 From: spike at tenbus.co.uk (Webadmin - Tenbus) Date: Sun, 29 Jul 2007 07:45:45 +0100 Subject: [dba-SQLServer] Windows shutdown In-Reply-To: <46AC34AA.1070905@tenbus.co.uk> References: <20070729055333.7F146BD63@smtp-auth.no-ip.com> <46AC34AA.1070905@tenbus.co.uk> Message-ID: <46AC3799.7060100@tenbus.co.uk> Sorry - I did not express that very well! What I was trying to suggest is that (probably correctly for a server) the OS will not shut down if the SQL Server is still running and (possibly) serving data. I think you need to stop the SQL Server before you shut down the OS. I'm not a server guy, and it is Sunday morning in England but that's what I'd look at in your situation. Regards! Chris Foote Webadmin - Tenbus wrote: > Hi John! > > This is WAY outside of my field of experience! But I wonder if the SQL > Server is stopping the OS shutting down if it thinks someone (your other > computer) is still connected. Maybe your other machine needs to > positivly disconnect - a bit like the recordset=none (or whatever) we > use in Access. > > Just a total WAG John! > > Regards > Chris Foote > > jwcolby wrote: > >> It appears that once SQL Server is accessed from another computer, it hangs >> windows attempting to shut down. IOW the server shuts down just fine until >> I access SQL Server - look at data, try to design a table etc. After that >> point Windows 2003 simply refuses to shut down / restart. Often it will >> completely clear the screen, explorer itself will shut down (and not reopen) >> but the server simply will not reboot and a hard reboot (push the power >> button is the only way to get it to reboot. Furthermore, while it is in >> this state, you can get back in to SQL Server from another machine which >> again indicates that SQL Server services are refusing to shut down. >> >> Any thoughts or suggestions on how to force the shutdown / reboot? >> >> John W. Colby >> Colby Consulting >> 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 accessd at shaw.ca Sun Jul 29 02:23:55 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 29 Jul 2007 00:23:55 -0700 Subject: [dba-SQLServer] Accessing SQL Server over the internet In-Reply-To: <20070729054701.DCF13BDDF@smtp-auth.no-ip.com> Message-ID: <0JLX00KSBJ0FVNC2@l-daemon> Hi John: An interesting question; I am working on a similar project since June but have been delayed due to immediate projects. The simplest way would be to create a share on the remote site to the SQL DB, install Hamachi on the remote computer and then you could link from the local SQL server, through the EM to the remote DB. Or connect to the remote DB through a connection string could look like: "Provider=SQLOLEDB; Initial Catalog=Registration; Data Source=\\5.24.64.128\MsDB; Integrated Security=SSPI". Do this all the time for remote backup but have not had a chance to test all the variations for MS SQL. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 28, 2007 10:47 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Accessing SQL Server over the internet Is it possible to connect to a SQL Server database over a HAMACHI VPN connection? If so how? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fhtapia at gmail.com Sun Jul 29 09:40:19 2007 From: fhtapia at gmail.com (Francisco Tapia) Date: Sun, 29 Jul 2007 07:40:19 -0700 Subject: [dba-SQLServer] Accessing SQL Server over the internet In-Reply-To: <20070729054701.DCF13BDDF@smtp-auth.no-ip.com> References: <20070729054701.DCF13BDDF@smtp-auth.no-ip.com> Message-ID: Yes On 7/28/07, jwcolby wrote: > > Is it possible to connect to a SQL Server database over a HAMACHI VPN > connection? If so how? > > John W. Colby > Colby Consulting > 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 fhtapia at gmail.com Sun Jul 29 09:40:50 2007 From: fhtapia at gmail.com (Francisco Tapia) Date: Sun, 29 Jul 2007 07:40:50 -0700 Subject: [dba-SQLServer] Accessing SQL Server over the internet In-Reply-To: References: <20070729054701.DCF13BDDF@smtp-auth.no-ip.com> Message-ID: by using tcp/ip connectivity, check your ip and connection string. On 7/29/07, Francisco Tapia wrote: > > Yes > > On 7/28/07, jwcolby wrote: > > > > Is it possible to connect to a SQL Server database over a HAMACHI VPN > > connection? If so how? > > > > John W. Colby > > Colby Consulting > > 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... -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From jwcolby at colbyconsulting.com Sun Jul 29 21:51:27 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 29 Jul 2007 22:51:27 -0400 Subject: [dba-SQLServer] Windows shutdown In-Reply-To: <46AC3799.7060100@tenbus.co.uk> Message-ID: <20070730025132.54690BD27@smtp-auth.no-ip.com> Well, you win the WAG award! I found something somewhere that says to prevent hanging, shut down all application services before shutting down the server. I will give that a try and see what happens. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Webadmin - Tenbus Sent: Sunday, July 29, 2007 2:46 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Windows shutdown Sorry - I did not express that very well! What I was trying to suggest is that (probably correctly for a server) the OS will not shut down if the SQL Server is still running and (possibly) serving data. I think you need to stop the SQL Server before you shut down the OS. I'm not a server guy, and it is Sunday morning in England but that's what I'd look at in your situation. Regards! Chris Foote Webadmin - Tenbus wrote: > Hi John! > > This is WAY outside of my field of experience! But I wonder if the SQL > Server is stopping the OS shutting down if it thinks someone (your > other > computer) is still connected. Maybe your other machine needs to > positivly disconnect - a bit like the recordset=none (or whatever) we > use in Access. > > Just a total WAG John! > > Regards > Chris Foote > > jwcolby wrote: > >> It appears that once SQL Server is accessed from another computer, it >> hangs windows attempting to shut down. IOW the server shuts down >> just fine until I access SQL Server - look at data, try to design a >> table etc. After that point Windows 2003 simply refuses to shut down >> / restart. Often it will completely clear the screen, explorer >> itself will shut down (and not reopen) but the server simply will not >> reboot and a hard reboot (push the power button is the only way to >> get it to reboot. Furthermore, while it is in this state, you can >> get back in to SQL Server from another machine which again indicates that SQL Server services are refusing to shut down. >> >> Any thoughts or suggestions on how to force the shutdown / reboot? >> >> John W. Colby >> Colby Consulting >> www.ColbyConsulting.com >> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> >> >> >> > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 00:46:51 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 01:46:51 -0400 Subject: [dba-SQLServer] Windows shutdown In-Reply-To: <20070730025132.54690BD27@smtp-auth.no-ip.com> Message-ID: <20070730054657.735DCBC71@smtp-auth.no-ip.com> Well I have discovered that shutting down two SQL Server services before shutdown appears to prevent the hang at reboot so there ya are. I built a cmd batch file to do the service shutdown and then a reboot and all appears to be well. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 29, 2007 10:51 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Windows shutdown Well, you win the WAG award! I found something somewhere that says to prevent hanging, shut down all application services before shutting down the server. I will give that a try and see what happens. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Webadmin - Tenbus Sent: Sunday, July 29, 2007 2:46 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Windows shutdown Sorry - I did not express that very well! What I was trying to suggest is that (probably correctly for a server) the OS will not shut down if the SQL Server is still running and (possibly) serving data. I think you need to stop the SQL Server before you shut down the OS. I'm not a server guy, and it is Sunday morning in England but that's what I'd look at in your situation. Regards! Chris Foote