From newsgrps at dalyn.co.nz Sun Feb 1 11:27:43 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 02 Feb 2009 06:27:43 +1300 Subject: [dba-SQLServer] Importing From Access to SQL2005 Message-ID: <20090201172657.UTOP21395.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> Group, This is frustrating. I have SQL 2005 installed (I believe it is the full version and not Enterprise). About a month ago I created the equivalent of a data transformation package to copy data from an Access database into some SQL tables. Now when I try to find where the package is in SQL Server Management studio I can't find where packages are stored. Can anyone please give me some pointers as to where they should appear? From ab-mi at post3.tele.dk Sun Feb 1 12:32:00 2009 From: ab-mi at post3.tele.dk (Asger Blond) Date: Sun, 1 Feb 2009 19:32:00 +0100 Subject: [dba-SQLServer] Importing From Access to SQL2005 In-Reply-To: <20090201172657.UTOP21395.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <000001c9849b$5f4ae170$2301a8c0@AB> In SQL Server Management Studio connect to Integration Services, then expand the folder Stored Packages. Asger -----Oprindelig meddelelse----- Fra: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 1. februar 2009 18:28 Til: dba-SQLServer at databaseadvisors.com Emne: [dba-SQLServer] Importing From Access to SQL2005 Group, This is frustrating. I have SQL 2005 installed (I believe it is the full version and not Enterprise). About a month ago I created the equivalent of a data transformation package to copy data from an Access database into some SQL tables. Now when I try to find where the package is in SQL Server Management studio I can't find where packages are stored. Can anyone please give me some pointers as to where they should appear? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Sun Feb 1 23:24:02 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 02 Feb 2009 18:24:02 +1300 Subject: [dba-SQLServer] Importing From Access to SQL2005 In-Reply-To: <000001c9849b$5f4ae170$2301a8c0@AB> References: <20090201172657.UTOP21395.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <000001c9849b$5f4ae170$2301a8c0@AB> Message-ID: <20090202052310.WVJO26672.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> OK - Finally found this and had to change the configuration setting because I had SQL2000 also running on the same computer. (Error about Encryption not supported yada yada yada. But I still cant find the package in any of the folders. I know I didn't delete it. David At 2/02/2009, you wrote: >In SQL Server Management Studio connect to Integration Services, then expand >the folder Stored Packages. > >Asger > >-----Oprindelig meddelelse----- >Fra: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David >Emerson >Sendt: 1. februar 2009 18:28 >Til: dba-SQLServer at databaseadvisors.com >Emne: [dba-SQLServer] Importing From Access to SQL2005 > >Group, > >This is frustrating. I have SQL 2005 installed (I believe it is the >full version and not Enterprise). About a month ago I created the >equivalent of a data transformation package to copy data from an >Access database into some SQL tables. > >Now when I try to find where the package is in SQL Server Management >studio I can't find where packages are stored. > >Can anyone please give me some pointers as to where they should appear? > >_______________________________________________ >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 ab-mi at post3.tele.dk Mon Feb 2 03:37:21 2009 From: ab-mi at post3.tele.dk (Asger Blond) Date: Mon, 2 Feb 2009 10:37:21 +0100 Subject: [dba-SQLServer] Importing From Access to SQL2005 In-Reply-To: <20090202052310.WVJO26672.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <000f01c98519$d95d3250$2301a8c0@AB> An SSIS package can be stored in two different locations: 1) SQL Server. When stored here the package exists in the system table msdb.dbo.sysdtspackages90 (the content of the package is stored in a column named packagedata). And when stored here you can see it in Management Studio connecting to Integration Services in the folder Stored Packages | MSDB. 2) File System. When stored here the package only exists in the file system, not in msdb.dbo.sysdtspackages90. You may be able to see a file system package in Management Studio connecting to Integration Services in the folder Stored Packages | File System. But this folder only shows packages stored in the disk-folder for SSIS packages, i.e. C:\Program Files\Microsoft SQL Server\90\DTS\Packages\ As you don't see your package in Stored Packages in Integration Services I suppose it's saved to the file system in a folder other than said disk-folder for SSIS packages. You then have manually to browse your disk for it (dir \*.dtsx /s). If you find the package and if you want it to show up in Integration Services in the folder Stores Packages | File System you can move or copy it to said disk-folder for SSIS packages, or you can import it right-clicking the File System folder in Integration Services and choosing Import Package... Asger -----Oprindelig meddelelse----- Fra: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 2. februar 2009 06:24 Til: Discussion concerning MS SQL Server Emne: Re: [dba-SQLServer] Importing From Access to SQL2005 OK - Finally found this and had to change the configuration setting because I had SQL2000 also running on the same computer. (Error about Encryption not supported yada yada yada. But I still cant find the package in any of the folders. I know I didn't delete it. David At 2/02/2009, you wrote: >In SQL Server Management Studio connect to Integration Services, then expand >the folder Stored Packages. > >Asger > >-----Oprindelig meddelelse----- >Fra: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David >Emerson >Sendt: 1. februar 2009 18:28 >Til: dba-SQLServer at databaseadvisors.com >Emne: [dba-SQLServer] Importing From Access to SQL2005 > >Group, > >This is frustrating. I have SQL 2005 installed (I believe it is the >full version and not Enterprise). About a month ago I created the >equivalent of a data transformation package to copy data from an >Access database into some SQL tables. > >Now when I try to find where the package is in SQL Server Management >studio I can't find where packages are stored. > >Can anyone please give me some pointers as to where they should appear? > >_______________________________________________ >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 markamatte at hotmail.com Mon Feb 2 09:07:56 2009 From: markamatte at hotmail.com (Mark A Matte) Date: Mon, 2 Feb 2009 15:07:56 +0000 Subject: [dba-SQLServer] Importing From Access to SQL2005 In-Reply-To: <20090202052310.WVJO26672.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> References: <20090201172657.UTOP21395.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <000001c9849b$5f4ae170$2301a8c0@AB> <20090202052310.WVJO26672.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: Everytime I lose a project/sql statement or anything in SQL Server...I always find it in: "C:\Documents and Settings\'yourID'\My Documents\SQL Server Management Studio\Projects" Good luck, Mark ---------------------------------------- > Date: Mon, 2 Feb 2009 18:24:02 +1300 > To: dba-sqlserver at databaseadvisors.com > From: newsgrps at dalyn.co.nz > Subject: Re: [dba-SQLServer] Importing From Access to SQL2005 > > OK - Finally found this and had to change the > configuration setting because I had SQL2000 also > running on the same computer. (Error about > Encryption not supported yada yada yada. > > But I still cant find the package in any of the > folders. I know I didn't delete it. > > David > > At 2/02/2009, you wrote: >>In SQL Server Management Studio connect to Integration Services, then expand >>the folder Stored Packages. >> >>Asger >> >>-----Oprindelig meddelelse----- >>Fra: dba-sqlserver-bounces at databaseadvisors.com >>[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David >>Emerson >>Sendt: 1. februar 2009 18:28 >>Til: dba-SQLServer at databaseadvisors.com >>Emne: [dba-SQLServer] Importing From Access to SQL2005 >> >>Group, >> >>This is frustrating. I have SQL 2005 installed (I believe it is the >>full version and not Enterprise). About a month ago I created the >>equivalent of a data transformation package to copy data from an >>Access database into some SQL tables. >> >>Now when I try to find where the package is in SQL Server Management >>studio I can't find where packages are stored. >> >>Can anyone please give me some pointers as to where they should appear? >> >>_______________________________________________ >>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 > _________________________________________________________________ Windows Live?: E-mail. Chat. Share. Get more ways to connect. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009 From newsgrps at dalyn.co.nz Mon Feb 2 10:45:03 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 03 Feb 2009 05:45:03 +1300 Subject: [dba-SQLServer] Importing From Access to SQL2005 In-Reply-To: References: <20090201172657.UTOP21395.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <000001c9849b$5f4ae170$2301a8c0@AB> <20090202052310.WVJO26672.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <20090202171824.SZKG21395.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks Mark. Not there. At 3/02/2009, you wrote: >Everytime I lose a project/sql statement or >anything in SQL Server...I always find it in: > >"C:\Documents and Settings\'yourID'\My >Documents\SQL Server Management Studio\Projects" > >Good luck, > >Mark > >---------------------------------------- > > Date: Mon, 2 Feb 2009 18:24:02 +1300 > > To: dba-sqlserver at databaseadvisors.com > > From: newsgrps at dalyn.co.nz > > Subject: Re: [dba-SQLServer] Importing From Access to SQL2005 > > > > OK - Finally found this and had to change the > > configuration setting because I had SQL2000 also > > running on the same computer. (Error about > > Encryption not supported yada yada yada. > > > > But I still cant find the package in any of the > > folders. I know I didn't delete it. > > > > David > > > > At 2/02/2009, you wrote: > >>In SQL Server Management Studio connect to > Integration Services, then expand > >>the folder Stored Packages. > >> > >>Asger > >> > >>-----Oprindelig meddelelse----- > >>Fra: dba-sqlserver-bounces at databaseadvisors.com > >>[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David > >>Emerson > >>Sendt: 1. februar 2009 18:28 > >>Til: dba-SQLServer at databaseadvisors.com > >>Emne: [dba-SQLServer] Importing From Access to SQL2005 > >> > >>Group, > >> > >>This is frustrating. I have SQL 2005 installed (I believe it is the > >>full version and not Enterprise). About a month ago I created the > >>equivalent of a data transformation package to copy data from an > >>Access database into some SQL tables. > >> > >>Now when I try to find where the package is in SQL Server Management > >>studio I can't find where packages are stored. > >> > >>Can anyone please give me some pointers as to where they should appear? > >> > >>_______________________________________________ > >>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 > > >_________________________________________________________________ >Windows Live?: E-mail. Chat. Share. Get more ways to connect. >http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009 >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Mon Feb 2 11:14:25 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 03 Feb 2009 06:14:25 +1300 Subject: [dba-SQLServer] Importing From Access to SQL2005 In-Reply-To: <000f01c98519$d95d3250$2301a8c0@AB> References: <20090202052310.WVJO26672.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> <000f01c98519$d95d3250$2301a8c0@AB> Message-ID: <20090202171829.SZWB21395.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks Asger, The package was saved in a different location. I have moved it to the folder below and it now appears in Integrated services. My next problem - How can I open it to edit it? If I right click on it I get a number of options including Run Package, but none to open it for editing. David At 2/02/2009, you wrote: >An SSIS package can be stored in two different locations: >1) SQL Server. When stored here the package exists in the system table >msdb.dbo.sysdtspackages90 (the content of the package is stored in a column >named packagedata). And when stored here you can see it in Management Studio >connecting to Integration Services in the folder Stored Packages | MSDB. >2) File System. When stored here the package only exists in the file system, >not in msdb.dbo.sysdtspackages90. You may be able to see a file system >package in Management Studio connecting to Integration Services in the >folder Stored Packages | File System. But this folder only shows packages >stored in the disk-folder for SSIS packages, i.e. C:\Program Files\Microsoft >SQL Server\90\DTS\Packages\ >As you don't see your package in Stored Packages in Integration Services I >suppose it's saved to the file system in a folder other than said >disk-folder for SSIS packages. You then have manually to browse your disk >for it (dir \*.dtsx /s). >If you find the package and if you want it to show up in Integration >Services in the folder Stores Packages | File System you can move or copy it >to said disk-folder for SSIS packages, or you can import it right-clicking >the File System folder in Integration Services and choosing Import >Package... > >Asger > >-----Oprindelig meddelelse----- >Fra: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David >Emerson >Sendt: 2. februar 2009 06:24 >Til: Discussion concerning MS SQL Server >Emne: Re: [dba-SQLServer] Importing From Access to SQL2005 > >OK - Finally found this and had to change the >configuration setting because I had SQL2000 also >running on the same computer. (Error about >Encryption not supported yada yada yada. > >But I still cant find the package in any of the >folders. I know I didn't delete it. > >David > >At 2/02/2009, you wrote: > >In SQL Server Management Studio connect to Integration Services, then >expand > >the folder Stored Packages. > > > >Asger > > > >-----Oprindelig meddelelse----- > >Fra: dba-sqlserver-bounces at databaseadvisors.com > >[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David > >Emerson > >Sendt: 1. februar 2009 18:28 > >Til: dba-SQLServer at databaseadvisors.com > >Emne: [dba-SQLServer] Importing From Access to SQL2005 > > > >Group, > > > >This is frustrating. I have SQL 2005 installed (I believe it is the > >full version and not Enterprise). About a month ago I created the > >equivalent of a data transformation package to copy data from an > >Access database into some SQL tables. > > > >Now when I try to find where the package is in SQL Server Management > >studio I can't find where packages are stored. > > > >Can anyone please give me some pointers as to where they should appear? > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > > > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com From ab-mi at post3.tele.dk Mon Feb 2 11:56:34 2009 From: ab-mi at post3.tele.dk (Asger Blond) Date: Mon, 2 Feb 2009 18:56:34 +0100 Subject: [dba-SQLServer] Importing From Access to SQL2005 In-Reply-To: <20090202171829.SZWB21395.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <000001c9855f$96d88790$2301a8c0@AB> You can't edit the package in Management Studio. You have to use Visual Studio for that. Asger -----Oprindelig meddelelse----- Fra: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 2. februar 2009 18:14 Til: Discussion concerning MS SQL Server Emne: Re: [dba-SQLServer] Importing From Access to SQL2005 Thanks Asger, The package was saved in a different location. I have moved it to the folder below and it now appears in Integrated services. My next problem - How can I open it to edit it? If I right click on it I get a number of options including Run Package, but none to open it for editing. David At 2/02/2009, you wrote: >An SSIS package can be stored in two different locations: >1) SQL Server. When stored here the package exists in the system table >msdb.dbo.sysdtspackages90 (the content of the package is stored in a column >named packagedata). And when stored here you can see it in Management Studio >connecting to Integration Services in the folder Stored Packages | MSDB. >2) File System. When stored here the package only exists in the file system, >not in msdb.dbo.sysdtspackages90. You may be able to see a file system >package in Management Studio connecting to Integration Services in the >folder Stored Packages | File System. But this folder only shows packages >stored in the disk-folder for SSIS packages, i.e. C:\Program Files\Microsoft >SQL Server\90\DTS\Packages\ >As you don't see your package in Stored Packages in Integration Services I >suppose it's saved to the file system in a folder other than said >disk-folder for SSIS packages. You then have manually to browse your disk >for it (dir \*.dtsx /s). >If you find the package and if you want it to show up in Integration >Services in the folder Stores Packages | File System you can move or copy it >to said disk-folder for SSIS packages, or you can import it right-clicking >the File System folder in Integration Services and choosing Import >Package... > >Asger > >-----Oprindelig meddelelse----- >Fra: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David >Emerson >Sendt: 2. februar 2009 06:24 >Til: Discussion concerning MS SQL Server >Emne: Re: [dba-SQLServer] Importing From Access to SQL2005 > >OK - Finally found this and had to change the >configuration setting because I had SQL2000 also >running on the same computer. (Error about >Encryption not supported yada yada yada. > >But I still cant find the package in any of the >folders. I know I didn't delete it. > >David > >At 2/02/2009, you wrote: > >In SQL Server Management Studio connect to Integration Services, then >expand > >the folder Stored Packages. > > > >Asger > > > >-----Oprindelig meddelelse----- > >Fra: dba-sqlserver-bounces at databaseadvisors.com > >[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David > >Emerson > >Sendt: 1. februar 2009 18:28 > >Til: dba-SQLServer at databaseadvisors.com > >Emne: [dba-SQLServer] Importing From Access to SQL2005 > > > >Group, > > > >This is frustrating. I have SQL 2005 installed (I believe it is the > >full version and not Enterprise). About a month ago I created the > >equivalent of a data transformation package to copy data from an > >Access database into some SQL tables. > > > >Now when I try to find where the package is in SQL Server Management > >studio I can't find where packages are stored. > > > >Can anyone please give me some pointers as to where they should appear? > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > > > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Mon Feb 2 13:08:03 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 03 Feb 2009 08:08:03 +1300 Subject: [dba-SQLServer] Importing From Access to SQL2005 In-Reply-To: <000001c9855f$96d88790$2301a8c0@AB> References: <20090202171829.SZWB21395.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <000001c9855f$96d88790$2301a8c0@AB> Message-ID: <20090202190708.MBVE26672.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> Ah, that rings a bell. That would also explain why the file was in a Visual Studio folder. <:-| Thanks for the help. David At 3/02/2009, you wrote: >You can't edit the package in Management Studio. You have to use Visual >Studio for that. > >Asger > >-----Oprindelig meddelelse----- >Fra: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David >Emerson >Sendt: 2. februar 2009 18:14 >Til: Discussion concerning MS SQL Server >Emne: Re: [dba-SQLServer] Importing From Access to SQL2005 > >Thanks Asger, > >The package was saved in a different location. I >have moved it to the folder below and it now appears in Integrated services. > >My next problem - How can I open it to edit >it? If I right click on it I get a number of >options including Run Package, but none to open it for editing. > >David > >At 2/02/2009, you wrote: > >An SSIS package can be stored in two different locations: > >1) SQL Server. When stored here the package exists in the system table > >msdb.dbo.sysdtspackages90 (the content of the package is stored in a column > >named packagedata). And when stored here you can see it in Management >Studio > >connecting to Integration Services in the folder Stored Packages | MSDB. > >2) File System. When stored here the package only exists in the file >system, > >not in msdb.dbo.sysdtspackages90. You may be able to see a file system > >package in Management Studio connecting to Integration Services in the > >folder Stored Packages | File System. But this folder only shows packages > >stored in the disk-folder for SSIS packages, i.e. C:\Program >Files\Microsoft > >SQL Server\90\DTS\Packages\ > >As you don't see your package in Stored Packages in Integration Services I > >suppose it's saved to the file system in a folder other than said > >disk-folder for SSIS packages. You then have manually to browse your disk > >for it (dir \*.dtsx /s). > >If you find the package and if you want it to show up in Integration > >Services in the folder Stores Packages | File System you can move or copy >it > >to said disk-folder for SSIS packages, or you can import it right-clicking > >the File System folder in Integration Services and choosing Import > >Package... > > > >Asger > > > >-----Oprindelig meddelelse----- > >Fra: dba-sqlserver-bounces at databaseadvisors.com > >[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David > >Emerson > >Sendt: 2. februar 2009 06:24 > >Til: Discussion concerning MS SQL Server > >Emne: Re: [dba-SQLServer] Importing From Access to SQL2005 > > > >OK - Finally found this and had to change the > >configuration setting because I had SQL2000 also > >running on the same computer. (Error about > >Encryption not supported yada yada yada. > > > >But I still cant find the package in any of the > >folders. I know I didn't delete it. > > > >David > > > >At 2/02/2009, you wrote: > > >In SQL Server Management Studio connect to Integration Services, then > >expand > > >the folder Stored Packages. > > > > > >Asger > > > > > >-----Oprindelig meddelelse----- > > >Fra: dba-sqlserver-bounces at databaseadvisors.com > > >[mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af David > > >Emerson > > >Sendt: 1. februar 2009 18:28 > > >Til: dba-SQLServer at databaseadvisors.com > > >Emne: [dba-SQLServer] Importing From Access to SQL2005 > > > > > >Group, > > > > > >This is frustrating. I have SQL 2005 installed (I believe it is the > > >full version and not Enterprise). About a month ago I created the > > >equivalent of a data transformation package to copy data from an > > >Access database into some SQL tables. > > > > > >Now when I try to find where the package is in SQL Server Management > > >studio I can't find where packages are stored. > > > > > >Can anyone please give me some pointers as to where they should appear? > > > > > >_______________________________________________ > > >dba-SQLServer mailing list > > >dba-SQLServer at databaseadvisors.com > > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > >http://www.databaseadvisors.com > > > > > > > > > > > >_______________________________________________ > > >dba-SQLServer mailing list > > >dba-SQLServer at databaseadvisors.com > > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > >http://www.databaseadvisors.com > > > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > > > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com From robert at webedb.com Mon Feb 2 13:03:33 2009 From: robert at webedb.com (Robert L. Stewart) Date: Mon, 02 Feb 2009 13:03:33 -0600 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 71, Issue 8 In-Reply-To: References: Message-ID: <200902021908.n12J8YwR013954@databaseadvisors.com> Jean-Paul, The point is how to join the tables together. They have to have a common field. What is it? Once you get that, they you can work about what data to return. At 12:00 PM 1/31/2009, you wrote: >Date: Sat, 31 Jan 2009 11:54:58 -0500 >From: jean-paul >Subject: Re: [dba-SQLServer] Newbie needs help with select statement >To: >Message-ID: >Content-Type: text/plain; charset="iso-8859-1" > > >the contacts table has 24 fields id first_name last_name etc.., I >want every single record and field from that table.the >contacts_org_types table has three fields id organization_type and >internal, I want only the organization_type field from that table, >so , I *believe* that i should see 25 fields in my result 24 from >table 1 and 1 from table 2- thanks Jean-Paul Natola > From: >markamatte at hotmail.com> To: dba-sqlserver at databaseadvisors.com> >Date: Sat, 31 Jan 2009 12:49:06 +0000> Subject: Re: [dba-SQLServer] >Newbie needs help with select statement> > > I hate to make >assumptions...but the subject says 'newbie'...and Francisco >suggested the fields to join on...not Jean Paul.> > Jean Paul, what >fields from each table are you trying to join on(the actual field >names)? > > If the example below was used 'as is' and there is an >'ID' field in each table but its not the relationship between these >two tables...won't give the results.> > As long as I am 'assuming'...I think! > the scenario might be a translation table...and the first attemp > produced a cartesian join(no joins) and listed each contact having > every kind of cust_org_types...so the confusion might be what > fields to join on.> > Francisco's Example modified:> > SELECT * > FROM contacts AS ctcs> INNER JOIN contacts_organization_types AS > cot ON ctcs.cust_org_types = cot.id> > I'm guessing there is a > cust_org_types field in the contacts table...and there is a value > that needs to be translated?> > If I am off target...please let me > know.> > Thanks,> >> >_________________________________________________________________ From robert at webedb.com Mon Feb 2 13:08:05 2009 From: robert at webedb.com (Robert L. Stewart) Date: Mon, 02 Feb 2009 13:08:05 -0600 Subject: [dba-SQLServer] Newbie needs help with select statement In-Reply-To: References: Message-ID: <200902021913.n12JDZ25015293@databaseadvisors.com> Francisco, Actually, that is an INNER JOIN that he is attempting. The problem is that he is not using the correct columns. That is why he is not getting data back. And, if you try this type of join using the where clause instead, you will find that it is actually faster than using the correct join syntax. :-) Jean-Paul, you are going to have to tell us the names of the columns in your tables before we can help you. Robert At 03:58 PM 1/31/2009, you wrote: >Date: Sat, 31 Jan 2009 13:58:50 -0800 >From: Francisco Tapia >Subject: Re: [dba-SQLServer] Newbie needs help with select statement >To: Discussion concerning MS SQL Server > >Message-ID: > >Content-Type: text/plain; charset=windows-1252 > >Because of Sql Server standards, try to stick to Joins made with the INNER / >LEFT / FULL / OUTER keywords (see books Online). Joins made at the where >clause do work but may have sporadic results that are not consistent. > > >-Francisco >http://sqlthis.blogspot.com | Tsql and More... > > >On Sat, Jan 31, 2009 at 1:56 PM, jean-paul wrote: > > > > > So I read about 50 webpages and decided to try this statement > > > > SELECT *FROM contacts, contacts_organization_typesWHERE contacts.id = > > contacts_organization_types.id From jnatola at hotmail.com Mon Feb 2 13:48:32 2009 From: jnatola at hotmail.com (jean-paul) Date: Mon, 2 Feb 2009 14:48:32 -0500 Subject: [dba-SQLServer] Newbie needs help with select statement In-Reply-To: <200902021913.n12JDZ25015293@databaseadvisors.com> References: <200902021913.n12JDZ25015293@databaseadvisors.com> Message-ID: As it turns out, the switchboard links everything table contacts; id prefix first_name last_name title organization mailing_address_1 mailing_address_2 mailing_address_3 mailing_city mailing_state mailing_zip_code mailing_country_id telephone mobile fax email password customer_number creation_date created_by modification_date unsubscribe_timestamp last_modified_by website_url region_id table contacts_organization_types id organization_type internal_only table contacts_source_codes id source_code internal_only Jean-Paul Natola ---------------------------------------- > Date: Mon, 2 Feb 2009 13:08:05 -0600 > To: dba-sqlserver at databaseadvisors.com > From: robert at webedb.com > Subject: Re: [dba-SQLServer] Newbie needs help with select statement > > Francisco, > > Actually, that is an INNER JOIN that he is attempting. The problem > is that he is not using the correct columns. That is why he is not > getting data back. And, if you try this type of join using the > where clause instead, you will find that it is actually faster than > using the correct join syntax. :-) > > Jean-Paul, you are going to have to tell us the names of the columns > in your tables before we can help you. > > > Robert > > At 03:58 PM 1/31/2009, you wrote: >>Date: Sat, 31 Jan 2009 13:58:50 -0800 >>From: Francisco Tapia >>Subject: Re: [dba-SQLServer] Newbie needs help with select statement >>To: Discussion concerning MS SQL Server >> >>Message-ID: >> >>Content-Type: text/plain; charset=windows-1252 >> >>Because of Sql Server standards, try to stick to Joins made with the INNER / >>LEFT / FULL / OUTER keywords (see books Online). Joins made at the where >>clause do work but may have sporadic results that are not consistent. >> >> >>-Francisco >>http://sqlthis.blogspot.com | Tsql and More... >> >> >>On Sat, Jan 31, 2009 at 1:56 PM, jean-paul wrote: >> >>> >>> So I read about 50 webpages and decided to try this statement >>> >>> SELECT *FROM contacts, contacts_organization_typesWHERE contacts.id = >>> contacts_organization_types.id > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > _________________________________________________________________ Windows Live? Hotmail?:?more than just e-mail. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_explore_012009 From robert at webedb.com Mon Feb 2 14:35:08 2009 From: robert at webedb.com (Robert L. Stewart) Date: Mon, 02 Feb 2009 14:35:08 -0600 Subject: [dba-SQLServer] Newbie needs help with select statement In-Reply-To: References: Message-ID: <200902022038.n12KcXtG003468@databaseadvisors.com> In order to "link" the tables together, they have to have a column in common between them. At 09:53 AM 2/2/2009, you wrote: >Date: Sat, 31 Jan 2009 18:08:59 -0500 >From: jean-paul >Subject: Re: [dba-SQLServer] Newbie needs help with select statement >To: >Message-ID: >Content-Type: text/plain; charset="Windows-1252" > > >the contacts table does NOT have organization type- it has > >id, first, last, add , cty, st, zip, tel, fax, dte_created, email, >etc.. but nothing regarding organization type- I will try you >code and let you know- if been on this for the last 30 >hours racking my brain- on a good note i read and learned >alot since yesterday > >btw, I'm using MySQL and doing this via phpMyAdmin- if it makes >any difference > From jnatola at hotmail.com Tue Feb 3 13:08:30 2009 From: jnatola at hotmail.com (jean-paul) Date: Tue, 3 Feb 2009 14:08:30 -0500 Subject: [dba-SQLServer] Newbie needs help with select statement- part 2 In-Reply-To: <200902022038.n12KcXtG003468@databaseadvisors.com> References: <200902022038.n12KcXtG003468@databaseadvisors.com> Message-ID: turns out i need to do 2 different queries now that I have this- comes the scary part- how would IMPORT - I had no problems importing just into contacts, tested it with a csv and it went right in- the key is to get source_codes and org_types to match the records one for source codes; SELECT contacts.*, contacts_source_codes.source_code FROM contacts LEFT JOIN switchboard ON switchboard.table_left_id = contacts.id AND switchboard.table_left = 'contacts' LEFT JOIN contacts_source_codes ON contacts_source_codes.id = switchboard.table_right_id WHERE switchboard.table_right = 'contacts_source_codes' AND contacts_source_codes.id IS NOT NULL ORDER BY contacts.last_name, contacts.first_name one for org types; SELECT contacts.*, contacts_organization_types.organization_type FROM contacts LEFT JOIN switchboard ON switchboard.table_left_id = contacts.id AND switchboard.table_left = 'contacts' LEFT JOIN contacts_organization_types ON contacts_organization_types.id = switchboard.table_right_id WHERE switchboard.table_right = 'contacts_organization_types' AND contacts_organization_types.id IS NOT NULL ORDER BY contacts.last_name, contacts.first_name Jean-Paul Natola > Date: Mon, 2 Feb 2009 14:35:08 -0600 > To: dba-sqlserver at databaseadvisors.com > From: robert at webedb.com > Subject: Re: [dba-SQLServer] Newbie needs help with select statement > > In order to "link" the tables together, > they have to have a column in common > between them. > _________________________________________________________________ Hotmail? goes where you go. On a PC, on the Web, on your phone. http://www.windowslive-hotmail.com/learnmore/versatility.aspx#mobile?ocid=TXT_TAGHM_WL_HM_versatility_121208 From fuller.artful at gmail.com Thu Feb 5 09:49:51 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 5 Feb 2009 10:49:51 -0500 Subject: [dba-SQLServer] Installing Adventureworks Databases Message-ID: <29f585dd0902050749n59b3dd81k27aa80497aa825cc@mail.gmail.com> I recently reinstalled a bunch of things on my notebook, including SQL 2008. I downloaded both the Adventureworks.msi file and the zip. The MSI file errors out almost immediately with the message: The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2738. So I unzipped the zipped version and got a pair of directories called Samples and Tools. Tools contains a subdir called Samples which in turn contains a bunch of subdirs filled with CSV files. But there are no instructions as to what to do next, or what order to run the csv files in. Any advice? TIA, Arthur From fuller.artful at gmail.com Thu Feb 5 17:54:05 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 5 Feb 2009 18:54:05 -0500 Subject: [dba-SQLServer] Generate Scripts from a Database Message-ID: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com> I could have sworn that there is a way to generate scripts for everything in a database, but now I can't find it. I right-clicked on the db in question, then Tasks, then Generate Scripts, and walked through the wizard, selecting Generate objects, and I got a script that creates all objects but not the data in the tables. Did I miss something here? TIA, Arthur From ab-mi at post3.tele.dk Thu Feb 5 18:15:23 2009 From: ab-mi at post3.tele.dk (Asger Blond) Date: Fri, 6 Feb 2009 01:15:23 +0100 Subject: [dba-SQLServer] Generate Scripts from a Database In-Reply-To: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com> Message-ID: <000301c987f0$0161feb0$2301a8c0@AB> On the wizard page "Choose Script Options" scroll to the section "Table/View Options" and set "Scrip Data" to True. This is SQL Server 2008 - don't remember if it's the same in 2005. Asger -----Oprindelig meddelelse----- Fra: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Arthur Fuller Sendt: 6. februar 2009 00:54 Til: Discussion concerning MS SQL Server Emne: [dba-SQLServer] Generate Scripts from a Database I could have sworn that there is a way to generate scripts for everything in a database, but now I can't find it. I right-clicked on the db in question, then Tasks, then Generate Scripts, and walked through the wizard, selecting Generate objects, and I got a script that creates all objects but not the data in the tables. Did I miss something here? TIA, Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fuller.artful at gmail.com Thu Feb 5 18:29:32 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 5 Feb 2009 19:29:32 -0500 Subject: [dba-SQLServer] Generate Scripts from a Database In-Reply-To: <000301c987f0$0161feb0$2301a8c0@AB> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com> <000301c987f0$0161feb0$2301a8c0@AB> Message-ID: <29f585dd0902051629w569262fbk51abefe311abc5d0@mail.gmail.com> Thanks, Asger! I knew I'd seen it in there somewhere! Arthur On Thu, Feb 5, 2009 at 7:15 PM, Asger Blond wrote: > On the wizard page "Choose Script Options" scroll to the section > "Table/View > Options" and set "Scrip Data" to True. > This is SQL Server 2008 - don't remember if it's the same in 2005. > > Asger > From dw-murphy at cox.net Thu Feb 5 18:42:18 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 5 Feb 2009 16:42:18 -0800 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com> Message-ID: Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug From ab-mi at post3.tele.dk Thu Feb 5 18:47:44 2009 From: ab-mi at post3.tele.dk (Asger Blond) Date: Fri, 6 Feb 2009 01:47:44 +0100 Subject: [dba-SQLServer] Generate Scripts from a Database In-Reply-To: <29f585dd0902051629w569262fbk51abefe311abc5d0@mail.gmail.com> Message-ID: <000401c987f4$866bc6f0$2301a8c0@AB> Well, I noticed that this option doesn't exist previous to 2008. Lucky you are using that. But curious: why don't you just make a backup and restore, eventually to a different db name? By fare more efficient. Asger -----Oprindelig meddelelse----- Fra: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Arthur Fuller Sendt: 6. februar 2009 01:30 Til: Discussion concerning MS SQL Server Emne: Re: [dba-SQLServer] Generate Scripts from a Database Thanks, Asger! I knew I'd seen it in there somewhere! Arthur On Thu, Feb 5, 2009 at 7:15 PM, Asger Blond wrote: > On the wizard page "Choose Script Options" scroll to the section > "Table/View > Options" and set "Scrip Data" to True. > This is SQL Server 2008 - don't remember if it's the same in 2005. > > Asger > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fuller.artful at gmail.com Thu Feb 5 19:04:57 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 5 Feb 2009 20:04:57 -0500 Subject: [dba-SQLServer] Generate Scripts from a Database In-Reply-To: <000401c987f4$866bc6f0$2301a8c0@AB> References: <29f585dd0902051629w569262fbk51abefe311abc5d0@mail.gmail.com> <000401c987f4$866bc6f0$2301a8c0@AB> Message-ID: <29f585dd0902051704k2d56339es15d84d2e00a84251@mail.gmail.com> For some reason, my attempts to run the AdventureWorks.msi always error out almost immediately. So I unzipped the Adventureworks_All_databases.zip and it's filled with csv files, hundreds of them. I've tried it yet. There are no sequence instructions in there. I don't know whether it matters which order you run them in. I have never imported from a csv before but I imagine that it's straightforward once the database utself has been created. But of course you are right. I would much prefer to restore from a backup of the AdventureWorks databases. I'd prefer to get around the problem with the MSI file even more! Arthur On Thu, Feb 5, 2009 at 7:47 PM, Asger Blond wrote: > Well, I noticed that this option doesn't exist previous to 2008. Lucky you > are using that. > But curious: why don't you just make a backup and restore, eventually to a > different db name? By fare more efficient. > > Asger > From Darryl.Collins at coles.com.au Thu Feb 5 20:26:39 2009 From: Darryl.Collins at coles.com.au (Darryl Collins) Date: Fri, 6 Feb 2009 13:26:39 +1100 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: Message-ID: <57E6E6CA42105A48B977303A2CDC272007ACD7E198@WPEXCH22.retail.ad.cmltd.net.au> Hi Doug, I saw you question in the Access list, but I am pretty new to both Access and SQL Server (I am an old skool Excel person) so I though I would see if someone comes up with something. since things are a bit quiet I will try and help you out with what little I know. These days I don't manually link the tables to SQL Server from Access using the linked table manager, rather we have set up a table (tblTables) in SQL Server that has a list of the tables I want to link into Access. Since many of the tables in SQL Server you will not need or want on the client (MS Access) side this is a good approach. The code below will relink all the tables from SQL Server to Access, based on the data in the tblTables table (heh, that is a mouthful!) in SQL Server. As for queries and the like. Run absolutely everything you can off the server using Stored Procedures or Views and only pull back to Access the results. the server will process data much much faster than Access in nearly all instances. I hope that makes sense. here are some links that I have found useful (and put on my website). http://www.excelyourbusiness.com.au/SQL%20Server.htm good luck cheers Darryl. '======================= Option Compare Database Option Explicit Public Sub RefreshData() '***********************************************' ' ' ' This Procedure links tables in SQL Server ' ' that are listed in an SQL Server table. ' ' This Procedure must be customised to the ' ' application's Schema. ' ' ' ' This procedure could be blank if linked ' ' tables are not used. ' ' ' '***********************************************' Dim strText As String, msg As String, strCon As String Dim cmd As ADODB.Command Dim rsSP As ADODB.Recordset Dim tbl As DAO.TableDef On Error GoTo ErrHandler strText = "SELECT sqlName, tblName from " & GetParameter("ListTables") & ";" Set cmd = New ADODB.Command cmd.ActiveConnection = DbADOConStr cmd.CommandType = adCmdText cmd.CommandText = strText Set rsSP = New ADODB.Recordset Set rsSP = cmd.Execute() If Not rsSP.EOF Then UnlinkODBC strCon = DbDAOConStr rsSP.MoveFirst Do Until rsSP.EOF 'Debug.Print rsSP("tblNAme") If IsTableQuery("", rsSP("tblName")) = True Then DoCmd.DeleteObject acTable, rsSP("tblName") ' if query exists, delete it! End If 'DoCmd.TransferDatabase acLink, "ODBC Database", strCon, acTable, rsSP("sqlName"), rsSP("tblName"), False, True Set tbl = CurrentDb.CreateTableDef(rsSP("tblName"), dbAttachSavePWD, rsSP("sqlName"), DbDAOConStr) CurrentDb.TableDefs.Append tbl rsSP.MoveNext Loop Else msg = "Failed to Establish Link with SQL Server !" MsgBox msg, vbCritical + vbOKOnly, "SQL SERVER ERROR" End If ExitHere: On Error Resume Next rsSP.Close Set rsSP = Nothing Set cmd = Nothing Exit Sub ErrHandler: strErrMsg = "modRefresh.RefreshData: " strErrMsg = strErrMsg & Err.Number & " - " & Err.Description ErrHandle (strErrMsg) Resume ExitHere End Sub Public Function UnlinkODBC() As Boolean '***********************************************' ' ' ' This Procedure unlinks ODBC tables that ' ' are in the current database ' ' ' ' Created by Beny Aycardo ' ' Started on 08 April 2002 ' ' ' '***********************************************' Dim db As Database Dim i As Integer On Error GoTo ErrHandler UnlinkODBC = False Set db = CurrentDb 'Set the Current Database i = 0 'set table counter to 0 Do While i < db.TableDefs.Count If (db.TableDefs(i).Attributes And dbAttachedODBC) = 0 Then i = i + 1 'index count if table is not linked Else db.TableDefs.Delete db.TableDefs(i).Name 'Delete the linked table i = 0 'reset table counter End If Loop UnlinkODBC = True ExitHere: On Error Resume Next db.Close Set db = Nothing Exit Function ErrHandler: strErrMsg = "modRefresh.UnlinkODBC: " strErrMsg = strErrMsg & Err.Number & " - " & Err.Description ErrHandle (strErrMsg) Resume ExitHere End Function Public Function IsTableQuery(DbName As String, TName As String) As Integer Dim db As Database, Found As Integer, test As String Const NAME_NOT_IN_COLLECTION = 3265 On Error GoTo ErrHandler ' Assume the table or query does not exist. Found = False ' Trap for any errors. On Error Resume Next ' If the database name is empty... If Trim$(DbName) = "" Then ' ...then set Db to the current Db. Set db = CurrentDb() Else ' Otherwise, set Db to the specified open database. Set db = DBEngine.Workspaces(0).OpenDatabase(DbName) ' See if an error occurred. If Err Then MsgBox "Could not find database to open: " & DbName IsTableQuery = False Exit Function End If End If ' See if the name is in the Tables collection. test = db.TableDefs(TName).Name If Err <> NAME_NOT_IN_COLLECTION Then Found = True ' Reset the error variable. Err = 0 ' See if the name is in the Queries collection. test = db.QueryDefs(TName$).Name If Err <> NAME_NOT_IN_COLLECTION Then Found = True db.Close IsTableQuery = Found ExitHere: Exit Function ErrHandler: strErrMsg = "modRefresh.IsTableQuery: " strErrMsg = strErrMsg & Err.Number & " - " & Err.Description ErrHandle (strErrMsg) Resume ExitHere End Function Function IsLoaded(ByVal strFormName As String) As Boolean ' Returns True if the specified form is open in Form view or Datasheet view. Const conObjStateClosed = 0 Const conDesignView = 0 On Error GoTo ErrHandler If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then If Forms(strFormName).CurrentView <> conDesignView Then IsLoaded = True End If End If ExitHere: Exit Function ErrHandler: IsLoaded = False Resume ExitHere End Function '============================================================= ' and you will need this function too '================================================================ Public Function GetParameter(strParameter As String) As String '=======================================================================================' ' ' ' This function returns a parameter value given a parameter name ' ' that is supplied as an argument to the function ' ' This function calls a stored procedure "stprRetrieveParameter" ' ' which must be created on the server ' ' ' ' ' ' Created by Beny Aycardo ' ' Started on 23 Janualry 2004 ' ' ' '=======================================================================================' Dim strText As String Dim cmd As ADODB.Command Dim rsSP As ADODB.Recordset On Error GoTo ErrHandler strText = "stprRetrieveParameter '" & strParameter & "', '" & strParameterTable & "'" Set cmd = New ADODB.Command cmd.ActiveConnection = DbADOConStr ' Pre dimmed ADO connection string cmd.CommandType = adCmdText cmd.CommandText = strText Set rsSP = New ADODB.Recordset Set rsSP = cmd.Execute() If rsSP.EOF Then GetParameter = "" Else rsSP.MoveFirst GetParameter = rsSP(0) End If ExitHere: On Error Resume Next rsSP.Close Set rsSP = Nothing Set cmd = Nothing Exit Function ErrHandler: strErrMsg = "modSQLServer.GetParameter: " strErrMsg = strErrMsg & Err.Number & " - " & Err.Description ErrHandle (strErrMsg) Resume ExitHere End Function ' ============================================================== -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Doug Murphy Sent: Friday, 6 February 2009 11:42 AM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com This email and any attachments may contain privileged and confidential information and are intended for the named addressee only. If you have received this e-mail in error, please notify the sender and delete this e-mail immediately. Any confidentiality, privilege or copyright is not waived or lost because this e-mail has been sent to you in error. It is your responsibility to check this e-mail and any attachments for viruses. No warranty is made that this material is free from computer virus or any other defect or error. Any loss/damage incurred by using this material is not the sender's responsibility. The sender's entire liability will be limited to resupplying the material. From dw-murphy at cox.net Thu Feb 5 21:26:57 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 5 Feb 2009 19:26:57 -0800 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <57E6E6CA42105A48B977303A2CDC272007ACD7E198@WPEXCH22.retail.ad.cmltd.net.au> References: <57E6E6CA42105A48B977303A2CDC272007ACD7E198@WPEXCH22.retail.ad.cmltd.net.au> Message-ID: <3179FB91115A4419910813DEDF156CE8@murphy3234aaf1> Thank you Darryl, I will add to my library. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Darryl Collins Sent: Thursday, February 05, 2009 6:27 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, I saw you question in the Access list, but I am pretty new to both Access and SQL Server (I am an old skool Excel person) so I though I would see if someone comes up with something. since things are a bit quiet I will try and help you out with what little I know. These days I don't manually link the tables to SQL Server from Access using the linked table manager, rather we have set up a table (tblTables) in SQL Server that has a list of the tables I want to link into Access. Since many of the tables in SQL Server you will not need or want on the client (MS Access) side this is a good approach. The code below will relink all the tables from SQL Server to Access, based on the data in the tblTables table (heh, that is a mouthful!) in SQL Server. As for queries and the like. Run absolutely everything you can off the server using Stored Procedures or Views and only pull back to Access the results. the server will process data much much faster than Access in nearly all instances. I hope that makes sense. here are some links that I have found useful (and put on my website). http://www.excelyourbusiness.com.au/SQL%20Server.htm good luck cheers Darryl. '======================= Option Compare Database Option Explicit Public Sub RefreshData() '***********************************************' ' ' ' This Procedure links tables in SQL Server ' ' that are listed in an SQL Server table. ' ' This Procedure must be customised to the ' ' application's Schema. ' ' ' ' This procedure could be blank if linked ' ' tables are not used. ' ' ' '***********************************************' Dim strText As String, msg As String, strCon As String Dim cmd As ADODB.Command Dim rsSP As ADODB.Recordset Dim tbl As DAO.TableDef On Error GoTo ErrHandler strText = "SELECT sqlName, tblName from " & GetParameter("ListTables") & ";" Set cmd = New ADODB.Command cmd.ActiveConnection = DbADOConStr cmd.CommandType = adCmdText cmd.CommandText = strText Set rsSP = New ADODB.Recordset Set rsSP = cmd.Execute() If Not rsSP.EOF Then UnlinkODBC strCon = DbDAOConStr rsSP.MoveFirst Do Until rsSP.EOF 'Debug.Print rsSP("tblNAme") If IsTableQuery("", rsSP("tblName")) = True Then DoCmd.DeleteObject acTable, rsSP("tblName") ' if query exists, delete it! End If 'DoCmd.TransferDatabase acLink, "ODBC Database", strCon, acTable, rsSP("sqlName"), rsSP("tblName"), False, True Set tbl = CurrentDb.CreateTableDef(rsSP("tblName"), dbAttachSavePWD, rsSP("sqlName"), DbDAOConStr) CurrentDb.TableDefs.Append tbl rsSP.MoveNext Loop Else msg = "Failed to Establish Link with SQL Server !" MsgBox msg, vbCritical + vbOKOnly, "SQL SERVER ERROR" End If ExitHere: On Error Resume Next rsSP.Close Set rsSP = Nothing Set cmd = Nothing Exit Sub ErrHandler: strErrMsg = "modRefresh.RefreshData: " strErrMsg = strErrMsg & Err.Number & " - " & Err.Description ErrHandle (strErrMsg) Resume ExitHere End Sub Public Function UnlinkODBC() As Boolean '***********************************************' ' ' ' This Procedure unlinks ODBC tables that ' ' are in the current database ' ' ' ' Created by Beny Aycardo ' ' Started on 08 April 2002 ' ' ' '***********************************************' Dim db As Database Dim i As Integer On Error GoTo ErrHandler UnlinkODBC = False Set db = CurrentDb 'Set the Current Database i = 0 'set table counter to 0 Do While i < db.TableDefs.Count If (db.TableDefs(i).Attributes And dbAttachedODBC) = 0 Then i = i + 1 'index count if table is not linked Else db.TableDefs.Delete db.TableDefs(i).Name 'Delete the linked table i = 0 'reset table counter End If Loop UnlinkODBC = True ExitHere: On Error Resume Next db.Close Set db = Nothing Exit Function ErrHandler: strErrMsg = "modRefresh.UnlinkODBC: " strErrMsg = strErrMsg & Err.Number & " - " & Err.Description ErrHandle (strErrMsg) Resume ExitHere End Function Public Function IsTableQuery(DbName As String, TName As String) As Integer Dim db As Database, Found As Integer, test As String Const NAME_NOT_IN_COLLECTION = 3265 On Error GoTo ErrHandler ' Assume the table or query does not exist. Found = False ' Trap for any errors. On Error Resume Next ' If the database name is empty... If Trim$(DbName) = "" Then ' ...then set Db to the current Db. Set db = CurrentDb() Else ' Otherwise, set Db to the specified open database. Set db = DBEngine.Workspaces(0).OpenDatabase(DbName) ' See if an error occurred. If Err Then MsgBox "Could not find database to open: " & DbName IsTableQuery = False Exit Function End If End If ' See if the name is in the Tables collection. test = db.TableDefs(TName).Name If Err <> NAME_NOT_IN_COLLECTION Then Found = True ' Reset the error variable. Err = 0 ' See if the name is in the Queries collection. test = db.QueryDefs(TName$).Name If Err <> NAME_NOT_IN_COLLECTION Then Found = True db.Close IsTableQuery = Found ExitHere: Exit Function ErrHandler: strErrMsg = "modRefresh.IsTableQuery: " strErrMsg = strErrMsg & Err.Number & " - " & Err.Description ErrHandle (strErrMsg) Resume ExitHere End Function Function IsLoaded(ByVal strFormName As String) As Boolean ' Returns True if the specified form is open in Form view or Datasheet view. Const conObjStateClosed = 0 Const conDesignView = 0 On Error GoTo ErrHandler If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then If Forms(strFormName).CurrentView <> conDesignView Then IsLoaded = True End If End If ExitHere: Exit Function ErrHandler: IsLoaded = False Resume ExitHere End Function '============================================================= ' and you will need this function too '================================================================ Public Function GetParameter(strParameter As String) As String '=========================================================================== ============' ' ' ' This function returns a parameter value given a parameter name ' ' that is supplied as an argument to the function ' ' This function calls a stored procedure "stprRetrieveParameter" ' ' which must be created on the server ' ' ' ' ' ' Created by Beny Aycardo ' ' Started on 23 Janualry 2004 ' ' ' '=========================================================================== ============' Dim strText As String Dim cmd As ADODB.Command Dim rsSP As ADODB.Recordset On Error GoTo ErrHandler strText = "stprRetrieveParameter '" & strParameter & "', '" & strParameterTable & "'" Set cmd = New ADODB.Command cmd.ActiveConnection = DbADOConStr ' Pre dimmed ADO connection string cmd.CommandType = adCmdText cmd.CommandText = strText Set rsSP = New ADODB.Recordset Set rsSP = cmd.Execute() If rsSP.EOF Then GetParameter = "" Else rsSP.MoveFirst GetParameter = rsSP(0) End If ExitHere: On Error Resume Next rsSP.Close Set rsSP = Nothing Set cmd = Nothing Exit Function ErrHandler: strErrMsg = "modSQLServer.GetParameter: " strErrMsg = strErrMsg & Err.Number & " - " & Err.Description ErrHandle (strErrMsg) Resume ExitHere End Function ' ============================================================== -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Doug Murphy Sent: Friday, 6 February 2009 11:42 AM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com This email and any attachments may contain privileged and confidential information and are intended for the named addressee only. If you have received this e-mail in error, please notify the sender and delete this e-mail immediately. Any confidentiality, privilege or copyright is not waived or lost because this e-mail has been sent to you in error. It is your responsibility to check this e-mail and any attachments for viruses. No warranty is made that this material is free from computer virus or any other defect or error. Any loss/damage incurred by using this material is not the sender's responsibility. The sender's entire liability will be limited to resupplying the material. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From dwaters at usinternet.com Fri Feb 6 08:35:06 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 6 Feb 2009 08:35:06 -0600 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com> Message-ID: <22776BC36C614177BB78BEAA9ED2DB67@danwaters> Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From dw-murphy at cox.net Fri Feb 6 08:43:28 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Fri, 6 Feb 2009 06:43:28 -0800 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <22776BC36C614177BB78BEAA9ED2DB67@danwaters> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com> <22776BC36C614177BB78BEAA9ED2DB67@danwaters> Message-ID: <9500DE12E64A4D4A8DBE1CD5099A2F20@murphy3234aaf1> Thanks Dan. I have the Enterprise Developers Handbook. I should have looked there up front. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From dw-murphy at cox.net Fri Feb 6 15:55:01 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Fri, 6 Feb 2009 13:55:01 -0800 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <22776BC36C614177BB78BEAA9ED2DB67@danwaters> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com> <22776BC36C614177BB78BEAA9ED2DB67@danwaters> Message-ID: <5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1> Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From dwaters at usinternet.com Fri Feb 6 16:16:27 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 6 Feb 2009 16:16:27 -0600 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com><22776BC36C614177BB78BEAA9ED2DB67@danwaters> <5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1> Message-ID: <203662976C434C628F381E8A2D41FA34@danwaters> Your thoughts on the stored procedure are correct! Another way (I believe) is to create a view on the server (equivalent to an Access query), and then link to that to pull up a limited dataset. But, you won't be able to modify that view/query dynamically (again - I believe). And that's where the stored procedure comes in. You can design a stored procedure and then call it by passing some variables to dynamically change it's output. You do not need to convert your MDB to an ADP to use stored procedures. In fact, the only reason I can see to use an ADP is that it can manipulate SQL Server objects in design view. But Management Studio for SQL Server 2005/2008 works very well! Management Studio for SQL Server wasn't available until SQL Server 2005. I prefer using MDB's because I can then use temp tables in the FE. Now the hard part - learning how to use a stored procedure to get a set of data to fill a combobox/listbox or create a recordset for a form or report. This is where the learning curve comes in, and there's really no way to avoid that. (The books I mentioned helped me a lot.) On the other hand, John Colby has just hit the top of that learning curve, so he may have something to say! ;-) Good Luck, Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 3:55 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From dw-murphy at cox.net Fri Feb 6 16:30:47 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Fri, 6 Feb 2009 14:30:47 -0800 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <203662976C434C628F381E8A2D41FA34@danwaters> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com><22776BC36C614177BB78BEAA9ED2DB67@danwaters><5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1> <203662976C434C628F381E8A2D41FA34@danwaters> Message-ID: <3930625C294542269A6BE012401C4C71@murphy3234aaf1> Hi Dan, Thanks. I have set up pass through queries and stored procedures to pull data. What I am missing is how to update the data in the front end or insert new records. In Access we would just set a table or query as a forms record source and it was taken care of. When I set a forms record source to a view or SP it isn't updatable. My concern is that linking directly to the SQL server tables will cause the FE to pull over a lot of records. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 2:16 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Your thoughts on the stored procedure are correct! Another way (I believe) is to create a view on the server (equivalent to an Access query), and then link to that to pull up a limited dataset. But, you won't be able to modify that view/query dynamically (again - I believe). And that's where the stored procedure comes in. You can design a stored procedure and then call it by passing some variables to dynamically change it's output. You do not need to convert your MDB to an ADP to use stored procedures. In fact, the only reason I can see to use an ADP is that it can manipulate SQL Server objects in design view. But Management Studio for SQL Server 2005/2008 works very well! Management Studio for SQL Server wasn't available until SQL Server 2005. I prefer using MDB's because I can then use temp tables in the FE. Now the hard part - learning how to use a stored procedure to get a set of data to fill a combobox/listbox or create a recordset for a form or report. This is where the learning curve comes in, and there's really no way to avoid that. (The books I mentioned helped me a lot.) On the other hand, John Colby has just hit the top of that learning curve, so he may have something to say! ;-) Good Luck, Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 3:55 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ 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 dwaters at usinternet.com Fri Feb 6 17:51:58 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 6 Feb 2009 17:51:58 -0600 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <3930625C294542269A6BE012401C4C71@murphy3234aaf1> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com><22776BC36C614177BB78BEAA9ED2DB67@danwaters><5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1><203662976C434C628F381E8A2D41FA34@danwaters> <3930625C294542269A6BE012401C4C71@murphy3234aaf1> Message-ID: Take a look at these articles: Create a Combobox that is Based on a Parameterized Stored Procedure http://support.microsoft.com/kb/304252 Optimizing Access Apps Linked to SQL Server http://msdn.microsoft.com/en-us/library/bb188204.aspx How to Bind Access Forms to ADO Recordsets http://support.microsoft.com/kb/281998 These helped me quite a bit. Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 4:31 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Dan, Thanks. I have set up pass through queries and stored procedures to pull data. What I am missing is how to update the data in the front end or insert new records. In Access we would just set a table or query as a forms record source and it was taken care of. When I set a forms record source to a view or SP it isn't updatable. My concern is that linking directly to the SQL server tables will cause the FE to pull over a lot of records. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 2:16 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Your thoughts on the stored procedure are correct! Another way (I believe) is to create a view on the server (equivalent to an Access query), and then link to that to pull up a limited dataset. But, you won't be able to modify that view/query dynamically (again - I believe). And that's where the stored procedure comes in. You can design a stored procedure and then call it by passing some variables to dynamically change it's output. You do not need to convert your MDB to an ADP to use stored procedures. In fact, the only reason I can see to use an ADP is that it can manipulate SQL Server objects in design view. But Management Studio for SQL Server 2005/2008 works very well! Management Studio for SQL Server wasn't available until SQL Server 2005. I prefer using MDB's because I can then use temp tables in the FE. Now the hard part - learning how to use a stored procedure to get a set of data to fill a combobox/listbox or create a recordset for a form or report. This is where the learning curve comes in, and there's really no way to avoid that. (The books I mentioned helped me a lot.) On the other hand, John Colby has just hit the top of that learning curve, so he may have something to say! ;-) Good Luck, Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 3:55 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ 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 dw-murphy at cox.net Fri Feb 6 18:04:08 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Fri, 6 Feb 2009 16:04:08 -0800 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com><22776BC36C614177BB78BEAA9ED2DB67@danwaters><5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1><203662976C434C628F381E8A2D41FA34@danwaters><3930625C294542269A6BE012401C4C71@murphy3234aaf1> Message-ID: <9D772FFE9B8241BD86B0CA926CF555AA@murphy3234aaf1> Thanks Dan, I am slowly waiding through this material. Have some test apps set up I am trying things in to see how they work. I really appreciate your suggestions. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 3:52 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Take a look at these articles: Create a Combobox that is Based on a Parameterized Stored Procedure http://support.microsoft.com/kb/304252 Optimizing Access Apps Linked to SQL Server http://msdn.microsoft.com/en-us/library/bb188204.aspx How to Bind Access Forms to ADO Recordsets http://support.microsoft.com/kb/281998 These helped me quite a bit. Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 4:31 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Dan, Thanks. I have set up pass through queries and stored procedures to pull data. What I am missing is how to update the data in the front end or insert new records. In Access we would just set a table or query as a forms record source and it was taken care of. When I set a forms record source to a view or SP it isn't updatable. My concern is that linking directly to the SQL server tables will cause the FE to pull over a lot of records. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 2:16 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Your thoughts on the stored procedure are correct! Another way (I believe) is to create a view on the server (equivalent to an Access query), and then link to that to pull up a limited dataset. But, you won't be able to modify that view/query dynamically (again - I believe). And that's where the stored procedure comes in. You can design a stored procedure and then call it by passing some variables to dynamically change it's output. You do not need to convert your MDB to an ADP to use stored procedures. In fact, the only reason I can see to use an ADP is that it can manipulate SQL Server objects in design view. But Management Studio for SQL Server 2005/2008 works very well! Management Studio for SQL Server wasn't available until SQL Server 2005. I prefer using MDB's because I can then use temp tables in the FE. Now the hard part - learning how to use a stored procedure to get a set of data to fill a combobox/listbox or create a recordset for a form or report. This is where the learning curve comes in, and there's really no way to avoid that. (The books I mentioned helped me a lot.) On the other hand, John Colby has just hit the top of that learning curve, so he may have something to say! ;-) Good Luck, Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 3:55 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From dw-murphy at cox.net Fri Feb 6 19:06:32 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Fri, 6 Feb 2009 17:06:32 -0800 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com><22776BC36C614177BB78BEAA9ED2DB67@danwaters><5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1><203662976C434C628F381E8A2D41FA34@danwaters><3930625C294542269A6BE012401C4C71@murphy3234aaf1> Message-ID: <9055BF2BED9F4864902A388E76607F7D@murphy3234aaf1> Hi Dan, Refrence 2 makes this much clearer to me. I like to understand what is going on and this explains what is under the hood. Things should be much easier to design now. Thanks again. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 3:52 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Take a look at these articles: Create a Combobox that is Based on a Parameterized Stored Procedure http://support.microsoft.com/kb/304252 Optimizing Access Apps Linked to SQL Server http://msdn.microsoft.com/en-us/library/bb188204.aspx How to Bind Access Forms to ADO Recordsets http://support.microsoft.com/kb/281998 These helped me quite a bit. Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 4:31 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Dan, Thanks. I have set up pass through queries and stored procedures to pull data. What I am missing is how to update the data in the front end or insert new records. In Access we would just set a table or query as a forms record source and it was taken care of. When I set a forms record source to a view or SP it isn't updatable. My concern is that linking directly to the SQL server tables will cause the FE to pull over a lot of records. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 2:16 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Your thoughts on the stored procedure are correct! Another way (I believe) is to create a view on the server (equivalent to an Access query), and then link to that to pull up a limited dataset. But, you won't be able to modify that view/query dynamically (again - I believe). And that's where the stored procedure comes in. You can design a stored procedure and then call it by passing some variables to dynamically change it's output. You do not need to convert your MDB to an ADP to use stored procedures. In fact, the only reason I can see to use an ADP is that it can manipulate SQL Server objects in design view. But Management Studio for SQL Server 2005/2008 works very well! Management Studio for SQL Server wasn't available until SQL Server 2005. I prefer using MDB's because I can then use temp tables in the FE. Now the hard part - learning how to use a stored procedure to get a set of data to fill a combobox/listbox or create a recordset for a form or report. This is where the learning curve comes in, and there's really no way to avoid that. (The books I mentioned helped me a lot.) On the other hand, John Colby has just hit the top of that learning curve, so he may have something to say! ;-) Good Luck, Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 3:55 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From dwaters at usinternet.com Fri Feb 6 19:24:53 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 6 Feb 2009 19:24:53 -0600 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <9055BF2BED9F4864902A388E76607F7D@murphy3234aaf1> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com><22776BC36C614177BB78BEAA9ED2DB67@danwaters><5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1><203662976C434C628F381E8A2D41FA34@danwaters><3930625C294542269A6BE012401C4C71@murphy3234aaf1> <9055BF2BED9F4864902A388E76607F7D@murphy3234aaf1> Message-ID: <3ACC08F4032E486FB47CC660975B37FF@danwaters> All the Best! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 7:07 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Dan, Refrence 2 makes this much clearer to me. I like to understand what is going on and this explains what is under the hood. Things should be much easier to design now. Thanks again. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 3:52 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Take a look at these articles: Create a Combobox that is Based on a Parameterized Stored Procedure http://support.microsoft.com/kb/304252 Optimizing Access Apps Linked to SQL Server http://msdn.microsoft.com/en-us/library/bb188204.aspx How to Bind Access Forms to ADO Recordsets http://support.microsoft.com/kb/281998 These helped me quite a bit. Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 4:31 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Dan, Thanks. I have set up pass through queries and stored procedures to pull data. What I am missing is how to update the data in the front end or insert new records. In Access we would just set a table or query as a forms record source and it was taken care of. When I set a forms record source to a view or SP it isn't updatable. My concern is that linking directly to the SQL server tables will cause the FE to pull over a lot of records. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 2:16 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Your thoughts on the stored procedure are correct! Another way (I believe) is to create a view on the server (equivalent to an Access query), and then link to that to pull up a limited dataset. But, you won't be able to modify that view/query dynamically (again - I believe). And that's where the stored procedure comes in. You can design a stored procedure and then call it by passing some variables to dynamically change it's output. You do not need to convert your MDB to an ADP to use stored procedures. In fact, the only reason I can see to use an ADP is that it can manipulate SQL Server objects in design view. But Management Studio for SQL Server 2005/2008 works very well! Management Studio for SQL Server wasn't available until SQL Server 2005. I prefer using MDB's because I can then use temp tables in the FE. Now the hard part - learning how to use a stored procedure to get a set of data to fill a combobox/listbox or create a recordset for a form or report. This is where the learning curve comes in, and there's really no way to avoid that. (The books I mentioned helped me a lot.) On the other hand, John Colby has just hit the top of that learning curve, so he may have something to say! ;-) Good Luck, Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 3:55 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Darryl.Collins at coles.com.au Sun Feb 8 17:15:46 2009 From: Darryl.Collins at coles.com.au (Darryl Collins) Date: Mon, 9 Feb 2009 10:15:46 +1100 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1> Message-ID: <57E6E6CA42105A48B977303A2CDC272007ACD7E19E@WPEXCH22.retail.ad.cmltd.net.au> I have had this problem. The issue was the table in SQL Server must have a primary key (and one that is dimmed as an int too from memory). If there is no primary key the table is not updatable in Access. hth a bit. darryl -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Doug Murphy Sent: Saturday, 7 February 2009 8:55 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com This email and any attachments may contain privileged and confidential information and are intended for the named addressee only. If you have received this e-mail in error, please notify the sender and delete this e-mail immediately. Any confidentiality, privilege or copyright is not waived or lost because this e-mail has been sent to you in error. It is your responsibility to check this e-mail and any attachments for viruses. No warranty is made that this material is free from computer virus or any other defect or error. Any loss/damage incurred by using this material is not the sender's responsibility. The sender's entire liability will be limited to resupplying the material. From accessd at shaw.ca Sun Feb 8 17:37:25 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 8 Feb 2009 15:37:25 -0800 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <3930625C294542269A6BE012401C4C71@murphy3234aaf1> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com> <22776BC36C614177BB78BEAA9ED2DB67@danwaters> <5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1> <203662976C434C628F381E8A2D41FA34@danwaters> <3930625C294542269A6BE012401C4C71@murphy3234aaf1> Message-ID: <4D95D81E4110499D94EA2571024274B3@creativesystemdesigns.com> Hi Doug: Here is a link to a demonstration of how to connect MS SQL DB and populate a local table. This demo is not exactly what you need but it might give you some ideas of how handle data from BE to FE. : http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo rts.asp There are some very interseting ways to populate combo boxes from your MS SQL BE. This subject has been covered in detail, on this or the Access list in the past and finding a reference should not be difficult using the archive section of the DBA. Check the following link out: http://www.databaseadvisors.com/archive/archive.asp HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 2:31 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Dan, Thanks. I have set up pass through queries and stored procedures to pull data. What I am missing is how to update the data in the front end or insert new records. In Access we would just set a table or query as a forms record source and it was taken care of. When I set a forms record source to a view or SP it isn't updatable. My concern is that linking directly to the SQL server tables will cause the FE to pull over a lot of records. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 2:16 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Your thoughts on the stored procedure are correct! Another way (I believe) is to create a view on the server (equivalent to an Access query), and then link to that to pull up a limited dataset. But, you won't be able to modify that view/query dynamically (again - I believe). And that's where the stored procedure comes in. You can design a stored procedure and then call it by passing some variables to dynamically change it's output. You do not need to convert your MDB to an ADP to use stored procedures. In fact, the only reason I can see to use an ADP is that it can manipulate SQL Server objects in design view. But Management Studio for SQL Server 2005/2008 works very well! Management Studio for SQL Server wasn't available until SQL Server 2005. I prefer using MDB's because I can then use temp tables in the FE. Now the hard part - learning how to use a stored procedure to get a set of data to fill a combobox/listbox or create a recordset for a form or report. This is where the learning curve comes in, and there's really no way to avoid that. (The books I mentioned helped me a lot.) On the other hand, John Colby has just hit the top of that learning curve, so he may have something to say! ;-) Good Luck, Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 3:55 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ 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 dw-murphy at cox.net Mon Feb 9 10:01:50 2009 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 9 Feb 2009 08:01:50 -0800 Subject: [dba-SQLServer] SQL Server ODBC optimization In-Reply-To: <4D95D81E4110499D94EA2571024274B3@creativesystemdesigns.com> References: <29f585dd0902051554p75cb4a90xe89993bb2ab89da3@mail.gmail.com><22776BC36C614177BB78BEAA9ED2DB67@danwaters><5583FE3795E54726AC9AE4F1FBFCCE5F@murphy3234aaf1><203662976C434C628F381E8A2D41FA34@danwaters><3930625C294542269A6BE012401C4C71@murphy3234aaf1> <4D95D81E4110499D94EA2571024274B3@creativesystemdesigns.com> Message-ID: Thanks Jim, I found the source of one problem being that if the SQL Server table doesn't have a clustered index then Access will pick one which may not be a good index. From Access you can drop the index Access/ODBC selects and set one that is usefull and efficient with a Create Unique Index query. Lots to learn, but fun to face challenges. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, February 08, 2009 3:37 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug: Here is a link to a demonstration of how to connect MS SQL DB and populate a local table. This demo is not exactly what you need but it might give you some ideas of how handle data from BE to FE. : http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo rts.asp There are some very interseting ways to populate combo boxes from your MS SQL BE. This subject has been covered in detail, on this or the Access list in the past and finding a reference should not be difficult using the archive section of the DBA. Check the following link out: http://www.databaseadvisors.com/archive/archive.asp HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 2:31 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Dan, Thanks. I have set up pass through queries and stored procedures to pull data. What I am missing is how to update the data in the front end or insert new records. In Access we would just set a table or query as a forms record source and it was taken care of. When I set a forms record source to a view or SP it isn't updatable. My concern is that linking directly to the SQL server tables will cause the FE to pull over a lot of records. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 2:16 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Your thoughts on the stored procedure are correct! Another way (I believe) is to create a view on the server (equivalent to an Access query), and then link to that to pull up a limited dataset. But, you won't be able to modify that view/query dynamically (again - I believe). And that's where the stored procedure comes in. You can design a stored procedure and then call it by passing some variables to dynamically change it's output. You do not need to convert your MDB to an ADP to use stored procedures. In fact, the only reason I can see to use an ADP is that it can manipulate SQL Server objects in design view. But Management Studio for SQL Server 2005/2008 works very well! Management Studio for SQL Server wasn't available until SQL Server 2005. I prefer using MDB's because I can then use temp tables in the FE. Now the hard part - learning how to use a stored procedure to get a set of data to fill a combobox/listbox or create a recordset for a form or report. This is where the learning curve comes in, and there's really no way to avoid that. (The books I mentioned helped me a lot.) On the other hand, John Colby has just hit the top of that learning curve, so he may have something to say! ;-) Good Luck, Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Friday, February 06, 2009 3:55 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hello Dan and others, I'll ask a little more specific question. I have an Access FE connected to SQL server BE via ODBC. The BE tables can hold many records so I was thinking I could put a stored procedure on the BE to limit the number of records coming over the network to the FE to just those of interest. The problem I have found is that the records are not updateable and I can not insert new records. I was trying to not use linked tables, but that seem unavoidable. I am not in the position of being able to convert the FE to an ADP so need to keep the forms etc connected to updatable record sources. How do you folks approach this type of situation. Thanks. Doug -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 06, 2009 6:35 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server ODBC optimization Hi Doug, A few months ago I went through some conversion activities. This is what I learned: 1) To upsize an Access database to SQL Server, use the SQL Server Migration Assistant (SSMA) for Access. This is a free MS utility which is more advanced than using the upsizing wizard, and will upsize queries in Access to Views in SQL Server. The manual for this utility has some good instructions for what needs to be done prior to upsizing. 2) On a LAN, the data transfer speed is perhaps 10% slower using Access FE / SQL BE using ODBC table links. However, on a LAN, no one will notice. This is an easy solution because your code can simply refer to the SQL table links instead of the Access table links as long as the link names are the same. 3) On a WAN, you don't want to use ODBC table links to SQL Server - performance would be poor (but perhaps usable). You'll want to use an OLEDB Provider to make the connections. Using an OLEDB Provider means that you'll be rewriting your code significantly, because you won't have any table links in the FE that your code can use! This is a big learning curve - a good start is 'Microsoft Access Developer's Guide to SQL Server.' This is an older book that uses Access 2000, but it's still valid and very helpful to learn the basics of moving data between the FE and the BE. Another good book is 'Access 2002 Enterprise Developer's Handbook'. Once you get this running, your data transfer speed will increase by at least 5X, probably more like 10X. Good Luck! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Thursday, February 05, 2009 6:42 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server ODBC optimization Folks, I sent this to the AccessD list with no responses. Possibly some one on this list can share their insight in how best to use an Access front end connected to a SQL Server BE via ODBC. What I am trying to learn is how to do this most efficiently from the SQL Server perspective. Do you use queries from Access, move all queries to SQL server and pass parameters where required, etc. I am know that there are some design guidelines that should be followed with designing a system with an Access front end connected to a SQL Server back end via ODBC to obtain good performance. This is a pretty broad question, but could any of you folks who do this on a regular basis provide a list of the techniques and design approaches you follow or point me to some references? I am not looking for a treatise on the subject just a list of items to be aware of and good design practices. Thanks in advance. Doug _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Tue Feb 10 17:38:57 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Wed, 11 Feb 2009 12:38:57 +1300 Subject: [dba-SQLServer] NoLocks Message-ID: <20090210233724.VHGO15317.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> I have a sproc that runs slow due to the large number of sub processes it goes through. I was wondering what potential problems I could have if I used NoLocks in the select statements. The data that is being processed is not likely to change during running the sproc (famous last words). Any comments? From fhtapia at gmail.com Tue Feb 10 17:39:51 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 10 Feb 2009 15:39:51 -0800 Subject: [dba-SQLServer] NoLocks In-Reply-To: <20090210233724.VHGO15317.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> References: <20090210233724.VHGO15317.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: if it's not likely to change then you should receive a performance boost simply by going to nolocks, because the engine does not engage a lock for the rows or pages it is reading. The only real caveat is when you are worried about dirty reads, that is data that could be in the processes of changing. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Feb 10, 2009 at 3:38 PM, David Emerson wrote: > I have a sproc that runs slow due to the large number of sub > processes it goes through. > > I was wondering what potential problems I could have if I used > NoLocks in the select statements. The data that is being processed > is not likely to change during running the sproc (famous last words). > > Any comments? > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From ssharkins at gmail.com Mon Feb 16 12:09:48 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 16 Feb 2009 13:09:48 -0500 Subject: [dba-SQLServer] problem creating stored procedure Message-ID: I don't create a lot of sp's, so be gentle... I think the following should work, but I get an error on the first EXEC: CREATE PROCEDURE sp_DeleteAllData EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' EXEC sp_MSForEachTable 'ALTER TABLE ? DISABLE TRIGGER ALL' GO EXEC sp_MSForEachTable 'DELETE FROM ?' GO EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' EXEC sp_MSForEachTable 'ALTER TABLE ? ENABLE TRIGGER ALL' GO The statements work separately, so it isn't the statements, but getting them in a stored procedure together has proved challenging. I've deleted, reorged -- done everything I can think and it just doesn't like EXEC. I know enough to know EXEC may not be the problem, but I don't know how to troubleshoot it. Thanks! Susan H. From ssharkins at gmail.com Mon Feb 16 12:23:17 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 16 Feb 2009 13:23:17 -0500 Subject: [dba-SQLServer] NEVERMIND (Fw: problem creating stored procedure) Message-ID: <93C90D96190F4CBDA76A46576EC979ED@SusanOne> You can ignore this one. Susan H. >I don't create a lot of sp's, so be gentle... I think the following should >work, but I get an error on the first EXEC: > > CREATE PROCEDURE sp_DeleteAllData > > EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' > > EXEC sp_MSForEachTable 'ALTER TABLE ? DISABLE TRIGGER ALL' > > GO > > EXEC sp_MSForEachTable 'DELETE FROM ?' > > GO > > EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' > > EXEC sp_MSForEachTable 'ALTER TABLE ? ENABLE TRIGGER ALL' > > GO > > > > The statements work separately, so it isn't the statements, but getting > them in a stored procedure together has proved challenging. I've deleted, > reorged -- done everything I can think and it just doesn't like EXEC. I > know enough to know EXEC may not be the problem, but I don't know how to > troubleshoot it. > > > > Thanks! > > Susan H. > From fuller.artful at gmail.com Mon Feb 16 14:16:36 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 16 Feb 2009 15:16:36 -0500 Subject: [dba-SQLServer] problem creating stored procedure In-Reply-To: References: Message-ID: <29f585dd0902161216i48254850sc853370888d6fe8a@mail.gmail.com> Try inserting a 'GO' after each EXEC statement. Arthur On Mon, Feb 16, 2009 at 1:09 PM, Susan Harkins wrote: > I don't create a lot of sp's, so be gentle... I think the following should > work, but I get an error on the first EXEC: > > CREATE PROCEDURE sp_DeleteAllData > > EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' > > EXEC sp_MSForEachTable 'ALTER TABLE ? DISABLE TRIGGER ALL' > > GO > > EXEC sp_MSForEachTable 'DELETE FROM ?' > > GO > > EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' > > EXEC sp_MSForEachTable 'ALTER TABLE ? ENABLE TRIGGER ALL' > > GO > > > > The statements work separately, so it isn't the statements, but getting > them > in a stored procedure together has proved challenging. I've deleted, > reorged -- done everything I can think and it just doesn't like EXEC. I > know > enough to know EXEC may not be the problem, but I don't know how to > troubleshoot it. > > > > Thanks! > > Susan H. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From ssharkins at gmail.com Mon Feb 16 14:26:20 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 16 Feb 2009 15:26:20 -0500 Subject: [dba-SQLServer] problem creating stored procedure References: <29f585dd0902161216i48254850sc853370888d6fe8a@mail.gmail.com> Message-ID: It was a missing AS -- I didn't realize I needed one without a SQL statement, but once I added the AS, it worked fine, with or without the GO's. Susan H. > Try inserting a 'GO' after each EXEC statement. From JHewson at nciinc.com Mon Feb 16 13:34:16 2009 From: JHewson at nciinc.com (Hewson, Jim ) Date: Mon, 16 Feb 2009 13:34:16 -0600 Subject: [dba-SQLServer] Database Mail format Body of email Message-ID: <7E02B06E41E5404589EDDDA2BAA1C5A83EC9AF@sanex101.nciinc.com> I created a stored procedure that formats an email to a select set of people daily. In the body of the email is an HTML table that lists project Milestones that are due, either in the near future or are delinquent. Now they want to send an email notification to the same group when a Milestone has changed or if the basic project data has changed. This can be easily done by sending out two emails (one for Milestones due and another if it changes) to each person. Is it possible to create two or three tables in the body of an email using separate views? I have yet to succeed in doing this. The following code works - but the email is blank! I am very inexperienced with this sort of thing, any help would be greatly appreciated. Thanks, Jim Declare @tableHTML NVARCHAR(MAX), @MaxRows int, @RowCnt int, @PMname varchar(100), @PMEmail varchar(100); SET @RowCnt = 1 CREATE TABLE #whileTable (RowNum int IDENTITY(1,1) Primary Key, E_Name varchar(50), E_email varchar(50)) Insert into #whileTable (E_Name, E_email) Select E_Name, E_email >From NCI_Milestones.dbo.vwEmailPM Select @MaxRows = Count(*) from #whileTable WHILE EXISTS (Select * from #whileTable as vw where ( RowNum <= @MaxRows and RowNum = @RowCnt)) BEGIN SET @PMName = (select E_Name from #whileTable where RowNum = @RowCnt) SET @PMEmail = (select E_Email from #whileTable where RowNum = @RowCnt) SET @tableHTML = N'

Milestones Due

' + N'
This email is to notify you that you have a Milestone due shortly or due now on your project. Please work with your A/R Analyst to generate the necessary invoice. Once completed, please update the Milestone Database (located at https://one.nciinc.com/BusinessOperations/PM_Central/MilestoneDatabase/d efault.aspx) to check off the "Amount Received" field. However, if the milestone due date has slipped, please update the Milestone Database with the number of days slipped as well as an explanation for the slip. You will continue to receive these notices until one of these 2 actions has been taken.
' + N'' + N'' + N'' + N'' + CAST ( ( SELECT td = vw.ProjectName,'', td = MilestoneID,'', td = Milestone,'', td = OverDue,'', td = DueDate,'' FROM vwProjectsDuePM as vw WHERE PM_Name = @PMname for XML PATH('tr'), TYPE) as NVARCHAR(Max))+ N'
Project NameID#MilestoneDays Over DueDue Date
' + N'

Modified Projects

' + N'
A change was made to the project data for the following items.
' + N'' + N'' + N'' + N'' + CAST ( ( SELECT td = vw1.ProjectName,' ', td = ProjectNumber,' ', td = GM_Name,' ', td = BM_Name,' ' FROM vwProjectsModified as vw1 WHERE PM_Name = @PMName for XML PATH('tr'), TYPE) as NVARCHAR(Max))+ N'
Project NameProject NumberGM NameBusiness Manager
' + N'

Modified Milestones

' + N'
A change was made to the milestone data for the following items.
' + N'' + N'' + N'' + N'' + N'' + N'' + CAST ( ( SELECT td = vw2.ProjectName,' ', td = ProjectNumber,' ', td = Milestone,' ' , td = PM_Name,' ', td = BM_Name,' ' FROM vwMilestonesModified as vw2 WHERE PM_Name = @PMName for XML PATH('tr'), TYPE) as NVARCHAR(Max))+ N'
Project NameProject NumberMilestonePM NameBusiness Manager
' ; EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Milestone Email', @recipients = 'jhewson at nciinc.com, -- at PMEmail, @subject = 'Milestone Database Notification', @body = @tableHTML, @body_format = 'HTML'; Select @RowCnt = @RowCnt +1 END DROP TABLE #whileTable ################################################################################ If you have received this message in error, please contact the sender immediately and be aware that the use, copying, or dissemination of this information is prohibited. This email transmission contains information from NCI Information Systems, Inc. that may be considered privileged or confidential and is intended solely for the named recipient. ################################################################################ From joe.rojas at symmetrynb.com Thu Feb 19 08:33:08 2009 From: joe.rojas at symmetrynb.com (Rojas, Joe) Date: Thu, 19 Feb 2009 09:33:08 -0500 Subject: [dba-SQLServer] SQL Server 2005 - How to import data that could either update a row or insert a row. References: <7E02B06E41E5404589EDDDA2BAA1C5A83EC9AF@sanex101.nciinc.com> Message-ID: <5BAE0A5B5D7E414D96584521B26E6C09B2F9E6@DPYUSNBEXS1.snb.local> I'm using SSIS to create a Package to import data into SQL Server 2005. I need to pull data from our ERP system via ODBC. I'm doing this because we are pulling labor "punches" from our ERP system into SQL Server and the processing them to be exported to our Time and Attendance system. Our ERP system stores the "in" punch and the "out" punch for a day in one row. I will be pulling the punches several times a day which will result in some rows have both "in" and "out" punches and some rows having just an "in" punch. If a row just has an "in" punch, I still need to pull it. Because of this, I will need to "re-pull" this row each time to check for an "out" punch. So...my question. The dataset I pull will have rows that match to an existing row in the SQL Server table AND new rows that do not exist in the SQL Server table. Having one dataset pulled from the ODBC source, can I parse row by row and, based on if the row exists, I will need to execute an UPDATE statement or an INSERT statement? If so, how would I do this in a data flow task? Joe From Gustav at cactus.dk Thu Feb 19 08:51:00 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Feb 2009 15:51:00 +0100 Subject: [dba-SQLServer] SQL Server 2005 - How to import data that could either update a row or insert a row. Message-ID: Hi Joe It can be done, if the tables have a unique key. This old tip from Smart Access is one of my favourites. It's for Access but nothing Access specifics are used for the code: Update and Append Records with One Query By Alan Biggs Did you know that you can use an update query in Access to both update and add records at the same time? This is useful if you have two versions of a table, tblOld and tblNew, and you want to integrate the changes from tblNew into tblOld. Follow these steps: 1. Create an update query and add the two tables. Join the two tables by dragging the key field of tblNew onto the matching field of tblOld. 2. Double-click on the relationship and choose the join option that includes all records from tblNew and only those that match from tblOld. 3. Select all the fields from tblOld and drag them onto the QBE grid. 4. For each field, in the Update To cell type in tblNew.FieldName, where FieldName matches the field name of tblOld. 5. Select Query Properties from the View menu and change Unique Records to False. (This switches off the DISTINCTROW option in the SQL view. If you leave this on you'll get only one blank record in your results, but you want one blank record for each new record to be added to tblOld.) 6. Run the query and you'll see the changes to tblNew are now in tblOld. This will only add records to tblOld that have been added to tblNew. Records in tblOld that aren't present in tblNew will still remain in tblOld. /gustav >>> joe.rojas at symmetrynb.com 19-02-2009 15:33 >>> I'm using SSIS to create a Package to import data into SQL Server 2005. I need to pull data from our ERP system via ODBC. I'm doing this because we are pulling labor "punches" from our ERP system into SQL Server and the processing them to be exported to our Time and Attendance system. Our ERP system stores the "in" punch and the "out" punch for a day in one row. I will be pulling the punches several times a day which will result in some rows have both "in" and "out" punches and some rows having just an "in" punch. If a row just has an "in" punch, I still need to pull it. Because of this, I will need to "re-pull" this row each time to check for an "out" punch. So...my question. The dataset I pull will have rows that match to an existing row in the SQL Server table AND new rows that do not exist in the SQL Server table. Having one dataset pulled from the ODBC source, can I parse row by row and, based on if the row exists, I will need to execute an UPDATE statement or an INSERT statement? If so, how would I do this in a data flow task? Joe From joe.rojas at symmetrynb.com Thu Feb 19 09:18:19 2009 From: joe.rojas at symmetrynb.com (Rojas, Joe) Date: Thu, 19 Feb 2009 10:18:19 -0500 Subject: [dba-SQLServer] SQL Server 2005 - How to import data that couldeither update a row or insert a row. References: Message-ID: <5BAE0A5B5D7E414D96584521B26E6C09B2FA09@DPYUSNBEXS1.snb.local> Thanks Gustav, I should have mentioned that I'm still learning how to make SSIS packages. How can I achieve the steps below in an SSIS package? Joe -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, February 19, 2009 9:51 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL Server 2005 - How to import data that couldeither update a row or insert a row. Hi Joe It can be done, if the tables have a unique key. This old tip from Smart Access is one of my favourites. It's for Access but nothing Access specifics are used for the code: Update and Append Records with One Query By Alan Biggs Did you know that you can use an update query in Access to both update and add records at the same time? This is useful if you have two versions of a table, tblOld and tblNew, and you want to integrate the changes from tblNew into tblOld. Follow these steps: 1. Create an update query and add the two tables. Join the two tables by dragging the key field of tblNew onto the matching field of tblOld. 2. Double-click on the relationship and choose the join option that includes all records from tblNew and only those that match from tblOld. 3. Select all the fields from tblOld and drag them onto the QBE grid. 4. For each field, in the Update To cell type in tblNew.FieldName, where FieldName matches the field name of tblOld. 5. Select Query Properties from the View menu and change Unique Records to False. (This switches off the DISTINCTROW option in the SQL view. If you leave this on you'll get only one blank record in your results, but you want one blank record for each new record to be added to tblOld.) 6. Run the query and you'll see the changes to tblNew are now in tblOld. This will only add records to tblOld that have been added to tblNew. Records in tblOld that aren't present in tblNew will still remain in tblOld. /gustav >>> joe.rojas at symmetrynb.com 19-02-2009 15:33 >>> I'm using SSIS to create a Package to import data into SQL Server 2005. I need to pull data from our ERP system via ODBC. I'm doing this because we are pulling labor "punches" from our ERP system into SQL Server and the processing them to be exported to our Time and Attendance system. Our ERP system stores the "in" punch and the "out" punch for a day in one row. I will be pulling the punches several times a day which will result in some rows have both "in" and "out" punches and some rows having just an "in" punch. If a row just has an "in" punch, I still need to pull it. Because of this, I will need to "re-pull" this row each time to check for an "out" punch. So...my question. The dataset I pull will have rows that match to an existing row in the SQL Server table AND new rows that do not exist in the SQL Server table. Having one dataset pulled from the ODBC source, can I parse row by row and, based on if the row exists, I will need to execute an UPDATE statement or an INSERT statement? If so, how would I do this in a data flow task? Joe _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Gustav at cactus.dk Thu Feb 19 09:23:52 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Feb 2009 16:23:52 +0100 Subject: [dba-SQLServer] SQL Server 2005 - How to import data that could either update a row or insert Message-ID: Hi Joe I don't use the SSIS package so I can't tell. But do a test in Access - it is very simple and easy to do - and then redo the SQL modified for your actual tables in SSIS. /gustav >>> joe.rojas at symmetrynb.com 19-02-2009 16:18 >>> Thanks Gustav, I should have mentioned that I'm still learning how to make SSIS packages. How can I achieve the steps below in an SSIS package? Joe -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, February 19, 2009 9:51 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL Server 2005 - How to import data that couldeither update a row or insert a row. Hi Joe It can be done, if the tables have a unique key. This old tip from Smart Access is one of my favourites. It's for Access but nothing Access specifics are used for the code: Update and Append Records with One Query By Alan Biggs Did you know that you can use an update query in Access to both update and add records at the same time? This is useful if you have two versions of a table, tblOld and tblNew, and you want to integrate the changes from tblNew into tblOld. Follow these steps: 1. Create an update query and add the two tables. Join the two tables by dragging the key field of tblNew onto the matching field of tblOld. 2. Double-click on the relationship and choose the join option that includes all records from tblNew and only those that match from tblOld. 3. Select all the fields from tblOld and drag them onto the QBE grid. 4. For each field, in the Update To cell type in tblNew.FieldName, where FieldName matches the field name of tblOld. 5. Select Query Properties from the View menu and change Unique Records to False. (This switches off the DISTINCTROW option in the SQL view. If you leave this on you'll get only one blank record in your results, but you want one blank record for each new record to be added to tblOld.) 6. Run the query and you'll see the changes to tblNew are now in tblOld. This will only add records to tblOld that have been added to tblNew. Records in tblOld that aren't present in tblNew will still remain in tblOld. /gustav >>> joe.rojas at symmetrynb.com 19-02-2009 15:33 >>> I'm using SSIS to create a Package to import data into SQL Server 2005. I need to pull data from our ERP system via ODBC. I'm doing this because we are pulling labor "punches" from our ERP system into SQL Server and the processing them to be exported to our Time and Attendance system. Our ERP system stores the "in" punch and the "out" punch for a day in one row. I will be pulling the punches several times a day which will result in some rows have both "in" and "out" punches and some rows having just an "in" punch. If a row just has an "in" punch, I still need to pull it. Because of this, I will need to "re-pull" this row each time to check for an "out" punch. So...my question. The dataset I pull will have rows that match to an existing row in the SQL Server table AND new rows that do not exist in the SQL Server table. Having one dataset pulled from the ODBC source, can I parse row by row and, based on if the row exists, I will need to execute an UPDATE statement or an INSERT statement? If so, how would I do this in a data flow task? Joe From joe.rojas at symmetrynb.com Thu Feb 19 14:00:51 2009 From: joe.rojas at symmetrynb.com (Rojas, Joe) Date: Thu, 19 Feb 2009 15:00:51 -0500 Subject: [dba-SQLServer] SQL Server 2005 - How to import data that couldeither update a row or insert References: Message-ID: <5BAE0A5B5D7E414D96584521B26E6C09B2FAE0@DPYUSNBEXS1.snb.local> Just in case anyone is looking for a similar solution. I found this excellent link that shows step by step. http://vsteamsystemcentral.com/cs21/blogs/applied_business_intelligence/ archive/2007/05/21/ssis-design-pattern-incremental-loads.aspx Joe -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, February 19, 2009 10:24 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL Server 2005 - How to import data that couldeither update a row or insert Hi Joe I don't use the SSIS package so I can't tell. But do a test in Access - it is very simple and easy to do - and then redo the SQL modified for your actual tables in SSIS. /gustav >>> joe.rojas at symmetrynb.com 19-02-2009 16:18 >>> Thanks Gustav, I should have mentioned that I'm still learning how to make SSIS packages. How can I achieve the steps below in an SSIS package? Joe -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, February 19, 2009 9:51 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL Server 2005 - How to import data that couldeither update a row or insert a row. Hi Joe It can be done, if the tables have a unique key. This old tip from Smart Access is one of my favourites. It's for Access but nothing Access specifics are used for the code: Update and Append Records with One Query By Alan Biggs Did you know that you can use an update query in Access to both update and add records at the same time? This is useful if you have two versions of a table, tblOld and tblNew, and you want to integrate the changes from tblNew into tblOld. Follow these steps: 1. Create an update query and add the two tables. Join the two tables by dragging the key field of tblNew onto the matching field of tblOld. 2. Double-click on the relationship and choose the join option that includes all records from tblNew and only those that match from tblOld. 3. Select all the fields from tblOld and drag them onto the QBE grid. 4. For each field, in the Update To cell type in tblNew.FieldName, where FieldName matches the field name of tblOld. 5. Select Query Properties from the View menu and change Unique Records to False. (This switches off the DISTINCTROW option in the SQL view. If you leave this on you'll get only one blank record in your results, but you want one blank record for each new record to be added to tblOld.) 6. Run the query and you'll see the changes to tblNew are now in tblOld. This will only add records to tblOld that have been added to tblNew. Records in tblOld that aren't present in tblNew will still remain in tblOld. /gustav >>> joe.rojas at symmetrynb.com 19-02-2009 15:33 >>> I'm using SSIS to create a Package to import data into SQL Server 2005. I need to pull data from our ERP system via ODBC. I'm doing this because we are pulling labor "punches" from our ERP system into SQL Server and the processing them to be exported to our Time and Attendance system. Our ERP system stores the "in" punch and the "out" punch for a day in one row. I will be pulling the punches several times a day which will result in some rows have both "in" and "out" punches and some rows having just an "in" punch. If a row just has an "in" punch, I still need to pull it. Because of this, I will need to "re-pull" this row each time to check for an "out" punch. So...my question. The dataset I pull will have rows that match to an existing row in the SQL Server table AND new rows that do not exist in the SQL Server table. Having one dataset pulled from the ODBC source, can I parse row by row and, based on if the row exists, I will need to execute an UPDATE statement or an INSERT statement? If so, how would I do this in a data flow task? Joe _______________________________________________ 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 Sun Feb 22 04:03:14 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 22 Feb 2009 05:03:14 -0500 Subject: [dba-SQLServer] AdventureWorks sample files for 2008 Message-ID: <29f585dd0902220203x3f655d6ew726c50d2cbd46655@mail.gmail.com> I have tried several times to download the sample files for SQL 2008, with no joy. The MSI version tells me the MSI file is corrupt. I tried the zip file and received literally hundreds of CSV files with no instructions as to how to import them or whether the order in which they are imported matters. Does anyone have AdventureWorksDW2008 installed? If so, would you might backing it up and zipping it and sending it to me off-line? I have the 2005 version installed, but there are significant differences, making it difficult to use the book I have, Analysis Services 2005 Step by Step. TIA, Arthur From Gustav at cactus.dk Sun Feb 22 08:19:37 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 22 Feb 2009 15:19:37 +0100 Subject: [dba-SQLServer] AdventureWorks sample files for 2008 Message-ID: Hi Arthur That zip can be found here: http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=18407 However, I downloaded the 86 msi from that page and it ran fine on Vista. /gustav >>> fuller.artful at gmail.com 22-02-2009 11:03 >>> I have tried several times to download the sample files for SQL 2008, with no joy. The MSI version tells me the MSI file is corrupt. I tried the zip file and received literally hundreds of CSV files with no instructions as to how to import them or whether the order in which they are imported matters. Does anyone have AdventureWorksDW2008 installed? If so, would you might backing it up and zipping it and sending it to me off-line? I have the 2005 version installed, but there are significant differences, making it difficult to use the book I have, Analysis Services 2005 Step by Step. TIA, Arthur From fuller.artful at gmail.com Sun Feb 22 08:32:04 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 22 Feb 2009 09:32:04 -0500 Subject: [dba-SQLServer] AdventureWorks sample files for 2008 In-Reply-To: References: Message-ID: <29f585dd0902220632s7be80a73la2153c268e8e3316@mail.gmail.com> Curious. I've downloaded the MSI three times and each time got an error almost immediately. Also running Vista. I already have the zip file with its dozens or hundreds of csv files but as I said I'm unsure how to proceed with loading all these files. Arthur On Sun, Feb 22, 2009 at 9:19 AM, Gustav Brock wrote: > Hi Arthur > > That zip can be found here: > > > http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=18407 > > However, I downloaded the 86 msi from that page and it ran fine on Vista. > > /gustav > > From Gustav at cactus.dk Sun Feb 22 09:42:24 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 22 Feb 2009 16:42:24 +0100 Subject: [dba-SQLServer] AdventureWorks sample files for 2008 Message-ID: Hi Arthur The zip seems to be for the situation where you do not have full text search installed and enabled. Paragraph A3 here: http://www.ssas-info.com/analysis-services-faq/29-mgmt/242-how-install-adventure-works-dw-database-analysis-services-2005-sample-database /gustav >>> fuller.artful at gmail.com 22-02-2009 15:32 >>> Curious. I've downloaded the MSI three times and each time got an error almost immediately. Also running Vista. I already have the zip file with its dozens or hundreds of csv files but as I said I'm unsure how to proceed with loading all these files. Arthur On Sun, Feb 22, 2009 at 9:19 AM, Gustav Brock wrote: > Hi Arthur > > That zip can be found here: > > > http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=18407 > > However, I downloaded the 86 msi from that page and it ran fine on Vista. > > /gustav From ssharkins at gmail.com Mon Feb 23 12:07:28 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 23 Feb 2009 13:07:28 -0500 Subject: [dba-SQLServer] Does view support column alias? Message-ID: I thought views supported column alias for a derived column, but I'm getting an error when I refer to the aliased column in a WHERE clause -- am I mistaken about this? CREATE VIEW FROM transactions SELECT id, quantity * cost AS [Total Cost] WHERE [Total Cost] > 100 Plain SQL returns an error -- I know that -- but I expected the View to handle the column alias in the WHERE clause. Not finding anything helpful so far. I can't even say why I thought the View would handle this other than I guess I've read it somewhere and it stuck. I can't find any views where I've actually applied this. Susan H. From fhtapia at gmail.com Mon Feb 23 13:08:42 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 23 Feb 2009 11:08:42 -0800 Subject: [dba-SQLServer] Does view support column alias? In-Reply-To: References: Message-ID: Within the view... you'll need to write it as: CREATE VIEW FROM transactions SELECT id, quantity * cost AS [Total Cost] WHERE quantity * cost > 100 -Francisco http://sqlthis.blogspot.com | Tsql and More... On Mon, Feb 23, 2009 at 10:07 AM, Susan Harkins wrote: > I thought views supported column alias for a derived column, but I'm > getting > an error when I refer to the aliased column in a WHERE clause -- am I > mistaken about this? > > CREATE VIEW > FROM transactions > SELECT id, quantity * cost AS [Total Cost] > WHERE [Total Cost] > 100 > > Plain SQL returns an error -- I know that -- but I expected the View to > handle the column alias in the WHERE clause. Not finding anything helpful > so > far. I can't even say why I thought the View would handle this other than I > guess I've read it somewhere and it stuck. I can't find any views where > I've > actually applied this. > > Susan H. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From ssharkins at gmail.com Mon Feb 23 13:18:40 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 23 Feb 2009 14:18:40 -0500 Subject: [dba-SQLServer] Does view support column alias? References: Message-ID: <8E09A6A9203C44B388B321326F6BA128@SusanOne> That's the result I got too Francisco -- I'm wondering now what put that idea into my head -- it obviously is incorrect. Thanks for verifying it! Susan H. > Within the view... you'll need to write it as: > CREATE VIEW > FROM transactions > SELECT id, quantity * cost AS [Total Cost] > WHERE quantity * cost > 100 From fhtapia at gmail.com Mon Feb 23 13:43:58 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 23 Feb 2009 11:43:58 -0800 Subject: [dba-SQLServer] Does view support column alias? In-Reply-To: <8E09A6A9203C44B388B321326F6BA128@SusanOne> References: <8E09A6A9203C44B388B321326F6BA128@SusanOne> Message-ID: No Problem. Sometimes when you need those types of calculations you can just create the calculated columns out of your table, then your view is just that a select * from transactions where cost >100 -Francisco http://sqlthis.blogspot.com | Tsql and More... On Mon, Feb 23, 2009 at 11:18 AM, Susan Harkins wrote: > That's the result I got too Francisco -- I'm wondering now what put that > idea into my head -- it obviously is incorrect. Thanks for verifying it! > > Susan H. > > > > Within the view... you'll need to write it as: > > CREATE VIEW > > FROM transactions > > SELECT id, quantity * cost AS [Total Cost] > > WHERE quantity * cost > 100 > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From ssharkins at gmail.com Mon Feb 23 14:36:58 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 23 Feb 2009 15:36:58 -0500 Subject: [dba-SQLServer] Does view support column alias? References: <8E09A6A9203C44B388B321326F6BA128@SusanOne> Message-ID: That's what i did -- used a derived table. Susan H. > No Problem. Sometimes when you need those types of calculations you can > just create the calculated columns out of your table, then your view is > just > that a select * from transactions where cost >100 > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Mon, Feb 23, 2009 at 11:18 AM, Susan Harkins > wrote: > >> That's the result I got too Francisco -- I'm wondering now what put that >> idea into my head -- it obviously is incorrect. Thanks for verifying it! >> >> Susan H. >> >> >> > Within the view... you'll need to write it as: >> > CREATE VIEW >> > FROM transactions >> > SELECT id, quantity * cost AS [Total Cost] >> > WHERE quantity * cost > 100 >> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From fuller.artful at gmail.com Mon Feb 23 15:31:01 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 23 Feb 2009 16:31:01 -0500 Subject: [dba-SQLServer] Does view support column alias? In-Reply-To: References: <8E09A6A9203C44B388B321326F6BA128@SusanOne> Message-ID: <29f585dd0902231331w9a16189j481d24ee890e8358@mail.gmail.com> IIRC this is version-specific. Prior to SQL 2008 you had to do it Francisco's way, but I think SQL 2008 lets you do it the intuitive way. A. On Mon, Feb 23, 2009 at 3:36 PM, Susan Harkins wrote: > That's what i did -- used a derived table. > > Susan H. > From joe.rojas at symmetrynb.com Tue Feb 24 13:45:46 2009 From: joe.rojas at symmetrynb.com (Rojas, Joe) Date: Tue, 24 Feb 2009 14:45:46 -0500 Subject: [dba-SQLServer] SQL Server 2005: When is a job scheduled to run next References: <8E09A6A9203C44B388B321326F6BA128@SusanOne> <29f585dd0902231331w9a16189j481d24ee890e8358@mail.gmail.com> Message-ID: <5BAE0A5B5D7E414D96584521B26E6C09BC5CAC@DPYUSNBEXS1.snb.local> Hi All, This must be a case of me just being blind. In SQL Server 7, when you look at the jobs under the SQL Agent, it would should things like last run time and next run time. In 2005, all I see is the job name and whether or not it is running. How can I see the next time a job is going to run? Joe From JHewson at nciinc.com Tue Feb 24 13:59:00 2009 From: JHewson at nciinc.com (Hewson, Jim ) Date: Tue, 24 Feb 2009 13:59:00 -0600 Subject: [dba-SQLServer] SQL Server 2005: When is a job scheduled to run next In-Reply-To: <5BAE0A5B5D7E414D96584521B26E6C09BC5CAC@DPYUSNBEXS1.snb.local> References: <8E09A6A9203C44B388B321326F6BA128@SusanOne><29f585dd0902231331w9a16189j481d24ee890e8358@mail.gmail.com> <5BAE0A5B5D7E414D96584521B26E6C09BC5CAC@DPYUSNBEXS1.snb.local> Message-ID: <7E02B06E41E5404589EDDDA2BAA1C5A83ECA59@sanex101.nciinc.com> You should have the option to review the Job Activity Monitor. It will give you the Last Run Outcome, Last Run Time and the Next Run. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Rojas, Joe Sent: Tuesday, February 24, 2009 1:46 PM To: Discussion concerning MS SQL Server Subject: [dba-SQLServer] SQL Server 2005: When is a job scheduled to run next Hi All, This must be a case of me just being blind. In SQL Server 7, when you look at the jobs under the SQL Agent, it would should things like last run time and next run time. In 2005, all I see is the job name and whether or not it is running. How can I see the next time a job is going to run? Joe _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com ################################################################################ If you have received this message in error, please contact the sender immediately and be aware that the use, copying, or dissemination of this information is prohibited. This email transmission contains information from NCI Information Systems, Inc. that may be considered privileged or confidential and is intended solely for the named recipient. ################################################################################ From joe.rojas at symmetrynb.com Tue Feb 24 14:42:29 2009 From: joe.rojas at symmetrynb.com (Rojas, Joe) Date: Tue, 24 Feb 2009 15:42:29 -0500 Subject: [dba-SQLServer] SQL Server 2005: When is a job scheduled to runnext References: <8E09A6A9203C44B388B321326F6BA128@SusanOne><29f585dd0902231331w9a16189j481d24ee890e8358@mail.gmail.com><5BAE0A5B5D7E414D96584521B26E6C09BC5CAC@DPYUSNBEXS1.snb.local> <7E02B06E41E5404589EDDDA2BAA1C5A83ECA59@sanex101.nciinc.com> Message-ID: <5BAE0A5B5D7E414D96584521B26E6C09BC5CBF@DPYUSNBEXS1.snb.local> EXCELLENT! Thank you. Joe -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Hewson, Jim Sent: Tuesday, February 24, 2009 2:59 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL Server 2005: When is a job scheduled to runnext You should have the option to review the Job Activity Monitor. It will give you the Last Run Outcome, Last Run Time and the Next Run. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Rojas, Joe Sent: Tuesday, February 24, 2009 1:46 PM To: Discussion concerning MS SQL Server Subject: [dba-SQLServer] SQL Server 2005: When is a job scheduled to run next Hi All, This must be a case of me just being blind. In SQL Server 7, when you look at the jobs under the SQL Agent, it would should things like last run time and next run time. In 2005, all I see is the job name and whether or not it is running. How can I see the next time a job is going to run? Joe _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com ######################################################################## ######## If you have received this message in error, please contact the sender immediately and be aware that the use, copying, or dissemination of this information is prohibited. This email transmission contains information from NCI Information Systems, Inc. that may be considered privileged or confidential and is intended solely for the named recipient. ######################################################################## ######## _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com