From subs at solution-providers.ie Tue Jul 1 02:25:12 2003 From: subs at solution-providers.ie (Mark L. Breen) Date: Tue, 1 Jul 2003 08:25:12 +0100 Subject: [dba-SQLServer]CoInitialize has not Been Called References: Message-ID: <00bb01c33fa8$420eaee0$c86da8c0@D8TZHN0J> Hello Karen, I hav experienced this also, I think that a SP for SQL fixes it, but I am not sure, when you find out, would you let me know? Thanks Mark ----- Original Message ----- From: "Nicholson, Karen" To: Sent: Monday, June 30, 2003 3:36 PM Subject: [dba-SQLServer]CoInitialize has not Been Called > Does anyone know what this annoyance refers to? It seems to happen quite > often when I have SQL server opened, open up Crystal Reports 7.0 to run some > reports, and then return to SQL to do more work. Thanks. > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From Robert.Djabarov at usaa.com Tue Jul 1 09:29:18 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 1 Jul 2003 09:29:18 -0500 Subject: [dba-SQLServer]Log on showing same user as previous Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DAC096@ex02.eagle.usaa.com> Check out SaveSetting/GetSetting in VB/VBA BOL. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: David Emerson [mailto:davide at dalyn.co.nz] Sent: Monday, June 30, 2003 11:47 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Log on showing same user as previous I have an AXP ADP FE which is on several users computers. It is connected to an SQL2000 BE. I used a full copy of Access to make the initial connection with the database. However the users have various user names that they log in as. Currently when they start up the runtime version it asks for the user and password for the SQL database. The user defaults to the user that I logged on as to make the initial connection. The users want it changed so that when the box appears asking for the user and password, that the same user as they previously logged on as is in the user field and they only need to enter the password (it worked in Access 97 so they want the same thing now). Each user does not have a full copy of access so that they can set up their connections. I also don't want to have to make individual copies of the FE and connect then for each user. Is there some way for Access/SQL to remember the last user that logged on and use this for logging on? I can extract the current user from the CurrentProject.Connection.ConnectionString property but where do I go from here? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From davide at dalyn.co.nz Tue Jul 1 19:27:44 2003 From: davide at dalyn.co.nz (David Emerson) Date: Wed, 02 Jul 2003 12:27:44 +1200 Subject: [dba-SQLServer]Log on showing same user as previous In-Reply-To: <5A31F89EC4C79B49B5030FF2EF58E9D202DAC096@ex02.eagle.usaa.c om> Message-ID: <5.2.0.9.0.20030702122427.00b84ea8@mail.dalyn.co.nz> This takes me to the MSDN website. It seems that the solution is to make changes to the registry settings. Is this correct? I am not sure if this is the correct solution as the user name must be stored in the actual FE itself (and not on the computer - otherwise the user that was used to link initially to the BE wouldn't appear on another computer that the FE has been copied to.) Can anyone else help me out or explain further? David At 1/07/2003, you wrote: >Check out SaveSetting/GetSetting in VB/VBA BOL. > >Robert Djabarov >Senior SQL Server DBA >USAA IT/DBMS >? (210) 913-3148 - phone >? (210) 753-3148 - pager > > > -----Original Message----- >From: David Emerson [mailto:davide at dalyn.co.nz] >Sent: Monday, June 30, 2003 11:47 PM >To: dba-SQLServer at databaseadvisors.com >Subject: [dba-SQLServer]Log on showing same user as previous > >I have an AXP ADP FE which is on several users computers. It is connected >to an SQL2000 BE. > >I used a full copy of Access to make the initial connection with the >database. However the users have various user names that they log in >as. Currently when they start up the runtime version it asks for the user >and password for the SQL database. The user defaults to the user that I >logged on as to make the initial connection. > >The users want it changed so that when the box appears asking for the user >and password, that the same user as they previously logged on as is in the >user field and they only need to enter the password (it worked in Access 97 >so they want the same thing now). > >Each user does not have a full copy of access so that they can set up their >connections. I also don't want to have to make individual copies of the FE >and connect then for each user. > >Is there some way for Access/SQL to remember the last user that logged on >and use this for logging on? I can extract the current user from the >CurrentProject.Connection.ConnectionString property but where do I go from >here? > >Regards > >David Emerson >DALYN Software Ltd >25b Cunliffe St, Johnsonville >Wellington, New Zealand >Ph/Fax (877) 456-1205 > >_______________________________________________ >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.Djabarov at usaa.com Wed Jul 2 13:38:02 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 2 Jul 2003 13:38:02 -0500 Subject: [dba-SQLServer]Log on showing same user as previous Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC2B@ex02.eagle.usaa.com> Copying FE from one PC to another does not copy registry values affected by SaveSetting/GetSetting. The first time your program is executed the user will have to enter his/her ID. The next time the value from the registry is retrieved via GetSetting. If a different user is logged on to the same PC for the first time, - the story is repeated all over. Of course it is possible to keep this information on the database server, but then the actual connection has to be made using hard-coded credentials that must never change. This makes your app more rigid to distribution and more demanding for recovery purposes. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: David Emerson [mailto:davide at dalyn.co.nz] Sent: Tuesday, July 01, 2003 7:28 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Log on showing same user as previous This takes me to the MSDN website. It seems that the solution is to make changes to the registry settings. Is this correct? I am not sure if this is the correct solution as the user name must be stored in the actual FE itself (and not on the computer - otherwise the user that was used to link initially to the BE wouldn't appear on another computer that the FE has been copied to.) Can anyone else help me out or explain further? David At 1/07/2003, you wrote: >Check out SaveSetting/GetSetting in VB/VBA BOL. > >Robert Djabarov >Senior SQL Server DBA >USAA IT/DBMS >? (210) 913-3148 - phone >? (210) 753-3148 - pager > > > -----Original Message----- >From: David Emerson [mailto:davide at dalyn.co.nz] >Sent: Monday, June 30, 2003 11:47 PM >To: dba-SQLServer at databaseadvisors.com >Subject: [dba-SQLServer]Log on showing same user as previous > >I have an AXP ADP FE which is on several users computers. It is connected >to an SQL2000 BE. > >I used a full copy of Access to make the initial connection with the >database. However the users have various user names that they log in >as. Currently when they start up the runtime version it asks for the user >and password for the SQL database. The user defaults to the user that I >logged on as to make the initial connection. > >The users want it changed so that when the box appears asking for the user >and password, that the same user as they previously logged on as is in the >user field and they only need to enter the password (it worked in Access 97 >so they want the same thing now). > >Each user does not have a full copy of access so that they can set up their >connections. I also don't want to have to make individual copies of the FE >and connect then for each user. > >Is there some way for Access/SQL to remember the last user that logged on >and use this for logging on? I can extract the current user from the >CurrentProject.Connection.ConnectionString property but where do I go from >here? > >Regards > >David Emerson >DALYN Software Ltd >25b Cunliffe St, Johnsonville >Wellington, New Zealand >Ph/Fax (877) 456-1205 > >_______________________________________________ >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 davide at dalyn.co.nz Wed Jul 2 14:03:51 2003 From: davide at dalyn.co.nz (David Emerson) Date: Thu, 03 Jul 2003 07:03:51 +1200 Subject: [dba-SQLServer]Log on showing same user as previous In-Reply-To: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC2B@ex02.eagle.usaa.com > Message-ID: <5.2.0.9.0.20030703065712.00b1e430@mail.dalyn.co.nz> Thanks for your help but I am still a bit unclear. After making the initial connection to the server on one computer I copy the FE to other computers. When the FE is opened on the other computers the logon (which is an SQL logon, not Access XP) shows the original user that was used to connect to the server. This must either be stored in the FE somewhere, OR perhaps is stored in the SQL database itself? I guess my first question is where is the default user name stored? At 2/07/2003, you wrote: >Copying FE from one PC to another does not copy registry values affected >by SaveSetting/GetSetting. The first time your program is executed the >user will have to enter his/her ID. The next time the value from the >registry is retrieved via GetSetting. If a different user is logged on to >the same PC for the first time, - the story is repeated all over. Of >course it is possible to keep this information on the database server, but >then the actual connection has to be made using hard-coded credentials >that must never change. This makes your app more rigid to distribution >and more demanding for recovery purposes. > >Robert Djabarov >Senior SQL Server DBA >USAA IT/DBMS >? (210) 913-3148 - phone >? (210) 753-3148 - pager > > > -----Original Message----- >From: David Emerson [mailto:davide at dalyn.co.nz] >Sent: Tuesday, July 01, 2003 7:28 PM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Log on showing same user as previous > >This takes me to the MSDN website. It seems that the solution is to make >changes to the registry settings. Is this correct? > >I am not sure if this is the correct solution as the user name must be >stored in the actual FE itself (and not on the computer - otherwise the >user that was used to link initially to the BE wouldn't appear on another >computer that the FE has been copied to.) > >Can anyone else help me out or explain further? > >David > >At 1/07/2003, you wrote: > >Check out SaveSetting/GetSetting in VB/VBA BOL. > > > >Robert Djabarov > >Senior SQL Server DBA > >USAA IT/DBMS > >? (210) 913-3148 - phone > >? (210) 753-3148 - pager > > > > > > -----Original Message----- > >From: David Emerson [mailto:davide at dalyn.co.nz] > >Sent: Monday, June 30, 2003 11:47 PM > >To: dba-SQLServer at databaseadvisors.com > >Subject: [dba-SQLServer]Log on showing same user as previous > > > >I have an AXP ADP FE which is on several users computers. It is connected > >to an SQL2000 BE. > > > >I used a full copy of Access to make the initial connection with the > >database. However the users have various user names that they log in > >as. Currently when they start up the runtime version it asks for the user > >and password for the SQL database. The user defaults to the user that I > >logged on as to make the initial connection. > > > >The users want it changed so that when the box appears asking for the user > >and password, that the same user as they previously logged on as is in the > >user field and they only need to enter the password (it worked in Access 97 > >so they want the same thing now). > > > >Each user does not have a full copy of access so that they can set up their > >connections. I also don't want to have to make individual copies of the FE > >and connect then for each user. > > > >Is there some way for Access/SQL to remember the last user that logged on > >and use this for logging on? I can extract the current user from the > >CurrentProject.Connection.ConnectionString property but where do I go from > >here? > > > >Regards > > > >David Emerson > >DALYN Software Ltd > >25b Cunliffe St, Johnsonville > >Wellington, New Zealand > >Ph/Fax (877) 456-1205 From tuxedo_man at hotmail.com Sat Jul 5 18:17:11 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Sat, 05 Jul 2003 23:17:11 +0000 Subject: [dba-SQLServer]changing server collation settings Message-ID: Hello: Has anyone every had problems/success with changing the server collation settings after install on SQL Server 2000. BOL says to run Rebuildm.exe to rebuild server collation settings. Anyone has any advice it would be great. Thanks in advance, Billy _________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus From tuxedo_man at hotmail.com Sat Jul 5 20:54:58 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Sun, 06 Jul 2003 01:54:58 +0000 Subject: [dba-SQLServer]Ping Again Message-ID: Pong >From: "Bryan Carbonnell" >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-vb at databaseadvisors.com, dba-sqlserver at databaseadvisors.com, >accessd at databaseadvisors.com >Subject: [dba-SQLServer]Ping Again >Date: Fri, 27 Jun 2003 22:29:37 -0400 > >Ping. > >-- >Bryan Carbonnell - carbonnb at sympatico.ca >Never be afraid to try something new. Remember, amateurs built the >ark, and professionals built the Titanic. > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From tuxedo_man at hotmail.com Mon Jul 7 11:26:59 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Mon, 07 Jul 2003 16:26:59 +0000 Subject: [dba-SQLServer]Collation SQL Challenge Message-ID: Can anyone tell me an easy way to solve the following two sql statements? -------------------------------------------------- DECLARE @table_a TABLE(THE_ID INT NOT NULL, THE_VALUE VARCHAR(20) Collate Latin1_General_CI_AS) DECLARE @table_b TABLE(THE_ID INT NOT NULL, THE_VALUE VARCHAR(20) Collate SQL_Latin1_General_CP1_CI_AS) SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE FROM @table_a UNION SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE FROM @table_b; /* The above produces the following error message: Server: Msg 446, Level 16, State 9, Line 4 Cannot resolve collation conflict for UNION operation. */ GO -------------------------------------------------- DECLARE @table_c TABLE(THE_ID INT NOT NULL, THE_VALUE VARCHAR(20) Collate Latin1_General_CI_AS) DECLARE @table_d TABLE(THE_ID INT NOT NULL, THE_VALUE VARCHAR(20) Collate SQL_Latin1_General_CP1_CI_AS) SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE FROM @table_c UNION ALL SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE FROM @table_d; /* The above produces the following error message: Server: Msg 457, Level 16, State 1, Line 5 Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict. */ GO -------------------------------------------------- Thanks in advance, Billy _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From MarkBoyd at McBeeAssociates.com Mon Jul 7 13:34:53 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Mon, 7 Jul 2003 14:34:53 -0400 Subject: [dba-SQLServer]Linked SQL Server Login Problems Message-ID: I have linked 2 SQL Servers (SQL1 and SQL2) using sp_addlinkedserver. I used this sproc to link SQL1 to SQL2, then SQL2 to SQL1. In Enterprise Mgr on SQL1 or SQL2, I can access the other server without a problem. When I use Enterprise Mgr on my laptop, I cannot connect to either server. I receive the following error: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.". I went into the properties of each linked server, and changed "...connections will be made using this security context:" to a valid login on each server. I still receive the above error, with the login in place of (null). I've also tried using sp_addlinkedsrvlogin, but have not had much luck. Any ideas as to why I am receiving this message? Any help is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ebarro at afsweb.com Mon Jul 7 13:41:15 2003 From: ebarro at afsweb.com (Eric Barro) Date: Mon, 7 Jul 2003 11:41:15 -0700 Subject: [dba-SQLServer]Linked SQL Server Login Problems In-Reply-To: Message-ID: Mark, Try and use a SQL account login instead of a Windows account login. When you log in to your laptop you need to have the same authenticated user on SQL server. My guess is that you have a separate login on your laptop thus it is passing your authentication to SQL server (that's what Trusted Connection means) in which case it fails. --- Eric Barro Senior Systems Analyst Advanced Field Services (208) 772-7060 http://www.afsweb.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mark Boyd Sent: Monday, July 07, 2003 11:35 AM To: SQLServerList Subject: [dba-SQLServer]Linked SQL Server Login Problems I have linked 2 SQL Servers (SQL1 and SQL2) using sp_addlinkedserver. I used this sproc to link SQL1 to SQL2, then SQL2 to SQL1. In Enterprise Mgr on SQL1 or SQL2, I can access the other server without a problem. When I use Enterprise Mgr on my laptop, I cannot connect to either server. I receive the following error: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.". I went into the properties of each linked server, and changed "...connections will be made using this security context:" to a valid login on each server. I still receive the above error, with the login in place of (null). I've also tried using sp_addlinkedsrvlogin, but have not had much luck. Any ideas as to why I am receiving this message? Any help is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.493 / Virus Database: 292 - Release Date: 6/25/2003 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuxedo_man at hotmail.com Mon Jul 7 13:44:55 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Mon, 07 Jul 2003 18:44:55 +0000 Subject: [dba-SQLServer]Table variable question Message-ID: Question regarding the table variable: In a SQL Server install, we have the following: Server collation: Latin1_General_CI_AS Database collation: SQL_Latin1_General_CP1_CI_AS If you create a table variable with a varchar field, what collation is it? A) Latin1_General_CI_AS B) SQL_Latin1_General_CP1_CI_AS Is it A) or B)? thanks in advance, Billy _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From MarkBoyd at McBeeAssociates.com Mon Jul 7 14:08:01 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Mon, 7 Jul 2003 15:08:01 -0400 Subject: [dba-SQLServer]Linked SQL Server Login Problems Message-ID: Eric - Thanks for the reply. I have now created a new login on SQL1, named MarkB, with SQL Server Authentication. This is the same network login I use when booting up my laptop. I changed the security option "...connections will be made using this security context:" to MarkB, and my network password. Although, I am still receiving the error "Login failed for user 'MarkB'. Reason: Not associated with a trusted SQL Server connection.". What am I missing? Thanks, Mark -----Original Message----- From: Eric Barro [mailto:ebarro at afsweb.com] Sent: Monday, July 07, 2003 2:41 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Linked SQL Server Login Problems Mark, Try and use a SQL account login instead of a Windows account login. When you log in to your laptop you need to have the same authenticated user on SQL server. My guess is that you have a separate login on your laptop thus it is passing your authentication to SQL server (that's what Trusted Connection means) in which case it fails. --- Eric Barro Senior Systems Analyst Advanced Field Services (208) 772-7060 http://www.afsweb.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mark Boyd Sent: Monday, July 07, 2003 11:35 AM To: SQLServerList Subject: [dba-SQLServer]Linked SQL Server Login Problems I have linked 2 SQL Servers (SQL1 and SQL2) using sp_addlinkedserver. I used this sproc to link SQL1 to SQL2, then SQL2 to SQL1. In Enterprise Mgr on SQL1 or SQL2, I can access the other server without a problem. When I use Enterprise Mgr on my laptop, I cannot connect to either server. I receive the following error: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.". I went into the properties of each linked server, and changed "...connections will be made using this security context:" to a valid login on each server. I still receive the above error, with the login in place of (null). I've also tried using sp_addlinkedsrvlogin, but have not had much luck. Any ideas as to why I am receiving this message? Any help is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ebarro at afsweb.com Mon Jul 7 14:30:26 2003 From: ebarro at afsweb.com (Eric Barro) Date: Mon, 7 Jul 2003 12:30:26 -0700 Subject: [dba-SQLServer]Linked SQL Server Login Problems In-Reply-To: Message-ID: Mark, When you configure your EM connection from your laptop you need to uncheck the trusted connection box and instead use SQL server authentication instead of Windows authentication. Windows is trying to pass your Windows authentication to the SQL server. Since you are not on the same domain as the SQL server when you connect it will see you as a "different user". In other words you won't be using the same security context. --- Eric Barro Senior Systems Analyst Advanced Field Services (208) 772-7060 http://www.afsweb.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mark Boyd Sent: Monday, July 07, 2003 12:08 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Linked SQL Server Login Problems Eric ? Thanks for the reply. I have now created a new login on SQL1, named MarkB, with SQL Server Authentication. This is the same network login I use when booting up my laptop. I changed the security option "...connections will be made using this security context:" to MarkB, and my network password. Although, I am still receiving the error ?Login failed for user 'MarkB'. Reason: Not associated with a trusted SQL Server connection.?. What am I missing? Thanks, Mark -----Original Message----- From: Eric Barro [mailto:ebarro at afsweb.com] Sent: Monday, July 07, 2003 2:41 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Linked SQL Server Login Problems Mark, Try and use a SQL account login instead of a Windows account login. When you log in to your laptop you need to have the same authenticated user on SQL server. My guess is that you have a separate login on your laptop thus it is passing your authentication to SQL server (that's what Trusted Connection means) in which case it fails. --- Eric Barro Senior Systems Analyst Advanced Field Services (208) 772-7060 http://www.afsweb.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mark Boyd Sent: Monday, July 07, 2003 11:35 AM To: SQLServerList Subject: [dba-SQLServer]Linked SQL Server Login Problems I have linked 2 SQL Servers (SQL1 and SQL2) using sp_addlinkedserver. I used this sproc to link SQL1 to SQL2, then SQL2 to SQL1. In Enterprise Mgr on SQL1 or SQL2, I can access the other server without a problem. When I use Enterprise Mgr on my laptop, I cannot connect to either server. I receive the following error: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.". I went into the properties of each linked server, and changed "...connections will be made using this security context:" to a valid login on each server. I still receive the above error, with the login in place of (null). I've also tried using sp_addlinkedsrvlogin, but have not had much luck. Any ideas as to why I am receiving this message? Any help is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.493 / Virus Database: 292 - Release Date: 6/25/2003 -------------- next part -------------- An HTML attachment was scrubbed... URL: From MPorter at acsalaska.com Mon Jul 7 19:53:34 2003 From: MPorter at acsalaska.com (Porter, Mark) Date: Mon, 7 Jul 2003 16:53:34 -0800 Subject: [dba-SQLServer] Any Siebel to SQL 7 development experience on this list? Message-ID: This transmittal may contain confidential information intended solely for the addressee. If you are not the intended recipient, you are hereby notified that you have received this transmittal in error; any review, dissemination, distribution or copying of this transmittal is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (collect at 907-564-1000) and ask to speak with the message sender. In addition, please immediately delete this message and all attachments. Thank you. From MarkBoyd at McBeeAssociates.com Tue Jul 8 08:39:03 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Tue, 8 Jul 2003 09:39:03 -0400 Subject: [dba-SQLServer]Linked SQL Server Login Problems Message-ID: Eric - Thanks for your help. I think I finally got it working. I believe one of the main issues was the way the 2 servers were configured. The authentication was set up as 'Windows Only' on both machines. I changed this to 'SQL Server and Windows', then created a login with SQL authentication. Everything looks good. Thanks again, Mark -----Original Message----- From: Eric Barro [mailto:ebarro at afsweb.com] Sent: Monday, July 07, 2003 3:30 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Linked SQL Server Login Problems Mark, When you configure your EM connection from your laptop you need to uncheck the trusted connection box and instead use SQL server authentication instead of Windows authentication. Windows is trying to pass your Windows authentication to the SQL server. Since you are not on the same domain as the SQL server when you connect it will see you as a "different user". In other words you won't be using the same security context. --- Eric Barro Senior Systems Analyst Advanced Field Services (208) 772-7060 http://www.afsweb.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mark Boyd Sent: Monday, July 07, 2003 12:08 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Linked SQL Server Login Problems Eric - Thanks for the reply. I have now created a new login on SQL1, named MarkB, with SQL Server Authentication. This is the same network login I use when booting up my laptop. I changed the security option "...connections will be made using this security context:" to MarkB, and my network password. Although, I am still receiving the error "Login failed for user 'MarkB'. Reason: Not associated with a trusted SQL Server connection.". What am I missing? Thanks, Mark -----Original Message----- From: Eric Barro [mailto:ebarro at afsweb.com] Sent: Monday, July 07, 2003 2:41 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Linked SQL Server Login Problems Mark, Try and use a SQL account login instead of a Windows account login. When you log in to your laptop you need to have the same authenticated user on SQL server. My guess is that you have a separate login on your laptop thus it is passing your authentication to SQL server (that's what Trusted Connection means) in which case it fails. --- Eric Barro Senior Systems Analyst Advanced Field Services (208) 772-7060 http://www.afsweb.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mark Boyd Sent: Monday, July 07, 2003 11:35 AM To: SQLServerList Subject: [dba-SQLServer]Linked SQL Server Login Problems I have linked 2 SQL Servers (SQL1 and SQL2) using sp_addlinkedserver. I used this sproc to link SQL1 to SQL2, then SQL2 to SQL1. In Enterprise Mgr on SQL1 or SQL2, I can access the other server without a problem. When I use Enterprise Mgr on my laptop, I cannot connect to either server. I receive the following error: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.". I went into the properties of each linked server, and changed "...connections will be made using this security context:" to a valid login on each server. I still receive the above error, with the login in place of (null). I've also tried using sp_addlinkedsrvlogin, but have not had much luck. Any ideas as to why I am receiving this message? Any help is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Robert.Djabarov at usaa.com Tue Jul 8 13:13:14 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 8 Jul 2003 13:13:14 -0500 Subject: [dba-SQLServer]Collation SQL Challenge Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC30@ex02.eagle.usaa.com> In the first snippet, rewrite your UNION by specifying the COLLATE for either the first or the second part of the UNION: SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE Collate Latin1_General_CI_AS FROM @table_a UNION SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE FROM @table_b; Exactly the same concept applies to your second snippet. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Billy Pang [mailto:tuxedo_man at hotmail.com] Sent: Monday, July 07, 2003 11:27 AM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Collation SQL Challenge Can anyone tell me an easy way to solve the following two sql statements? -------------------------------------------------- DECLARE @table_a TABLE(THE_ID INT NOT NULL, THE_VALUE VARCHAR(20) Collate Latin1_General_CI_AS) DECLARE @table_b TABLE(THE_ID INT NOT NULL, THE_VALUE VARCHAR(20) Collate SQL_Latin1_General_CP1_CI_AS) SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE FROM @table_a UNION SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE FROM @table_b; /* The above produces the following error message: Server: Msg 446, Level 16, State 9, Line 4 Cannot resolve collation conflict for UNION operation. */ GO -------------------------------------------------- DECLARE @table_c TABLE(THE_ID INT NOT NULL, THE_VALUE VARCHAR(20) Collate Latin1_General_CI_AS) DECLARE @table_d TABLE(THE_ID INT NOT NULL, THE_VALUE VARCHAR(20) Collate SQL_Latin1_General_CP1_CI_AS) SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE FROM @table_c UNION ALL SELECT CAST(THE_ID AS VARCHAR(8)) + THE_VALUE FROM @table_d; /* The above produces the following error message: Server: Msg 457, Level 16, State 1, Line 5 Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict. */ GO -------------------------------------------------- Thanks in advance, Billy _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From MarkBoyd at McBeeAssociates.com Tue Jul 8 13:54:37 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Tue, 8 Jul 2003 14:54:37 -0400 Subject: [dba-SQLServer]Delete Publication Message-ID: I need to add a field to a table that is included in a subscription. In order to add the field, I need to first delete the subscription and publication. I deleted the subscription without a problem. However, I can't delete the publication. When attempting to delete it thru Enterprise Mgr, it freezes for a long period of time. I plan on rebooting the SQL Server first thing in the morning (hopefully this will resolve things), but am curious if there is a way to delete a publication using Query Analyzer. Any ideas? Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Fredrick_Antony at Dell.com Wed Jul 9 01:19:39 2003 From: Fredrick_Antony at Dell.com (Fredrick_Antony at Dell.com) Date: Wed, 9 Jul 2003 01:19:39 -0500 Subject: [dba-SQLServer]Delete Publication Message-ID: Below may help Use go sp_dboption 'published', false go -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Wednesday, July 09, 2003 12:25 AM To: SQLServerList Subject: [dba-SQLServer]Delete Publication I need to add a field to a table that is included in a subscription. In order to add the field, I need to first delete the subscription and publication. I deleted the subscription without a problem. However, I can't delete the publication. When attempting to delete it thru Enterprise Mgr, it freezes for a long period of time. I plan on rebooting the SQL Server first thing in the morning (hopefully this will resolve things), but am curious if there is a way to delete a publication using Query Analyzer. Any ideas? Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From MarkBoyd at McBeeAssociates.com Wed Jul 9 07:57:22 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Wed, 9 Jul 2003 08:57:22 -0400 Subject: [dba-SQLServer]Delete Publication Message-ID: Frederick - Thanks for the feedback. I finally got the publication to delete thru Enterprise Mgr. I'll definitely keep this code for future reference. Thanks again, Mark -----Original Message----- From: Fredrick_Antony at dell.com [mailto:Fredrick_Antony at dell.com] Sent: Wednesday, July 09, 2003 2:20 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Delete Publication Below may help Use go sp_dboption 'published', false go -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Wednesday, July 09, 2003 12:25 AM To: SQLServerList Subject: [dba-SQLServer]Delete Publication I need to add a field to a table that is included in a subscription. In order to add the field, I need to first delete the subscription and publication. I deleted the subscription without a problem. However, I can't delete the publication. When attempting to delete it thru Enterprise Mgr, it freezes for a long period of time. I plan on rebooting the SQL Server first thing in the morning (hopefully this will resolve things), but am curious if there is a way to delete a publication using Query Analyzer. Any ideas? Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From knicholson at gpsx.net Wed Jul 9 09:12:18 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 9 Jul 2003 09:12:18 -0500 Subject: [dba-SQLServer]sp_refreshview Message-ID: I do not have the stored procedure, sp_refreshview. SQL 7 (still). Does anyone have the procedure out there? Was this part of an upgrade? Thanks. From MarkBoyd at McBeeAssociates.com Wed Jul 9 08:22:13 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Wed, 9 Jul 2003 09:22:13 -0400 Subject: [dba-SQLServer]sp_refreshview Message-ID: Karen - This procedure is located in the master database, under Extended Stored Procedures. Mark Boyd Sr. Systems Analyst McBee Associates, Inc -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Wednesday, July 09, 2003 10:12 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]sp_refreshview I do not have the stored procedure, sp_refreshview. SQL 7 (still). Does anyone have the procedure out there? Was this part of an upgrade? Thanks. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From knicholson at gpsx.net Wed Jul 9 09:41:02 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 9 Jul 2003 09:41:02 -0500 Subject: [dba-SQLServer]sp_refreshview Message-ID: Thanks, been looking and looking for it. Now that I have found it, I am trying to figure out why this code bombs, apparently it is when it hits the sp_refreshview because if I comment out the lines for sp_refreshview, I receive the Object 'alp_app_sequence' was successfully marked for recompilation. ...(goes through all my stored procedures). DECLARE @objName VARCHAR(50) SET @objName = '' WHILE @objName IS NOT NULL BEGIN SELECT @objName = MIN( Name ) FROM SysObjects WHERE Type='P' AND Name > @objName IF @objName IS NOT NULL exec sp_refreshview @objName END SET @objName = '' WHILE @objName IS NOT NULL BEGIN SELECT @objName = MIN( Name ) FROM SysObjects WHERE Type='P' AND Name > @objName IF @objName IS NOT NULL exec sp_recompile @objName END > -----Original Message----- > From: Mark Boyd [SMTP:MarkBoyd at McBeeAssociates.com] > Sent: Wednesday, July 09, 2003 8:22 AM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]sp_refreshview > > Karen - > This procedure is located in the master database, under Extended Stored > Procedures. > > Mark Boyd > Sr. Systems Analyst > McBee Associates, Inc > > > -----Original Message----- > From: Nicholson, Karen [mailto:knicholson at gpsx.net] > Sent: Wednesday, July 09, 2003 10:12 AM > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer]sp_refreshview > > I do not have the stored procedure, sp_refreshview. SQL 7 (still). > Does > anyone have the procedure out there? Was this part of an upgrade? > Thanks. > _______________________________________________ > 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 knicholson at gpsx.net Wed Jul 9 09:55:09 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 9 Jul 2003 09:55:09 -0500 Subject: [dba-SQLServer]More on sp_refreshview Message-ID: Daaa.... I changed the first reference to refresh only views. But it chokes, thinking that Check_Constraints is not a valid name for a view, but it is. What the $#&^$%$% ?? DECLARE @objName VARCHAR(50) SET @objName = '' WHILE @objName IS NOT NULL BEGIN SELECT @objName = MIN( Name ) FROM SysObjects WHERE Type='V' AND Name > @objName /*IF @objName IS NOT NULL exec sp_refreshview @objName */ END SET @objName = '' WHILE @objName IS NOT NULL BEGIN SELECT @objName = MIN( Name ) FROM SysObjects WHERE Type='P' AND Name > @objName IF @objName IS NOT NULL exec sp_recompile @objName END From DElam at jenkens.com Wed Jul 9 09:03:00 2003 From: DElam at jenkens.com (Elam, Debbie) Date: Wed, 9 Jul 2003 09:03:00 -0500 Subject: [dba-SQLServer]sp_refreshview Message-ID: <4AAC675EBAF3D411BCA200508BCFAA8E02F21B1D@NATEXCH1> Try putting in the command USE MASTER just before that command then USE MyDatabase to set it back where you need it. Debbie -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Wednesday, July 09, 2003 9:41 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]sp_refreshview Thanks, been looking and looking for it. Now that I have found it, I am trying to figure out why this code bombs, apparently it is when it hits the sp_refreshview because if I comment out the lines for sp_refreshview, I receive the Object 'alp_app_sequence' was successfully marked for recompilation. ...(goes through all my stored procedures). DECLARE @objName VARCHAR(50) SET @objName = '' WHILE @objName IS NOT NULL BEGIN SELECT @objName = MIN( Name ) FROM SysObjects WHERE Type='P' AND Name > @objName IF @objName IS NOT NULL exec sp_refreshview @objName END SET @objName = '' WHILE @objName IS NOT NULL BEGIN SELECT @objName = MIN( Name ) FROM SysObjects WHERE Type='P' AND Name > @objName IF @objName IS NOT NULL exec sp_recompile @objName END > -----Original Message----- > From: Mark Boyd [SMTP:MarkBoyd at McBeeAssociates.com] > Sent: Wednesday, July 09, 2003 8:22 AM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]sp_refreshview > > Karen - > This procedure is located in the master database, under Extended Stored > Procedures. > > Mark Boyd > Sr. Systems Analyst > McBee Associates, Inc > > > -----Original Message----- > From: Nicholson, Karen [mailto:knicholson at gpsx.net] > Sent: Wednesday, July 09, 2003 10:12 AM > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer]sp_refreshview > > I do not have the stored procedure, sp_refreshview. SQL 7 (still). > Does > anyone have the procedure out there? Was this part of an upgrade? > Thanks. > _______________________________________________ > 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 - JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1) subject to the Attorney-Client Privilege, (2) an attorney work product, or (3) strictly confidential. If you are not the intended recipient of this message, you may not disclose, print, copy or disseminate this information. If you have received this in error, please reply and notify the sender (only) and delete the message. Unauthorized interception of this e-mail is a violation of federal criminal law. This communication does not reflect an intention by the sender or the sender's client or principal to conduct a transaction or make any agreement by electronic means. Nothing contained in this message or in any attachment shall satisfy the requirements for a writing, and nothing contained herein shall constitute a contract or electronic signature under the Electronic Signatures in Global and National Commerce Act, any version of the Uniform Electronic Transactions Act or any other statute governing electronic transactions. From JRojas at tnco-inc.com Thu Jul 10 13:19:33 2003 From: JRojas at tnco-inc.com (Joe Rojas) Date: Thu, 10 Jul 2003 14:19:33 -0400 Subject: [dba-SQLServer]Auto email users from SS7 on the 1st of month. Message-ID: <806536912C472E4A9D6515DF2E57261E239414@mercury.tnco-inc.com> Hi All, I have a database in SQL Server 7 that stores time sheet information. Users submit time sheets for the previous month. For example, on July 1st they will need to submit their time sheet for June. I have a table with the users and their e-mail addresses. What I would like SQL Server to do is on July 1st automatically send out an e-mail to the users who have not submitted a time sheet that will remind them that it is due. I do not have a problem with creating a query that will tell me who these users are, but I would like some help on how to make SQL Server run this task, on its own, every month and e-mail a reminder to the qualifying users. Any ideas? Thanks! Joe R. This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. From MarkBoyd at McBeeAssociates.com Thu Jul 10 13:46:36 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Thu, 10 Jul 2003 14:46:36 -0400 Subject: [dba-SQLServer]Failed Replication Message-ID: I'm trying to synchronize data from a SQL7 server (Publisher) to a SQL7 laptop (Subscriber). I am constantly receiving the following error: "The process could not enumerate changes at the subscriber". I've tried searching the Knowledge Base, but the articles returned don't seem to pertain to my specific issue. Any help/suggestions are greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Robert.Djabarov at usaa.com Thu Jul 10 16:31:16 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Thu, 10 Jul 2003 16:31:16 -0500 Subject: [dba-SQLServer]Auto email users from SS7 on the 1st of month. Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC32@ex02.eagle.usaa.com> You can use CDO object model to avoid having to have SQLMail running on your server. Also, here's a stored procedure that you can use as a sample. create procedure dbo.sp_send_cdosysmail ( @SMTPServer varchar(128), @From varchar(100), @To varchar(100), @Subject varchar(100)= ' ', @Body varchar(8000) = ' ' as declare @iMsg int , @hr int , @source varchar(255) , @description varchar(500), @output varchar(1000) -- Do some error handling after each step if you need to. exec @hr = sp_OACreate 'CDO.Message', @iMsg out exec @hr = sp_OASetProperty @iMsg, 'Configuration.fields("http://schemas.microsoft.com/cdo/configuration/sendusing").Value','2' exec @hr = sp_OASetProperty @iMsg, 'Configuration.fields("http://schemas.microsoft.com/cdo/configuration/smtpserver").Value', @SMTPServer exec @hr = sp_OAMethod @iMsg, 'Configuration.Fields.Update', null exec @hr = sp_OASetProperty @iMsg, 'To', @To exec @hr = sp_OASetProperty @iMsg, 'From', @From exec @hr = sp_OASetProperty @iMsg, 'Subject', cast(@Subject as varchar(100)) exec @hr = sp_OASetProperty @iMsg, 'TextBody', @Body exec @hr = sp_OAMethod @iMsg, 'Send', NULL if @hr <> 0 begin exec @hr = sp_OAGetErrorInfo null, @source out, @description out if @hr = 0 begin select @output = ' Source: ' + @source print @output select @output = ' Description: ' + @description print @output end else begin print ' sp_OAGetErrorInfo failed.' return end end exec @hr = sp_OADestroy @iMsg GO Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Joe Rojas [mailto:JRojas at tnco-inc.com] Sent: Thursday, July 10, 2003 1:20 PM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer]Auto email users from SS7 on the 1st of month. Hi All, I have a database in SQL Server 7 that stores time sheet information. Users submit time sheets for the previous month. For example, on July 1st they will need to submit their time sheet for June. I have a table with the users and their e-mail addresses. What I would like SQL Server to do is on July 1st automatically send out an e-mail to the users who have not submitted a time sheet that will remind them that it is due. I do not have a problem with creating a query that will tell me who these users are, but I would like some help on how to make SQL Server run this task, on its own, every month and e-mail a reminder to the qualifying users. Any ideas? Thanks! Joe R. This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From cjm at haleyaldrich.com Fri Jul 11 07:44:21 2003 From: cjm at haleyaldrich.com (Chris McIsaac) Date: Fri, 11 Jul 2003 08:44:21 -0400 Subject: [dba-SQLServer]Auto email users from SS7 on the 1st of month. Message-ID: <2D75DD4827824A42B818038E44FFE21F9629D3@bosmail.haleyaldrich.com> Just curious...why do you avoid using sqlmail? -----Original Message----- From: Djabarov, Robert [mailto:Robert.Djabarov at usaa.com] Sent: Thursday, July 10, 2003 5:31 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Auto email users from SS7 on the 1st of month. You can use CDO object model to avoid having to have SQLMail running on your server. Also, here's a stored procedure that you can use as a sample. From Robert.Djabarov at usaa.com Fri Jul 11 10:53:28 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Fri, 11 Jul 2003 10:53:28 -0500 Subject: [dba-SQLServer]Auto email users from SS7 on the 1st of month. Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DAC0B9@ex02.eagle.usaa.com> I wouldn't, but the company's policy dictates otherwise, so CDO is the solution. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Chris McIsaac [mailto:cjm at haleyaldrich.com] Sent: Friday, July 11, 2003 7:44 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Auto email users from SS7 on the 1st of month. Just curious...why do you avoid using sqlmail? -----Original Message----- From: Djabarov, Robert [mailto:Robert.Djabarov at usaa.com] Sent: Thursday, July 10, 2003 5:31 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Auto email users from SS7 on the 1st of month. You can use CDO object model to avoid having to have SQLMail running on your server. Also, here's a stored procedure that you can use as a sample. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From davide at dalyn.co.nz Sun Jul 13 22:44:28 2003 From: davide at dalyn.co.nz (David Emerson) Date: Mon, 14 Jul 2003 15:44:28 +1200 Subject: [dba-SQLServer]Changing Connection string server Message-ID: <5.2.0.9.0.20030714153924.00b3fcd8@mail.dalyn.co.nz> I have an application with an AXP ade and SQL2000 BE. When an updated FE is ready I can connect to the SQL Server using Access and set the connection using File .. Connection. However, I now have a situation where the SQL BE will be in another city. I need a way for the users to be able to open an updated FE and connect to their data base. They will not have Access XP and the process is to be as simple as possible. Can anyone give me some pointers to how I can do this. I will know the server name so if there was something I could do in code then this would be acceptable. Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From scapistrant at symphonyinfo.com Sun Jul 13 22:46:31 2003 From: scapistrant at symphonyinfo.com (scapistrant ) Date: Sun, 13 Jul 2003 22:46:31 -0500 Subject: [dba-SQLServer]automated response Message-ID: <10307132246.AA01396@symphonyinfo.com> I will be out of the office from July 11th through the 20th, and will not be viewing my messages until the 21st. If you have an issue requiring immediate attention, please call the main office number at 612-333-1311, or send an email to Phaedra Wilson at pwilson at symhonyinfo.com. Steve Capistrant Symphony Information Services scapistrant at symphonyinfo.com Phone: 612-333-1311 www.symphonyinfo.com 212 3rd Ave N, Ste 404 Minneapolis, MN 55401 From mikedorism at ntelos.net Mon Jul 14 06:18:44 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Mon, 14 Jul 2003 07:18:44 -0400 Subject: [dba-SQLServer]Changing Connection string server In-Reply-To: <5.2.0.9.0.20030714153924.00b3fcd8@mail.dalyn.co.nz> Message-ID: <000001c349f9$b3d0dd40$df320cd8@hargrove.internal> Create a User or System DSN via code. If you would like the code for how to do it, email me offline. Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Sunday, July 13, 2003 11:44 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Changing Connection string server I have an application with an AXP ade and SQL2000 BE. When an updated FE is ready I can connect to the SQL Server using Access and set the connection using File .. Connection. However, I now have a situation where the SQL BE will be in another city. I need a way for the users to be able to open an updated FE and connect to their data base. They will not have Access XP and the process is to be as simple as possible. Can anyone give me some pointers to how I can do this. I will know the server name so if there was something I could do in code then this would be acceptable. Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From knicholson at gpsx.net Mon Jul 14 16:20:50 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Mon, 14 Jul 2003 16:20:50 -0500 Subject: [dba-SQLServer]Crystal/SQL 7.0 Error Message-ID: Suddenly, on Sunday (sounds like an obituary) a large report running from Crystal Reports has spewed out this message: ODBC Error: [Microsoft][ODBC SQL Server Drive][SQL Server] Could not continue scan with NOLOCK due to data movement. Anyone ever see this before? Thanks. From CWortz at tea.state.tx.us Mon Jul 14 15:30:07 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Mon, 14 Jul 2003 15:30:07 -0500 Subject: [dba-SQLServer]Crystal/SQL 7.0 Error Message-ID: Karen, My guess is that somebody was moving files on the server during the time CR was trying to gather the data it needed. Charles Wortz Software Development Division Texas Education Agency 1701 N. Congress Ave Austin, TX 78701-1494 512-463-9493 CWortz at tea.state.tx.us -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Monday 2003 Jul 14 16:21 To: Dba-Sqlserver (E-mail) Subject: [dba-SQLServer]Crystal/SQL 7.0 Error Suddenly, on Sunday (sounds like an obituary) a large report running from Crystal Reports has spewed out this message: ODBC Error: [Microsoft][ODBC SQL Server Drive][SQL Server] Could not continue scan with NOLOCK due to data movement. Anyone ever see this before? Thanks. _______________________________________________ From knicholson at gpsx.net Mon Jul 14 16:34:59 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Mon, 14 Jul 2003 16:34:59 -0500 Subject: [dba-SQLServer]Crystal/SQL 7.0 Error Message-ID: That's what we thought, but we have tried it all day and keep getting the same message. > -----Original Message----- > From: Wortz, Charles [SMTP:CWortz at tea.state.tx.us] > Sent: Monday, July 14, 2003 3:30 PM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]Crystal/SQL 7.0 Error > > Karen, > > My guess is that somebody was moving files on the server during the time > CR was trying to gather the data it needed. > > Charles Wortz > Software Development Division > Texas Education Agency > 1701 N. Congress Ave > Austin, TX 78701-1494 > 512-463-9493 > CWortz at tea.state.tx.us > > > > -----Original Message----- > From: Nicholson, Karen [mailto:knicholson at gpsx.net] > Sent: Monday 2003 Jul 14 16:21 > To: Dba-Sqlserver (E-mail) > Subject: [dba-SQLServer]Crystal/SQL 7.0 Error > > > Suddenly, on Sunday (sounds like an obituary) a large report running > from Crystal Reports has spewed out this message: > > ODBC Error: [Microsoft][ODBC SQL Server Drive][SQL Server] Could not > continue scan with NOLOCK due to data movement. > > Anyone ever see this before? Thanks. > _______________________________________________ > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com From davide at dalyn.co.nz Wed Jul 16 00:02:22 2003 From: davide at dalyn.co.nz (David Emerson) Date: Wed, 16 Jul 2003 17:02:22 +1200 Subject: [dba-SQLServer]Changing Connection string server Message-ID: <5.2.0.9.0.20030716164149.00b1b380@mail.dalyn.co.nz> I am getting closer to the solution (I think). Thanks to Doris for her code but I don't think it is quite what I need. I now have the following which is called from an autoexec maco - Public Function basSetAucklandConnection() Dim sUID As String 'The user ID Dim sPWD As String 'The user password Dim sServerName As String 'The name of the MSDE or SQL Server Dim sDatabaseFileName As String 'The name of the mdf Dim sDatabaseName As String 'The name of the database Dim sConnectionString As String Application.CurrentProject.OpenConnection "" sUID = "fred" 'User ID sPWD = "mydog" 'Password sServerName = "AUCKLAND" 'Local MSDE or SQL Server sDatabaseName = "MySQLbe" 'Name of the database 'Connect this adp to new database. sConnectionString = "PROVIDER=SQLOLEDB.1;PASSWORD=" & sPWD & _ ";PERSIST SECURITY INFO=FALSE;USER ID=" & sUID & _ ";INITIAL CATALOG=" & sDatabaseName & ";DATA SOURCE=" & sServerName Application.CurrentProject.OpenConnection sConnectionString ..etc This works except for one problem - the user doesn't need to put in a password (hence no security)!! What I want is for the normal SQL logon box to appear asking for user and password. If there is not a simple way to do this then I may have to resort to an Access pop up box asking for the details and then feed these into the sUID and sPWD variables before putting them into the sConnectionString. Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From davide at dalyn.co.nz Wed Jul 16 00:15:47 2003 From: davide at dalyn.co.nz (David Emerson) Date: Wed, 16 Jul 2003 17:15:47 +1200 Subject: [dba-SQLServer]Changing Connection string server Message-ID: <5.2.0.9.0.20030716171407.00b35508@mail.dalyn.co.nz> Further to my other message - I have found a property called Prompt which is supposed to do what I want - but I can't get it to. I have tried - sConnectionString = "PROVIDER=SQLOLEDB.1;PROMPT=1" & _ ";PERSIST SECURITY INFO=FALSE;" & _ ";INITIAL CATALOG=" & sDatabaseName & ";DATA SOURCE=" & sServerName and sConnectionString = "PROVIDER=SQLOLEDB.1;PROMPT=adpromptAlways;PASSWORD=" & sPWD & _ ";PERSIST SECURITY INFO=FALSE;USER ID=" & sUID & _ ";INITIAL CATALOG=" & sDatabaseName & ";DATA SOURCE=" & sServerName but neither work (nor variations). Any pointers? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From michael.broesdorf at web.de Wed Jul 16 02:53:15 2003 From: michael.broesdorf at web.de (=?us-ascii?Q?Michael_Brosdorf?=) Date: Wed, 16 Jul 2003 09:53:15 +0200 Subject: [dba-SQLServer] Referential integrity question (Generalization/Specification) In-Reply-To: <5.2.0.9.0.20030716171407.00b35508@mail.dalyn.co.nz> Message-ID: Dear group, for an application I need to implement a generalization of data objects. As an example, let there be 3 tables: 1. Vehicles 2. Cars 3. Trucks Every vehicle is, of course a vehicle with some common properties (for instance steering wheel diameter :-)). But then it is either a car or (xor) a truck, which both have different properties that apply only to the respective type of vehicle (e.g. number of passenger seats for cars etc.). Every vehicle has an entry in tblVehicles with a unique Vehicle_ID. Additionally, every vehicle has an entry in either tblCars (Cars_ID is PK, Vehicle_ID is FK) OR tblTrucks (with Truck_ID as PK and Vehicle_ID as FK). A given Vehicle_ID can be in only one of the specific table. Is there any way to enforce referential integrity in a scheme like that using SQL Server 2000 Constraints or other mechanisms? If not, has anyone implemented something like that (using triggers?) and would like to share his/her experiences? TIA, Michael From artful at rogers.com Wed Jul 16 07:19:13 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 16 Jul 2003 08:19:13 -0400 Subject: [dba-SQLServer]Changing Connection string server In-Reply-To: <5.2.0.9.0.20030716171407.00b35508@mail.dalyn.co.nz> Message-ID: <001b01c34b94$784581d0$8e01a8c0@Rock> What you're after is exactly how my app behaves, so I thought I should look at its connection string. Here it is: Provider=Microsoft.Access.OLEDB.10.0;Persist Security Info=False;Data Source=rock;User ID='Enter your name and password';Initial Catalog=ETS_Current;Data Provider=SQLOLEDB.1 TO achieve this I created a user called 'Enter your name and password'. Then when I create the ADE file from the ADP, I log on as that user first. The point is that SQL prompts for the password, since there is none provided in the connection string. Which admittedly looks a lot like what you're trying to do. One difference is that I don't do it in code, but right from the Access File menu. Of course, I'm not trying to pick up the user ID from the system. I make them type it in. Hth, Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: July 16, 2003 1:16 AM To: dba-SQLServer at databaseadvisors.com Subject: RE: [dba-SQLServer]Changing Connection string server Further to my other message - I have found a property called Prompt which is supposed to do what I want - but I can't get it to. I have tried - sConnectionString = "PROVIDER=SQLOLEDB.1;PROMPT=1" & _ ";PERSIST SECURITY INFO=FALSE;" & _ ";INITIAL CATALOG=" & sDatabaseName & ";DATA SOURCE=" & sServerName and sConnectionString = "PROVIDER=SQLOLEDB.1;PROMPT=adpromptAlways;PASSWORD=" & sPWD & _ ";PERSIST SECURITY INFO=FALSE;USER ID=" & sUID & _ ";INITIAL CATALOG=" & sDatabaseName & ";DATA SOURCE=" & sServerName but neither work (nor variations). Any pointers? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Wed Jul 16 07:34:47 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 16 Jul 2003 08:34:47 -0400 Subject: [dba-SQLServer]Referential integrity question (Generalization/Specification) In-Reply-To: Message-ID: <001c01c34b96$a4692e40$8e01a8c0@Rock> I have done something like this, and would approach your problem like this: tblVehicles vehicleID - autonumber group - contains either "C" or "T" ... Common columns tblCars vehicleID - integer copied from tblVehicles group - always contains "C" ... Unique car columns tblTrucks vehicleID - integer copied from tblVehicles group - always contains "T" ... Unique truck columns The PK on the tblVehicles table comprises the first two columns. The PK on tblCars and tblTrucks is the same. Then create a pair of queries that join on the PK to tblCars and tblTrucks. In other words, no trucks will appear in one query and no cars in the other. For ease of implementation, I would present the list as read-only, and then when a user double-clicks an item in the list, I know immediately which form to open (frmCarDetails or frmTruckDetails). On the master form (frmVehicles), when the user wants to add a record, as soon as she chooses the group I know which table to add a row to. In my situation, I needed about 10 different detail types, so I put them in a table containing a column for the form name, which eliminated pretty much all the code required to deal with this. I just looked in the table, grabbed the form name and opened it. Hth, Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Michael Brosdorf Sent: July 16, 2003 3:53 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Referential integrity question (Generalization/Specification) Dear group, for an application I need to implement a generalization of data objects. As an example, let there be 3 tables: 1. Vehicles 2. Cars 3. Trucks Every vehicle is, of course a vehicle with some common properties (for instance steering wheel diameter :-)). But then it is either a car or (xor) a truck, which both have different properties that apply only to the respective type of vehicle (e.g. number of passenger seats for cars etc.). Every vehicle has an entry in tblVehicles with a unique Vehicle_ID. Additionally, every vehicle has an entry in either tblCars (Cars_ID is PK, Vehicle_ID is FK) OR tblTrucks (with Truck_ID as PK and Vehicle_ID as FK). A given Vehicle_ID can be in only one of the specific table. Is there any way to enforce referential integrity in a scheme like that using SQL Server 2000 Constraints or other mechanisms? If not, has anyone implemented something like that (using triggers?) and would like to share his/her experiences? TIA, Michael From CWortz at tea.state.tx.us Wed Jul 16 07:40:02 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Wed, 16 Jul 2003 07:40:02 -0500 Subject: [dba-SQLServer]Referential integrity question (Generalization/Specification) Message-ID: So how do you classify the cross-overs they are coming out with? Are they cars or trucks or both or neither? And how do you classify SUVs? Some are built on truck chassis and some on auto chassis. Unless the subclasses are mutually exclusive there is no way of implementing RI. If the subclasses are mutually exclusive, then you can write rules to prohibit the same ID being in two subtables. Charles Wortz Software Development Division Texas Education Agency 1701 N. Congress Ave Austin, TX 78701-1494 512-463-9493 CWortz at tea.state.tx.us -----Original Message----- From: Michael Brosdorf [mailto:michael.broesdorf at web.de] Sent: Wednesday 2003 Jul 16 02:53 To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Referential integrity question (Generalization/Specification) Dear group, for an application I need to implement a generalization of data objects. As an example, let there be 3 tables: 1. Vehicles 2. Cars 3. Trucks Every vehicle is, of course a vehicle with some common properties (for instance steering wheel diameter :-)). But then it is either a car or (xor) a truck, which both have different properties that apply only to the respective type of vehicle (e.g. number of passenger seats for cars etc.). Every vehicle has an entry in tblVehicles with a unique Vehicle_ID. Additionally, every vehicle has an entry in either tblCars (Cars_ID is PK, Vehicle_ID is FK) OR tblTrucks (with Truck_ID as PK and Vehicle_ID as FK). A given Vehicle_ID can be in only one of the specific table. Is there any way to enforce referential integrity in a scheme like that using SQL Server 2000 Constraints or other mechanisms? If not, has anyone implemented something like that (using triggers?) and would like to share his/her experiences? TIA, Michael From sgeller at cce.umn.edu Wed Jul 16 09:06:00 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Wed, 16 Jul 2003 09:06:00 -0500 Subject: [dba-SQLServer]Subreport not recognizing parent/child link Message-ID: A2K ADP. I have a report with a subreport in a group footer. The recordsource for each is a sproc and I have input parameters in the properties of each report. Problem is that the subreport that's in the group footer displays ALL data, not just the data for that value being grouped on. So, on the report, I get the same data in every group footer. I do have the parent and child fields identified in the properties of the subreport object on the main report. This does not happen when I use views as the recordsource for the main and subreports. What am I doing wrong? Thanks! --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 From michael.broesdorf at web.de Wed Jul 16 09:22:38 2003 From: michael.broesdorf at web.de (=?us-ascii?Q?Michael_Brosdorf?=) Date: Wed, 16 Jul 2003 16:22:38 +0200 Subject: AW: [dba-SQLServer]Referential integrity question(Generalization/Specification) In-Reply-To: Message-ID: Arthur, Charles, thank you for your comments. My application is actually not about vehicles, I used that just as an example (sorry for not making that clear). Actually it is not even a real generalization/specialization since the subclasses are totally different things. The only thing they have in common with the superclass are that they exist and that exactly one item from one of the subclasses is matched to an item of the superclass. To be precise: the superclass links dimensions (which are the subclasses) to certain key values, that are kept in yet another table. The dimensions are already existing tables in a pretty complex production database. Right now, the users want to assign the key numbers to a set of 4 dimensions (and they want to be able to use that with any combination of dimensions). But I have developed a certain mistrust in the demands of end users (especially when it comes to reporting...). Therefore I want to be able to add new dimension by simple creating an entry in a control table. That is the reason why I can't simply put the PK of the dimension tables in the table containing the key number values as foreign keys. But it looks like I will have to implement that using triggers.. A picture of the data structure I've come up with so far can be found at http://www.salabresam.de/RI%20Question.jpg The two highlighted field control the source table (ST) to which the ST_ID originates. Again, thanks for your comments! Michael -----Ursprungliche Nachricht----- Von: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Wortz, Charles Gesendet: Mittwoch, 16. Juli 2003 14:40 An: dba-sqlserver at databaseadvisors.com Betreff: RE: [dba-SQLServer]Referential integrity question(Generalization/Specification) So how do you classify the cross-overs they are coming out with? Are they cars or trucks or both or neither? And how do you classify SUVs? Some are built on truck chassis and some on auto chassis. Unless the subclasses are mutually exclusive there is no way of implementing RI. If the subclasses are mutually exclusive, then you can write rules to prohibit the same ID being in two subtables. Charles Wortz Software Development Division Texas Education Agency 1701 N. Congress Ave Austin, TX 78701-1494 512-463-9493 CWortz at tea.state.tx.us -----Original Message----- From: Michael Brosdorf [mailto:michael.broesdorf at web.de] Sent: Wednesday 2003 Jul 16 02:53 To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Referential integrity question (Generalization/Specification) Dear group, for an application I need to implement a generalization of data objects. As an example, let there be 3 tables: 1. Vehicles 2. Cars 3. Trucks Every vehicle is, of course a vehicle with some common properties (for instance steering wheel diameter :-)). But then it is either a car or (xor) a truck, which both have different properties that apply only to the respective type of vehicle (e.g. number of passenger seats for cars etc.). Every vehicle has an entry in tblVehicles with a unique Vehicle_ID. Additionally, every vehicle has an entry in either tblCars (Cars_ID is PK, Vehicle_ID is FK) OR tblTrucks (with Truck_ID as PK and Vehicle_ID as FK). A given Vehicle_ID can be in only one of the specific table. Is there any way to enforce referential integrity in a scheme like that using SQL Server 2000 Constraints or other mechanisms? If not, has anyone implemented something like that (using triggers?) and would like to share his/her experiences? TIA, Michael _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Robert.Djabarov at usaa.com Wed Jul 16 09:44:48 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 16 Jul 2003 09:44:48 -0500 Subject: [dba-SQLServer]Subreport not recognizing parent/child link Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DAC0C9@ex02.eagle.usaa.com> Sorry for the trivial question, but does the procedure for the group footer accept the key from the group as one of the parameters? If yes, then see if you can enforce an exact value to be passed rather than having a default value for the parameter (e.g. create proc test (@key int = null) as...) Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Susan Geller [mailto:sgeller at cce.umn.edu] Sent: Wednesday, July 16, 2003 9:06 AM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Subreport not recognizing parent/child link A2K ADP. I have a report with a subreport in a group footer. The recordsource for each is a sproc and I have input parameters in the properties of each report. Problem is that the subreport that's in the group footer displays ALL data, not just the data for that value being grouped on. So, on the report, I get the same data in every group footer. I do have the parent and child fields identified in the properties of the subreport object on the main report. This does not happen when I use views as the recordsource for the main and subreports. What am I doing wrong? Thanks! --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Wed Jul 16 10:39:04 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 16 Jul 2003 11:39:04 -0400 Subject: [dba-SQLServer]Subreport not recognizing parent/child link In-Reply-To: Message-ID: <004901c34bb0$631c4430$8e01a8c0@Rock> If you can, switch the subreport's recordsource to a view, leaving the main recordsource as your first sproc. Hth, Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Geller Sent: July 16, 2003 10:06 AM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Subreport not recognizing parent/child link A2K ADP. I have a report with a subreport in a group footer. The recordsource for each is a sproc and I have input parameters in the properties of each report. Problem is that the subreport that's in the group footer displays ALL data, not just the data for that value being grouped on. So, on the report, I get the same data in every group footer. I do have the parent and child fields identified in the properties of the subreport object on the main report. This does not happen when I use views as the recordsource for the main and subreports. What am I doing wrong? Thanks! --Susan From sgeller at cce.umn.edu Wed Jul 16 10:51:26 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Wed, 16 Jul 2003 10:51:26 -0500 Subject: [dba-SQLServer]Subreport not recognizing parent/child link Message-ID: The procedure for the subreport accepts the same parameters as the procedure for the main report. I'm not sure how I would pass a parameter that is the value for the group footer, although that does seem like what I need to do. Arthur, a view doesn't work b/c I need to be able to pass parameters. --Susan -----Original Message----- From: Djabarov, Robert [mailto:Robert.Djabarov at usaa.com] Sent: Wednesday, July 16, 2003 9:45 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Subreport not recognizing parent/child link Sorry for the trivial question, but does the procedure for the group footer accept the key from the group as one of the parameters? If yes, then see if you can enforce an exact value to be passed rather than having a default value for the parameter (e.g. create proc test (@key int = null) as...) Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Susan Geller [mailto:sgeller at cce.umn.edu] Sent: Wednesday, July 16, 2003 9:06 AM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Subreport not recognizing parent/child link A2K ADP. I have a report with a subreport in a group footer. The recordsource for each is a sproc and I have input parameters in the properties of each report. Problem is that the subreport that's in the group footer displays ALL data, not just the data for that value being grouped on. So, on the report, I get the same data in every group footer. I do have the parent and child fields identified in the properties of the subreport object on the main report. This does not happen when I use views as the recordsource for the main and subreports. What am I doing wrong? Thanks! --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 _______________________________________________ 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 davide at dalyn.co.nz Wed Jul 16 14:18:35 2003 From: davide at dalyn.co.nz (David Emerson) Date: Thu, 17 Jul 2003 07:18:35 +1200 Subject: [dba-SQLServer]Changing Connection string server In-Reply-To: <001b01c34b94$784581d0$8e01a8c0@Rock> References: <5.2.0.9.0.20030716171407.00b35508@mail.dalyn.co.nz> Message-ID: <5.2.0.9.0.20030717071129.00b1b9a8@mail.dalyn.co.nz> Thanks Arthur. Unfortunately, in my case I don't have access to the server to be able to do the initial logging in. However I do know the name of the server so I came up with this solution which seems to work. The Prompt property seems to only work when opening a connection, and not setting the applications connection string (Not sure why) - Public Function basSetAucklandConnection() On Error GoTo Err_basSetAucklandConnection Dim sUID As String 'The user ID Dim sPWD As String 'The user password Dim sServerName As String 'The name of the MSDE or SQL Server Dim sDatabaseName As String 'The name of the database Dim sConnectionString As String Application.CurrentProject.OpenConnection "" sServerName = "AUCKLAND" 'Local MSDE or SQL Server sDatabaseName = "SQLbe" 'Name of the database Dim cnn As ADODB.Connection, intStartPos As Integer, intStopPos As Integer StartHere: Set cnn = New ADODB.Connection With cnn .Provider = "SQLOLEDB" .Properties("Data Source") = sServerName .Properties("Initial Catalog") = sDatabaseName .Properties("Prompt") = adPromptAlways .Open End With intStartPos = InStr(cnn.ConnectionString, "User ID=") + 8 intStopPos = InStr(intStartPos, cnn.ConnectionString, ";") sUID = Mid$(cnn.ConnectionString, intStartPos, intStopPos - intStartPos) intStartPos = InStr(cnn.ConnectionString, "Password=") + 9 intStopPos = InStr(intStartPos, cnn.ConnectionString, ";") sPWD = Mid$(cnn.ConnectionString, intStartPos, intStopPos - intStartPos) cnn.Close Set cnn = Nothing 'Connect this adp to database. sConnectionString = "PROVIDER=SQLOLEDB.1;PROMPT=adpromptAlways;PASSWORD=" & sPWD & _ ";PERSIST SECURITY INFO=FALSE;USER ID=" & sUID & _ ";INITIAL CATALOG=" & sDatabaseName & ";DATA SOURCE=" & sServerName Application.CurrentProject.OpenConnection sConnectionString Exit_basSetAucklandConnection: Exit Function Err_basSetAucklandConnection: Select Case Err Case -2147217842 If MsgBox("You need to log in before you can use the programme. Do you want to try again?", vbYesNo) = vbYes Then Resume StartHere Else DoCmd.Quit End If Case Else Call basErrorMsg("basSetAucklandConnection") End Select Resume Exit_basSetAucklandConnection End Function At 16/07/2003, you wrote: >What you're after is exactly how my app behaves, so I thought I should look >at its connection string. Here it is: >Provider=Microsoft.Access.OLEDB.10.0;Persist Security Info=False;Data >Source=rock;User ID='Enter your name and password';Initial >Catalog=ETS_Current;Data Provider=SQLOLEDB.1 > >TO achieve this I created a user called 'Enter your name and password'. Then >when I create the ADE file from the ADP, I log on as that user first. The >point is that SQL prompts for the password, since there is none provided in >the connection string. > >Which admittedly looks a lot like what you're trying to do. One difference >is that I don't do it in code, but right from the Access File menu. Of >course, I'm not trying to pick up the user ID from the system. I make them >type it in. > >Hth, >Arthur > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David >Emerson >Sent: July 16, 2003 1:16 AM >To: dba-SQLServer at databaseadvisors.com >Subject: RE: [dba-SQLServer]Changing Connection string server > > >Further to my other message - I have found a property called Prompt which >is supposed to do what I want - but I can't get it to. I have tried - > > sConnectionString = "PROVIDER=SQLOLEDB.1;PROMPT=1" & _ > ";PERSIST SECURITY INFO=FALSE;" & _ > ";INITIAL CATALOG=" & sDatabaseName & ";DATA SOURCE=" & >sServerName > >and > > sConnectionString = >"PROVIDER=SQLOLEDB.1;PROMPT=adpromptAlways;PASSWORD=" & sPWD & _ > ";PERSIST SECURITY INFO=FALSE;USER ID=" & sUID & _ > ";INITIAL CATALOG=" & sDatabaseName & ";DATA SOURCE=" & >sServerName > >but neither work (nor variations). Any pointers? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From michael.broesdorf at web.de Thu Jul 17 09:56:31 2003 From: michael.broesdorf at web.de (=?us-ascii?Q?Michael_Brosdorf?=) Date: Thu, 17 Jul 2003 16:56:31 +0200 Subject: [dba-SQLServer]Trigger problem In-Reply-To: <5.2.0.9.0.20030717071129.00b1b9a8@mail.dalyn.co.nz> Message-ID: Dear group, I have a strange problem with a trigger on a view. The trigger is an instead of trigger for deletes. If I work with the view/table from within my application or SQL Analyzer, everything works fine (in that case, deletes through the view are cancelled). But, if I open the view in the Enterprise Manager, I can delete rows from the view. Now, that makes me think that something is not set up right... Here are the scripts: CREATE TABLE [Table1] ( [Test_ID] [int] NULL ) ON [PRIMARY] GO INSERT INTO Table1 values(1) INSERT INTO Table1 values(2) INSERT INTO Table1 values(3) CREATE VIEW dbo.vueTest AS SELECT * FROM dbo.Table1 CREATE TRIGGER [vueTest_Trig_D] ON vueTest INSTEAD OF DELETE AS raiserror ('Nonono!!',16,10) Any ideas? Michael From michael.broesdorf at web.de Thu Jul 17 10:08:06 2003 From: michael.broesdorf at web.de (=?us-ascii?Q?Michael_Brosdorf?=) Date: Thu, 17 Jul 2003 17:08:06 +0200 Subject: AW: [dba-SQLServer]Trigger problem (update) In-Reply-To: Message-ID: Just found out something even more strange: that statement works just fine: CREATE TRIGGER vueTest_Trig_D ON [dbo].[vueTest] instead of delete AS raiserror ('Nonono!!',16,10) But this one tells me, 'Invalid object name 'dbo.vueTest'': CREATE TRIGGER vueTest_Trig_D ON [dbo].[vueTest] For delete AS raiserror ('Nonono!!',16,10) rollback transaction AFAIK it should be possible to create a trigger on a view, or is it? Michael From michael.broesdorf at web.de Thu Jul 17 10:23:48 2003 From: michael.broesdorf at web.de (=?us-ascii?Q?Michael_Brosdorf?=) Date: Thu, 17 Jul 2003 17:23:48 +0200 Subject: AW: [dba-SQLServer]Trigger problem solved - new problem In-Reply-To: Message-ID: Just found out myself: EM seems to process data on the underlying tables directly, so the instead of trigger of the view never gets it's chance. Specifying VIEW_METADATA in the view's definition solves that problem. Does anyone have any experience if using that option has any influence if the view is linked to an Access 2000 database as a linked table? TIA, Michael -----Ursprungliche Nachricht----- Von: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Michael Brosdorf Gesendet: Donnerstag, 17. Juli 2003 17:08 An: dba-sqlserver at databaseadvisors.com Betreff: AW: [dba-SQLServer]Trigger problem (update) Just found out something even more strange: that statement works just fine: CREATE TRIGGER vueTest_Trig_D ON [dbo].[vueTest] instead of delete AS raiserror ('Nonono!!',16,10) But this one tells me, 'Invalid object name 'dbo.vueTest'': CREATE TRIGGER vueTest_Trig_D ON [dbo].[vueTest] For delete AS raiserror ('Nonono!!',16,10) rollback transaction AFAIK it should be possible to create a trigger on a view, or is it? Michael _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From davide at dalyn.co.nz Sun Jul 20 20:04:28 2003 From: davide at dalyn.co.nz (David Emerson) Date: Mon, 21 Jul 2003 13:04:28 +1200 Subject: [dba-SQLServer]Recordsource running before Open Event Message-ID: <5.2.0.9.0.20030721122304.00b46e90@mail.dalyn.co.nz> Groups, I have the following code in the Open event of a form - If Me.OpenArgs <> "All" Then Me.InputParameters = Me.OpenArgs <- Form_Current event triggers here Me.RecordSource = "spfrmGeneralJournal" Else Me.RecordSource = "spfrmGeneralJournal" End If The problem is that the "Me.InputParameters = Me.OpenArgs" triggers the Form's Current event. This is a problem because in there it checks for the value of a field and because the Recordsource hasn't been defined yet it generates an error. The reason that the record source is not defined until in the Open Event is because the front end is linked to an SQL B/E and the table that is the source has over 55,000 records which is taking over 5 seconds to open. This is opened, then the Open event is fired to produce the reduced record set (in effect the sproc is being run twice). Does anyone have a method for opening the form without the Current event being triggered before the open event is completed? (Or preventing the sproc being run before the Open event is processed)? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From davide at dalyn.co.nz Sun Jul 20 20:04:28 2003 From: davide at dalyn.co.nz (David Emerson) Date: Mon, 21 Jul 2003 13:04:28 +1200 Subject: [dba-SQLServer][AccessD] Recordsource running before Open Event Message-ID: <5.2.0.9.0.20030721122304.00b46e90@mail.dalyn.co.nz> Groups, I have the following code in the Open event of a form - If Me.OpenArgs <> "All" Then Me.InputParameters = Me.OpenArgs <- Form_Current event triggers here Me.RecordSource = "spfrmGeneralJournal" Else Me.RecordSource = "spfrmGeneralJournal" End If The problem is that the "Me.InputParameters = Me.OpenArgs" triggers the Form's Current event. This is a problem because in there it checks for the value of a field and because the Recordsource hasn't been defined yet it generates an error. The reason that the record source is not defined until in the Open Event is because the front end is linked to an SQL B/E and the table that is the source has over 55,000 records which is taking over 5 seconds to open. This is opened, then the Open event is fired to produce the reduced record set (in effect the sproc is being run twice). Does anyone have a method for opening the form without the Current event being triggered before the open event is completed? (Or preventing the sproc being run before the Open event is processed)? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From paul.hartland at fsmail.net Mon Jul 21 09:59:54 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Mon, 21 Jul 2003 14:59:54 +0000 Subject: [dba-SQLServer]Copying a record VB6 & SQL Server 7.0 Message-ID: <20030721145954.RCHZ18716.fep07-svc.ttys.com@localhost> To all, we have a high turnover of staff, mainly because most are casual workers and don't want full-time employment. When a member of staff leaves we issue them with a finish date. However if they decide they want to come back we need to re-employ them with a new payroll number, I have a re-employ button that asks the user for the new payroll number...but here is where I need help : I then need to create an identical personnel record (66 fields to the one shown on screen) but with the new payroll number. My front-end is Visual Basic 6 and my back-end is SQL Server 7.0. I thought the easiest way would be to create an insert stored procedure with parameters and then execute it from VB, so I created the SP and ran it using Query Analyser (Worked Fine), I also added it to my dataenvironment as a command. However when I type DEGenSQL.sp_Personnel_ReEmploy I get no option to enter any of the parameters and if I try RUN/Start With Full Compile I get the following error message : Compile Error : Subscript Out Of Range This makes me think there are too many parameters required. Has anyone else come across this, or does anyone know of a better way to go about this. Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. From paul.hartland at fsmail.net Mon Jul 21 09:59:54 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Mon, 21 Jul 2003 14:59:54 +0000 Subject: [dba-SQLServer][AccessD] Copying a record VB6 & SQL Server 7.0 Message-ID: <20030721145954.RCHZ18716.fep07-svc.ttys.com@localhost> To all, we have a high turnover of staff, mainly because most are casual workers and don't want full-time employment. When a member of staff leaves we issue them with a finish date. However if they decide they want to come back we need to re-employ them with a new payroll number, I have a re-employ button that asks the user for the new payroll number...but here is where I need help : I then need to create an identical personnel record (66 fields to the one shown on screen) but with the new payroll number. My front-end is Visual Basic 6 and my back-end is SQL Server 7.0. I thought the easiest way would be to create an insert stored procedure with parameters and then execute it from VB, so I created the SP and ran it using Query Analyser (Worked Fine), I also added it to my dataenvironment as a command. However when I type DEGenSQL.sp_Personnel_ReEmploy I get no option to enter any of the parameters and if I try RUN/Start With Full Compile I get the following error message : Compile Error : Subscript Out Of Range This makes me think there are too many parameters required. Has anyone else come across this, or does anyone know of a better way to go about this. Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From my.lists at verizon.net Mon Jul 21 10:21:27 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 21 Jul 2003 08:21:27 -0700 Subject: [dba-SQLServer]Copying a record VB6 & SQL Server 7.0 References: <20030721145954.RCHZ18716.fep07-svc.ttys.com@localhost> Message-ID: <004801c34f9b$c1fbb690$b615010a@FHTAPIA> Paul, it has been my experiance that when you have a long series of parameters, it is often best to pass them back using a command object. something along the line the following Dim Cmd As adodb.Command, lngAffected As Long Set Cmd = New adodb.Command With Cmd .ActiveConnection = CurrentProject.Connection .CommandType = adCmdStoredProc .CommandText = "stp_004C_Insert" .Parameters.Append .CreateParameter("@CaseNumberID", adInteger, adParamInput, , Nz(Me.txtCaseNumberID, 0)) .Parameters.Append .CreateParameter("@MachineID", adGUID, adParamInput, , Me.txtMachineID) .Parameters.Append .CreateParameter("@LoginID", adVarChar, adParamInput, 50, fOSUserName()) .Parameters.Append .CreateParameter("@ContactAddrID", adGUID, adParamInput, , Me.txtContactAddrID) .Parameters.Append .CreateParameter("@ReasonID", adInteger, adParamInput, , Me.cboReason) .Parameters.Append .CreateParameter("@Type", adInteger, adParamInput, , Me.cboType) .Parameters.Append .CreateParameter("@Unneccessary", adInteger, adParamInput, , Me.chkUnnecessary) .Parameters.Append .CreateParameter("@FailCodeID", adInteger, adParamInput, , Me.cboFailCode) .Parameters.Append .CreateParameter("@Status", adInteger, adParamInput, , Me.chkCloseCall) .Parameters.Append .CreateParameter("@CallNotes", adVarChar, adParamInput, 1000, Me.txtCallNotes) .Execute , lngAffected .ActiveConnection = Nothing End With More helpful tips on using ADO w/ Sql can be found here.. http://www.able-consulting.com/ADO_Faq.htm -Francisco http://rcm.netfirms.com On Monday, July 21, 2003 7:59 AM [GMT-8], paul.hartland at fsmail.net wrote: : To all, : : we have a high turnover of staff, mainly because most are casual : workers and don't want full-time employment. When a member of staff : leaves we issue them with a finish date. However if they decide they : want to come back we need to re-employ them with a new payroll : number, I have a re-employ button that asks the user for the new : payroll number...but here is where I need help : I then need to : create an identical personnel record (66 fields to the one shown on : screen) but with the new payroll number. : : My front-end is Visual Basic 6 and my back-end is SQL Server 7.0. I : thought the easiest way would be to create an insert stored procedure : with parameters and then execute it from VB, so I created the SP and : ran it using Query Analyser (Worked Fine), I also added it to my : dataenvironment as a command. However when I type : DEGenSQL.sp_Personnel_ReEmploy I get no option to enter any of the : parameters and if I try RUN/Start With Full Compile I get the : following error message : : : Compile Error : Subscript Out Of Range : : This makes me think there are too many parameters required. : : Has anyone else come across this, or does anyone know of a better way : to go about this. : : Paul Hartland : : __________________________________________________________________________ : Join Freeserve http://www.freeserve.com/time/ : : Winner of the 2003 Internet Service Providers' Association awards for : Best Unmetered ISP and Best Consumer Application. : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From my.lists at verizon.net Mon Jul 21 10:21:27 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 21 Jul 2003 08:21:27 -0700 Subject: [AccessD] Re: [dba-SQLServer]Copying a record VB6 & SQL Server 7.0 References: <20030721145954.RCHZ18716.fep07-svc.ttys.com@localhost> Message-ID: <004801c34f9b$c1fbb690$b615010a@FHTAPIA> Paul, it has been my experiance that when you have a long series of parameters, it is often best to pass them back using a command object. something along the line the following Dim Cmd As adodb.Command, lngAffected As Long Set Cmd = New adodb.Command With Cmd .ActiveConnection = CurrentProject.Connection .CommandType = adCmdStoredProc .CommandText = "stp_004C_Insert" .Parameters.Append .CreateParameter("@CaseNumberID", adInteger, adParamInput, , Nz(Me.txtCaseNumberID, 0)) .Parameters.Append .CreateParameter("@MachineID", adGUID, adParamInput, , Me.txtMachineID) .Parameters.Append .CreateParameter("@LoginID", adVarChar, adParamInput, 50, fOSUserName()) .Parameters.Append .CreateParameter("@ContactAddrID", adGUID, adParamInput, , Me.txtContactAddrID) .Parameters.Append .CreateParameter("@ReasonID", adInteger, adParamInput, , Me.cboReason) .Parameters.Append .CreateParameter("@Type", adInteger, adParamInput, , Me.cboType) .Parameters.Append .CreateParameter("@Unneccessary", adInteger, adParamInput, , Me.chkUnnecessary) .Parameters.Append .CreateParameter("@FailCodeID", adInteger, adParamInput, , Me.cboFailCode) .Parameters.Append .CreateParameter("@Status", adInteger, adParamInput, , Me.chkCloseCall) .Parameters.Append .CreateParameter("@CallNotes", adVarChar, adParamInput, 1000, Me.txtCallNotes) .Execute , lngAffected .ActiveConnection = Nothing End With More helpful tips on using ADO w/ Sql can be found here.. http://www.able-consulting.com/ADO_Faq.htm -Francisco http://rcm.netfirms.com On Monday, July 21, 2003 7:59 AM [GMT-8], paul.hartland at fsmail.net wrote: : To all, : : we have a high turnover of staff, mainly because most are casual : workers and don't want full-time employment. When a member of staff : leaves we issue them with a finish date. However if they decide they : want to come back we need to re-employ them with a new payroll : number, I have a re-employ button that asks the user for the new : payroll number...but here is where I need help : I then need to : create an identical personnel record (66 fields to the one shown on : screen) but with the new payroll number. : : My front-end is Visual Basic 6 and my back-end is SQL Server 7.0. I : thought the easiest way would be to create an insert stored procedure : with parameters and then execute it from VB, so I created the SP and : ran it using Query Analyser (Worked Fine), I also added it to my : dataenvironment as a command. However when I type : DEGenSQL.sp_Personnel_ReEmploy I get no option to enter any of the : parameters and if I try RUN/Start With Full Compile I get the : following error message : : : Compile Error : Subscript Out Of Range : : This makes me think there are too many parameters required. : : Has anyone else come across this, or does anyone know of a better way : to go about this. : : Paul Hartland : : __________________________________________________________________________ : Join Freeserve http://www.freeserve.com/time/ : : Winner of the 2003 Internet Service Providers' Association awards for : Best Unmetered ISP and Best Consumer Application. : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From paul.hartland at fsmail.net Wed Jul 23 09:06:45 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Wed, 23 Jul 2003 14:06:45 +0000 Subject: [dba-SQLServer] Auto Supply Connection strings and passwords to controls on forms (VB6 & SQL) Message-ID: <20030723140646.URIV18716.fep07-svc.ttys.com@localhost> To all, I have a VB6 application which looks at a SQL Server 7 database (which is on a development server), and I am using a mixture of DataEnvironment and ADO Controls for the application. However when it's finshed It will be moved to the live server so that everyone can gain access to it. The problem being that when I move to the live server I will have to remember to change all the ADO controls and the DataEnvironment connection manually (I don't want to have to do this if I can help it). What I thought of doing is have a table consisting of the ConnectionString, Username & Password and then a table of all the form names and ADO Controls, and somehow looping through the tables and setting the connections automatically. This is where I am stuck, I have created the tables and entered the connection strings etc, and I can do the loop which will loop through the records, but I don;t know how to set the connection strings, using the form names and ADO Controls from the tables. Am I being stupid in doing it this way ? Is there a better way to do this ? Can anyone help on this, as the application is almost finished.....? Thanks for any help in advance.... Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. From paul.hartland at fsmail.net Wed Jul 23 09:06:45 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Wed, 23 Jul 2003 14:06:45 +0000 Subject: [dba-SQLServer][AccessD] Auto Supply Connection strings and passwords to controls on forms (VB6 & SQL) Message-ID: <20030723140646.URIV18716.fep07-svc.ttys.com@localhost> To all, I have a VB6 application which looks at a SQL Server 7 database (which is on a development server), and I am using a mixture of DataEnvironment and ADO Controls for the application. However when it's finshed It will be moved to the live server so that everyone can gain access to it. The problem being that when I move to the live server I will have to remember to change all the ADO controls and the DataEnvironment connection manually (I don't want to have to do this if I can help it). What I thought of doing is have a table consisting of the ConnectionString, Username & Password and then a table of all the form names and ADO Controls, and somehow looping through the tables and setting the connections automatically. This is where I am stuck, I have created the tables and entered the connection strings etc, and I can do the loop which will loop through the records, but I don;t know how to set the connection strings, using the form names and ADO Controls from the tables. Am I being stupid in doing it this way ? Is there a better way to do this ? Can anyone help on this, as the application is almost finished.....? Thanks for any help in advance.... Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From knicholson at gpsx.net Wed Jul 23 10:23:32 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 23 Jul 2003 10:23:32 -0500 Subject: [dba-SQLServer]Auto Supply Connection strings and passwords t o controls on forms(VB6 & SQL) Message-ID: http://www.sqlmag.com/Articles/Index.cfm?ArticleID=19763&pg=1 Does this article help at all? -----Original Message----- From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net] Sent: Wednesday, July 23, 2003 9:07 AM To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) To all, I have a VB6 application which looks at a SQL Server 7 database (which is on a development server), and I am using a mixture of DataEnvironment and ADO Controls for the application. However when it's finshed It will be moved to the live server so that everyone can gain access to it. The problem being that when I move to the live server I will have to remember to change all the ADO controls and the DataEnvironment connection manually (I don't want to have to do this if I can help it). What I thought of doing is have a table consisting of the ConnectionString, Username & Password and then a table of all the form names and ADO Controls, and somehow looping through the tables and setting the connections automatically. This is where I am stuck, I have created the tables and entered the connection strings etc, and I can do the loop which will loop through the records, but I don;t know how to set the connection strings, using the form names and ADO Controls from the tables. Am I being stupid in doing it this way ? Is there a better way to do this ? Can anyone help on this, as the application is almost finished.....? Thanks for any help in advance.... Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jcolby at colbyconsulting.com Wed Jul 23 09:40:16 2003 From: jcolby at colbyconsulting.com (jcolby at colbyconsulting.com) Date: Wed, 23 Jul 2003 10:40:16 -0400 Subject: [dba-SQLServer][AccessD] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) In-Reply-To: <20030723140646.URIV18716.fep07-svc.ttys.com@localhost> Message-ID: Paul, Could you CC the other lists instead of putting all the list names in the To. I have rules that sort things out into mail boxes and it appears that the message server transmits the message several times (or maybe you're doing that?). I use a crude if [AccessD] is in the subject and... for example in my VB folder I have FIVE copies of the message with the following in the subject: [dba-VB] [dba-SQLServer][AccessD] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) [dba-VB] [AccessD] [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) [dba-VB] [AccessD] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) [dba-VB] [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) [dba-VB] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) I am getting 2 copies in my AccessD folder as well as a copy in SQL Server folder and FIVE copies in my Access-VBA folder. I think if you put just the one list name you are sending to, plus the other list names in CC perhaps this wouldn't happen. I can't tell you precisely what is going on but I can tell you I got a grand total of EIGHT copies of this message. John W. Colby www.colbyconsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of paul.hartland at fsmail.net Sent: Wednesday, July 23, 2003 10:07 AM To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-SQLServer][AccessD] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) To all, I have a VB6 application which looks at a SQL Server 7 database (which is on a development server), and I am using a mixture of DataEnvironment and ADO Controls for the application. However when it's finshed It will be moved to the live server so that everyone can gain access to it. The problem being that when I move to the live server I will have to remember to change all the ADO controls and the DataEnvironment connection manually (I don't want to have to do this if I can help it). What I thought of doing is have a table consisting of the ConnectionString, Username & Password and then a table of all the form names and ADO Controls, and somehow looping through the tables and setting the connections automatically. This is where I am stuck, I have created the tables and entered the connection strings etc, and I can do the loop which will loop through the records, but I don;t know how to set the connection strings, using the form names and ADO Controls from the tables. Am I being stupid in doing it this way ? Is there a better way to do this ? Can anyone help on this, as the application is almost finished.....? Thanks for any help in advance.... Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From paul.hartland at fsmail.net Wed Jul 23 09:50:42 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Wed, 23 Jul 2003 14:50:42 +0000 Subject: [dba-SQLServer][AccessD] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) Message-ID: <20030723145042.VSXK28680.fep03-svc.ttys.com@localhost> John, Very sorry about that, I will do from now on..... Paul From: Date: Wed 23/Jul/2003 14:40 GMT To: Subject: RE: [dba-SQLServer][AccessD] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) Paul, Could you CC the other lists instead of putting all the list names in the To. I have rules that sort things out into mail boxes and it appears that the message server transmits the message several times (or maybe you're doing that?). I use a crude if [AccessD] is in the subject and... for example in my VB folder I have FIVE copies of the message with the following in the subject: [dba-VB] [dba-SQLServer][AccessD] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) [dba-VB] [AccessD] [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) [dba-VB] [AccessD] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) [dba-VB] [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) [dba-VB] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) I am getting 2 copies in my AccessD folder as well as a copy in SQL Server folder and FIVE copies in my Access-VBA folder. I think if you put just the one list name you are sending to, plus the other list names in CC perhaps this wouldn't happen. I can't tell you precisely what is going on but I can tell you I got a grand total of EIGHT copies of this message. John W. Colby www.colbyconsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of paul.hartland at fsmail.net Sent: Wednesday, July 23, 2003 10:07 AM To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-SQLServer][AccessD] Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) To all, I have a VB6 application which looks at a SQL Server 7 database (which is on a development server), and I am using a mixture of DataEnvironment and ADO Controls for the application. However when it's finshed It will be moved to the live server so that everyone can gain access to it. The problem being that when I move to the live server I will have to remember to change all the ADO controls and the DataEnvironment connection manually (I don't want to have to do this if I can help it). What I thought of doing is have a table consisting of the ConnectionString, Username & Password and then a table of all the form names and ADO Controls, and somehow looping through the tables and setting the connections automatically. This is where I am stuck, I have created the tables and entered the connection strings etc, and I can do the loop which will loop through the records, but I don;t know how to set the connection strings, using the form names and ADO Controls from the tables. Am I being stupid in doing it this way ? Is there a better way to do this ? Can anyone help on this, as the application is almost finished.....? Thanks for any help in advance.... Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: 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 __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. From paul.hartland at fsmail.net Wed Jul 23 10:57:22 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Wed, 23 Jul 2003 15:57:22 +0000 Subject: [dba-SQLServer]Number of rows affected by update, insert etc Message-ID: <20030723155723.WFR12458.fep10-svc.ttys.com@localhost> To all, I have a VB6 application which uses the dataenvironment to link to a Access2002 database, and I use command objects connnected to the dataenvironment which update, delete & insert records..... Is there anyway I can get the count of how many rows have been affected Thanks in advance for you help Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. From paul.hartland at fsmail.net Wed Jul 23 10:57:22 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Wed, 23 Jul 2003 15:57:22 +0000 Subject: [dba-SQLServer] [AccessD] Number of rows affected by update, insert etc Message-ID: <20030723155723.WFR12458.fep10-svc.ttys.com@localhost> To all, I have a VB6 application which uses the dataenvironment to link to a Access2002 database, and I use command objects connnected to the dataenvironment which update, delete & insert records..... Is there anyway I can get the count of how many rows have been affected Thanks in advance for you help Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Robert.Djabarov at usaa.com Wed Jul 23 11:05:04 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 23 Jul 2003 11:05:04 -0500 Subject: [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC3B@ex02.eagle.usaa.com> I resolved it by doing the following: - The app has a logon screen that has UID, PWD, SRV, DB, and Network Library. All values are "memorizable" except for the password (SaveSetting/GetSetting) - If logon successful, - I check for the presence of a specific set of objects in the database that was specified at the logon. If this set is missing or incomplete, - app terminates, otherwise you're in. The ConnectionString gets built based on values mentioned for the logon screen and become part of clsADO class that controls all data-related activity. Once I implemented this very simple "architecture", I never worry about where my back-end lives. All the user needs to do is specify new server and new database (if different) to be able to connect along with their new user ID and new password (again, if different). The next time they logon only the password needs to be retyped. Robert Djabarov * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net] Sent: Wednesday, July 23, 2003 9:07 AM To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) To all, I have a VB6 application which looks at a SQL Server 7 database (which is on a development server), and I am using a mixture of DataEnvironment and ADO Controls for the application. However when it's finshed It will be moved to the live server so that everyone can gain access to it. The problem being that when I move to the live server I will have to remember to change all the ADO controls and the DataEnvironment connection manually (I don't want to have to do this if I can help it). What I thought of doing is have a table consisting of the ConnectionString, Username & Password and then a table of all the form names and ADO Controls, and somehow looping through the tables and setting the connections automatically. This is where I am stuck, I have created the tables and entered the connection strings etc, and I can do the loop which will loop through the records, but I don;t know how to set the connection strings, using the form names and ADO Controls from the tables. Am I being stupid in doing it this way ? Is there a better way to do this ? Can anyone help on this, as the application is almost finished.....? Thanks for any help in advance.... Paul Hartland ________________________________________________________________________ __ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From tuxedo_man at hotmail.com Wed Jul 23 11:44:59 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 23 Jul 2003 16:44:59 +0000 Subject: [dba-SQLServer]Number of rows affected by update, insert etc Message-ID: Create an "after insert, update, delete trigger" on the table you want to monitor that will count the number of records in the "inserted" or "deleted" table and insert that number into a new log table. Look up "CREATE TRIGGER" in BOL for more info. HTH Billy >From: >Reply-To: dba-sqlserver at databaseadvisors.com >To: accessd at databaseadvisors.com >CC: dba-vb at databaseadvisors.com, dba-sqlserver at databaseadvisors.com >Subject: [dba-SQLServer]Number of rows affected by update, insert etc >Date: Wed, 23 Jul 2003 15:57:22 +0000 > >To all, > >I have a VB6 application which uses the dataenvironment to link to a >Access2002 database, and I use command objects connnected to the >dataenvironment which update, delete & insert records..... > >Is there anyway I can get the count of how many rows have been affected > >Thanks in advance for you help > >Paul Hartland > >__________________________________________________________________________ >Join Freeserve http://www.freeserve.com/time/ > >Winner of the 2003 Internet Service Providers' Association awards for Best >Unmetered ISP and Best Consumer Application. > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From my.lists at verizon.net Wed Jul 23 15:30:30 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 23 Jul 2003 13:30:30 -0700 Subject: [dba-SQLServer]Number of rows affected by update, insert etc References: <20030723155723.WFR12458.fep10-svc.ttys.com@localhost> Message-ID: <001c01c35159$43133fa0$b615010a@FHTAPIA> Paul I'm reposting my previous message, if you check out the variable lngAffected it spits out the number of records affected just use that or pass it to what ever msgbox/prompt or screens you need. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Francisco H Tapia Sent: Monday, July 21, 2003 8:21 AM To: dba-sqlserver at databaseadvisors.com; AccessD Subject: Re: [dba-SQLServer]Copying a record VB6 & SQL Server 7.0 Paul, it has been my experiance that when you have a long series of parameters, it is often best to pass them back using a command object. something along the line the following Dim Cmd As adodb.Command, lngAffected As Long Set Cmd = New adodb.Command With Cmd .ActiveConnection = CurrentProject.Connection .CommandType = adCmdStoredProc .CommandText = "stp_004C_Insert" .Parameters.Append .CreateParameter("@CaseNumberID", adInteger, adParamInput, , Nz(Me.txtCaseNumberID, 0)) .Parameters.Append .CreateParameter("@MachineID", adGUID, adParamInput, , Me.txtMachineID) .Parameters.Append .CreateParameter("@LoginID", adVarChar, adParamInput, 50, fOSUserName()) .Parameters.Append .CreateParameter("@ContactAddrID", adGUID, adParamInput, , Me.txtContactAddrID) .Parameters.Append .CreateParameter("@ReasonID", adInteger, adParamInput, , Me.cboReason) .Parameters.Append .CreateParameter("@Type", adInteger, adParamInput, , Me.cboType) .Parameters.Append .CreateParameter("@Unneccessary", adInteger, adParamInput, , Me.chkUnnecessary) .Parameters.Append .CreateParameter("@FailCodeID", adInteger, adParamInput, , Me.cboFailCode) .Parameters.Append .CreateParameter("@Status", adInteger, adParamInput, , Me.chkCloseCall) .Parameters.Append .CreateParameter("@CallNotes", adVarChar, adParamInput, 1000, Me.txtCallNotes) .Execute , lngAffected .ActiveConnection = Nothing End With More helpful tips on using ADO w/ Sql can be found here.. http://www.able-consulting.com/ADO_Faq.htm -Francisco http://rcm.netfirms.com On Monday, July 21, 2003 7:59 AM [GMT-8], paul.hartland at fsmail.net wrote: : To all, : : we have a high turnover of staff, mainly because most are casual : workers and don't want full-time employment. When a member of staff : leaves we issue them with a finish date. However if they decide they : want to come back we need to re-employ them with a new payroll : number, I have a re-employ button that asks the user for the new : payroll number...but here is where I need help : I then need to : create an identical personnel record (66 fields to the one shown on : screen) but with the new payroll number. : : My front-end is Visual Basic 6 and my back-end is SQL Server 7.0. I : thought the easiest way would be to create an insert stored procedure : with parameters and then execute it from VB, so I created the SP and : ran it using Query Analyser (Worked Fine), I also added it to my : dataenvironment as a command. However when I type : DEGenSQL.sp_Personnel_ReEmploy I get no option to enter any of the : parameters and if I try RUN/Start With Full Compile I get the : following error message : : : Compile Error : Subscript Out Of Range : : This makes me think there are too many parameters required. : : Has anyone else come across this, or does anyone know of a better way : to go about this. : : Paul Hartland -Francisco http://rcm.netfirms.com On Wednesday, July 23, 2003 8:57 AM [GMT-8], paul.hartland at fsmail.net wrote: : To all, : : I have a VB6 application which uses the dataenvironment to link to a : Access2002 database, and I use command objects connnected to the : dataenvironment which update, delete & insert records..... : : Is there anyway I can get the count of how many rows have been : affected : : Thanks in advance for you help : : Paul Hartland : : __________________________________________________________________________ : Join Freeserve http://www.freeserve.com/time/ : : Winner of the 2003 Internet Service Providers' Association awards for : Best Unmetered ISP and Best Consumer Application. : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From artful at rogers.com Wed Jul 23 15:50:15 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 23 Jul 2003 16:50:15 -0400 Subject: [dba-SQLServer]Number of rows affected by update, insert etc In-Reply-To: <20030723155723.WFR12458.fep10-svc.ttys.com@localhost> Message-ID: <000001c3515c$050d3aa0$8e01a8c0@Rock> Why am I getting about 6 copies of every message you send, Paul? Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of paul.hartland at fsmail.net Sent: July 23, 2003 11:57 AM To: accessd at databaseadvisors.com Cc: dba-vb at databaseadvisors.com; dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Number of rows affected by update, insert etc To all, I have a VB6 application which uses the dataenvironment to link to a Access2002 database, and I use command objects connnected to the dataenvironment which update, delete & insert records..... Is there anyway I can get the count of how many rows have been affected Thanks in advance for you help Paul Hartland From jcolby at colbyconsulting.com Wed Jul 23 16:38:29 2003 From: jcolby at colbyconsulting.com (jcolby at colbyconsulting.com) Date: Wed, 23 Jul 2003 17:38:29 -0400 Subject: [dba-SQLServer]Number of rows affected by update, insert etc In-Reply-To: <000001c3515c$050d3aa0$8e01a8c0@Rock> Message-ID: You too? John W. Colby www.colbyconsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Arthur Fuller Sent: Wednesday, July 23, 2003 4:50 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Number of rows affected by update, insert etc Why am I getting about 6 copies of every message you send, Paul? Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of paul.hartland at fsmail.net Sent: July 23, 2003 11:57 AM To: accessd at databaseadvisors.com Cc: dba-vb at databaseadvisors.com; dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Number of rows affected by update, insert etc To all, I have a VB6 application which uses the dataenvironment to link to a Access2002 database, and I use command objects connnected to the dataenvironment which update, delete & insert records..... Is there anyway I can get the count of how many rows have been affected Thanks in advance for you help Paul Hartland _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From tuxedo_man at hotmail.com Thu Jul 24 00:50:31 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Thu, 24 Jul 2003 05:50:31 +0000 Subject: [dba-SQLServer]Number of rows affected by update, insert etc Message-ID: just to let you know that I only received it once. >From: >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: RE: [dba-SQLServer]Number of rows affected by update, insert etc >Date: Wed, 23 Jul 2003 17:38:29 -0400 > >You too? > >John W. Colby >www.colbyconsulting.com > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Arthur >Fuller >Sent: Wednesday, July 23, 2003 4:50 PM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Number of rows affected by update, insert >etc > > >Why am I getting about 6 copies of every message you send, Paul? > >Arthur > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >paul.hartland at fsmail.net >Sent: July 23, 2003 11:57 AM >To: accessd at databaseadvisors.com >Cc: dba-vb at databaseadvisors.com; dba-sqlserver at databaseadvisors.com >Subject: [dba-SQLServer]Number of rows affected by update, insert etc > > >To all, > >I have a VB6 application which uses the dataenvironment to link to a >Access2002 database, and I use command objects connnected to the >dataenvironment which update, delete & insert records..... > >Is there anyway I can get the count of how many rows have been affected > >Thanks in advance for you help > >Paul Hartland > >_______________________________________________ >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 > _________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus From paul.hartland at fsmail.net Thu Jul 24 03:13:05 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Thu, 24 Jul 2003 8:13:05 +0000 Subject: [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) Message-ID: <20030724081305.BOWP12458.fep10-svc.ttys.com@localhost> Although, you are making this sound really simple.....could I sse some sample code to get me started etc, I can build the connection string no problem, but whats clsADO and how does it control all data-related activity....?? Paul From: "Djabarov, Robert" Date: Wed 23/Jul/2003 16:05 GMT To: Subject: RE: [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) I resolved it by doing the following: - The app has a logon screen that has UID, PWD, SRV, DB, and Network Library. All values are "memorizable" except for the password (SaveSetting/GetSetting) - If logon successful, - I check for the presence of a specific set of objects in the database that was specified at the logon. If this set is missing or incomplete, - app terminates, otherwise you're in. The ConnectionString gets built based on values mentioned for the logon screen and become part of clsADO class that controls all data-related activity. Once I implemented this very simple "architecture", I never worry about where my back-end lives. All the user needs to do is specify new server and new database (if different) to be able to connect along with their new user ID and new password (again, if different). The next time they logon only the password needs to be retyped. Robert Djabarov * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net] Sent: Wednesday, July 23, 2003 9:07 AM To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) To all, I have a VB6 application which looks at a SQL Server 7 database (which is on a development server), and I am using a mixture of DataEnvironment and ADO Controls for the application. However when it's finshed It will be moved to the live server so that everyone can gain access to it. The problem being that when I move to the live server I will have to remember to change all the ADO controls and the DataEnvironment connection manually (I don't want to have to do this if I can help it). What I thought of doing is have a table consisting of the ConnectionString, Username & Password and then a table of all the form names and ADO Controls, and somehow looping through the tables and setting the connections automatically. This is where I am stuck, I have created the tables and entered the connection strings etc, and I can do the loop which will loop through the records, but I don;t know how to set the connection strings, using the form names and ADO Controls from the tables. Am I being stupid in doing it this way ? Is there a better way to do this ? Can anyone help on this, as the application is almost finished.....? Thanks for any help in advance.... Paul Hartland ________________________________________________________________________ __ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ 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 __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. From DMcAfee at haascnc.com Wed Jul 23 17:49:02 2003 From: DMcAfee at haascnc.com (David McAfee) Date: Wed, 23 Jul 2003 15:49:02 -0700 Subject: [dba-SQLServer]Number of rows affected by update, insert etc Message-ID: <657FB70438B7D311AF320090279C1801026D7ABD@EXCHMAIL> If you're using Outlook it is most likely a rule that you have set up. I sent a post (one time) to Access-D earlier (cross posted to Access-L) I must have received 6 copies. If you have a rule set up that "moves" a message beased on content and that content fills various rules, outlook seems to make multiple copies if those messages. David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of jcolby at colbyconsulting.com Sent: Wednesday, July 23, 2003 2:38 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Number of rows affected by update, insert etc You too? John W. Colby www.colbyconsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Arthur Fuller Sent: Wednesday, July 23, 2003 4:50 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Number of rows affected by update, insert etc Why am I getting about 6 copies of every message you send, Paul? Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of paul.hartland at fsmail.net Sent: July 23, 2003 11:57 AM To: accessd at databaseadvisors.com Cc: dba-vb at databaseadvisors.com; dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Number of rows affected by update, insert etc To all, I have a VB6 application which uses the dataenvironment to link to a Access2002 database, and I use command objects connnected to the dataenvironment which update, delete & insert records..... Is there anyway I can get the count of how many rows have been affected Thanks in advance for you help Paul Hartland _______________________________________________ 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 my.lists at verizon.net Thu Jul 24 09:28:18 2003 From: my.lists at verizon.net (Francisco Tapia) Date: Thu, 24 Jul 2003 07:28:18 -0700 Subject: [dba-SQLServer]Number of rows affected by update, insert etc References: Message-ID: <002b01c351ef$d45e4f90$fd512304@amd2k> Paul's already mentioned that he's going to only send his emails to one list, I think the reason JC received it multiple times is because he is signed up to almost all the lists ;o) btw, i reveceived it about 6 times too many as well. -Francisco http://rcm.netfirms.com/ On Wednesday, July 23, 2003 10:50 PM [GMT -8], Billy Pang wrote: : just to let you know that I only received it once. : : : : :: From: :: Reply-To: dba-sqlserver at databaseadvisors.com :: To: :: Subject: RE: [dba-SQLServer]Number of rows affected by update, :: insert etc Date: Wed, 23 Jul 2003 17:38:29 -0400 :: :: You too? :: :: John W. Colby :: www.colbyconsulting.com :: :: -----Original Message----- :: From: dba-sqlserver-bounces at databaseadvisors.com :: [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of :: Arthur Fuller :: Sent: Wednesday, July 23, 2003 4:50 PM :: To: dba-sqlserver at databaseadvisors.com :: Subject: RE: [dba-SQLServer]Number of rows affected by update, insert :: etc :: :: :: Why am I getting about 6 copies of every message you send, Paul? :: :: Arthur :: :: -----Original Message----- :: From: dba-sqlserver-bounces at databaseadvisors.com :: [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of :: paul.hartland at fsmail.net :: Sent: July 23, 2003 11:57 AM :: To: accessd at databaseadvisors.com :: Cc: dba-vb at databaseadvisors.com; dba-sqlserver at databaseadvisors.com :: Subject: [dba-SQLServer]Number of rows affected by update, insert etc :: :: :: To all, :: :: I have a VB6 application which uses the dataenvironment to link to a :: Access2002 database, and I use command objects connnected to the :: dataenvironment which update, delete & insert records..... :: :: Is there anyway I can get the count of how many rows have been :: affected :: :: Thanks in advance for you help :: :: Paul Hartland :: :: _______________________________________________ :: 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 :: : : _________________________________________________________________ : MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. : http://join.msn.com/?page=features/virus : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From artful at rogers.com Thu Jul 24 10:48:04 2003 From: artful at rogers.com (Arthur Fuller) Date: Thu, 24 Jul 2003 11:48:04 -0400 Subject: [dba-VB] [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) In-Reply-To: <20030723140646.URIV18716.fep07-svc.ttys.com@localhost> Message-ID: <000601c351fa$f8795180$8e01a8c0@Rock> Although retrofitting it might be a little work, why don't you define the connection string as a constant? Then you could find and replace all the literal occurrences "Those who would sacrifice liberty for security deserve neither." -- Benjamin Franklin -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of paul.hartland at fsmail.net Sent: July 23, 2003 10:07 AM To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) To all, I have a VB6 application which looks at a SQL Server 7 database (which is on a development server), and I am using a mixture of DataEnvironment and ADO Controls for the application. However when it's finshed It will be moved to the live server so that everyone can gain access to it. The problem being that when I move to the live server I will have to remember to change all the ADO controls and the DataEnvironment connection manually (I don't want to have to do this if I can help it). What I thought of doing is have a table consisting of the ConnectionString, Username & Password and then a table of all the form names and ADO Controls, and somehow looping through the tables and setting the connections automatically. This is where I am stuck, I have created the tables and entered the connection strings etc, and I can do the loop which will loop through the records, but I don;t know how to set the connection strings, using the form names and ADO Controls from the tables. Am I being stupid in doing it this way ? Is there a better way to do this ? Can anyone help on this, as the application is almost finished.....? Thanks for any help in advance.... Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From JRojas at tnco-inc.com Thu Jul 24 10:49:06 2003 From: JRojas at tnco-inc.com (Joe Rojas) Date: Thu, 24 Jul 2003 11:49:06 -0400 Subject: [dba-SQLServer] Have SS7 send out e-mails where recipients are retrieved from a t able Message-ID: <806536912C472E4A9D6515DF2E57261E239445@mercury.tnco-inc.com> Hi All, I have a stored procedure that returns users with their e-mail addresses that need to perform a task. I would like to know if there is some way to have SS7 use this recordset internally to send an E-Mail to each of the people in the recordset. To top it off, I would like SS7 to perform this take at scheduled intervals. Any suggestions? Thanks! Joe R. This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. From my.lists at verizon.net Thu Jul 24 10:57:19 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 24 Jul 2003 08:57:19 -0700 Subject: [dba-SQLServer]Have SS7 send out e-mails where recipients are retrieved from a table References: <806536912C472E4A9D6515DF2E57261E239445@mercury.tnco-inc.com> Message-ID: <001e01c351fc$438abc80$b615010a@FHTAPIA> you can email this out... you can either use Blat or CDO's or SqlMail, I use blat. Check books online for the SqlMail Method and www.sqlservercentral.com has scripts for doing this via CDO's (the registration is free and the only mail the send you is their newsletter w/ articles and a ton of useful hints and tips). If you'd like to try your hand at using blat (which is a command line smtp email client) let me know and I'll post that script. oh, before I forget you'll also have to step through your output so look up cursors as well, and be careful to leave them open, always explicitly deallocate them when you're done. -Francisco http://rcm.netfirms.com On Thursday, July 24, 2003 8:49 AM [GMT-8], Joe Rojas wrote: : Hi All, : : I have a stored procedure that returns users with their e-mail : addresses that need to perform a task. : I would like to know if there is some way to have SS7 use this : recordset internally to send an E-Mail to each of the people in the : recordset. : To top it off, I would like SS7 to perform this take at scheduled : intervals. : : Any suggestions? : : Thanks! : Joe R. : : : : : This electronic transmission is strictly confidential to TNCO, Inc. : and intended solely for the addressee. It may contain information : which is covered by legal, professional, or other privileges. If you : are not the intended addressee, or someone authorized by the intended : addressee to receive transmissions on behalf of the addressee, you : must not retain, disclose in any form, copy, or take any action in : reliance on this transmission. If you have received this transmission : in error, please notify the sender as soon as possible and destroy : this message. While TNCO, Inc. uses virus protection, the recipient : should check this email and any attachments for the presence of : viruses. TNCO, Inc. accepts no liability for any damage caused by any : virus transmitted by this email. : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From my.lists at verizon.net Thu Jul 24 10:59:32 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 24 Jul 2003 08:59:32 -0700 Subject: [dba-VB] [dba-SQLServer]Auto Supply Connection strings andpasswords to controls on forms(VB6 & SQL) References: <000601c351fa$f8795180$8e01a8c0@Rock> Message-ID: <002401c351fc$92c50620$b615010a@FHTAPIA> I second Arthur's suggestion along w/ maybe get a little bit of sleep ;o). Having constants w/ the connection string is so nice cuz you can modify the connection string in one place only. -Francisco http://rcm.netfirms.com On Thursday, July 24, 2003 8:48 AM [GMT-8], Arthur Fuller wrote: : Although retrofitting it might be a little work, why don't you define : the connection string as a constant? Then you could find and replace : all the literal occurrences : : "Those who would sacrifice liberty for security deserve neither." : -- Benjamin Franklin : : -----Original Message----- : From: dba-vb-bounces at databaseadvisors.com : [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of : paul.hartland at fsmail.net : Sent: July 23, 2003 10:07 AM : To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; : dba-vb at databaseadvisors.com : Subject: [dba-VB] [dba-SQLServer]Auto Supply Connection strings and : passwords to controls on forms(VB6 & SQL) : : : To all, : : I have a VB6 application which looks at a SQL Server 7 database : (which is on a development server), and I am using a mixture of : DataEnvironment and ADO Controls for the application. However when : it's finshed It will be moved to the live server so that everyone can : gain access to it. The problem being that when I move to the live : server I will have to remember to change all the ADO controls and the : DataEnvironment connection manually (I don't want to have to do this : if I can help it). : : What I thought of doing is have a table consisting of the : ConnectionString, Username & Password and then a table of all the : form names and ADO Controls, and somehow looping through the tables : and setting the connections automatically. This is where I am stuck, : I have created the tables and entered the connection strings etc, and : I can do the loop which will loop through the records, but I don;t : know how to set the connection strings, using the form names and ADO : Controls from the tables. : : Am I being stupid in doing it this way ? : : Is there a better way to do this ? : : Can anyone help on this, as the application is almost finished.....? : : Thanks for any help in advance.... : : Paul Hartland : : : __________________________________________________________________________ : Join Freeserve http://www.freeserve.com/time/ : : Winner of the 2003 Internet Service Providers' Association awards for : Best Unmetered ISP and Best Consumer Application. : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : _______________________________________________ : dba-VB mailing list : dba-VB at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-vb : 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 jcolby at colbyconsulting.com Thu Jul 24 11:03:54 2003 From: jcolby at colbyconsulting.com (jcolby at colbyconsulting.com) Date: Thu, 24 Jul 2003 12:03:54 -0400 Subject: [dba-VB] [dba-SQLServer]Auto Supply Connection stringsandpasswords to controls on forms(VB6 & SQL) In-Reply-To: <002401c351fc$92c50620$b615010a@FHTAPIA> Message-ID: SysVars!!!!! Constants are ok for things like the days of the week, but for things that change, it should be table driven!!! We are database people. John W. Colby www.colbyconsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Francisco H Tapia Sent: Thursday, July 24, 2003 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-VB] [dba-SQLServer]Auto Supply Connection stringsandpasswords to controls on forms(VB6 & SQL) I second Arthur's suggestion along w/ maybe get a little bit of sleep ;o). Having constants w/ the connection string is so nice cuz you can modify the connection string in one place only. -Francisco http://rcm.netfirms.com On Thursday, July 24, 2003 8:48 AM [GMT-8], Arthur Fuller wrote: : Although retrofitting it might be a little work, why don't you define : the connection string as a constant? Then you could find and replace : all the literal occurrences : : "Those who would sacrifice liberty for security deserve neither." : -- Benjamin Franklin : : -----Original Message----- : From: dba-vb-bounces at databaseadvisors.com : [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of : paul.hartland at fsmail.net : Sent: July 23, 2003 10:07 AM : To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; : dba-vb at databaseadvisors.com : Subject: [dba-VB] [dba-SQLServer]Auto Supply Connection strings and : passwords to controls on forms(VB6 & SQL) : : : To all, : : I have a VB6 application which looks at a SQL Server 7 database : (which is on a development server), and I am using a mixture of : DataEnvironment and ADO Controls for the application. However when : it's finshed It will be moved to the live server so that everyone can : gain access to it. The problem being that when I move to the live : server I will have to remember to change all the ADO controls and the : DataEnvironment connection manually (I don't want to have to do this : if I can help it). : : What I thought of doing is have a table consisting of the : ConnectionString, Username & Password and then a table of all the : form names and ADO Controls, and somehow looping through the tables : and setting the connections automatically. This is where I am stuck, : I have created the tables and entered the connection strings etc, and : I can do the loop which will loop through the records, but I don;t : know how to set the connection strings, using the form names and ADO : Controls from the tables. : : Am I being stupid in doing it this way ? : : Is there a better way to do this ? : : Can anyone help on this, as the application is almost finished.....? : : Thanks for any help in advance.... : : Paul Hartland : : : __________________________________________________________________________ : Join Freeserve http://www.freeserve.com/time/ : : Winner of the 2003 Internet Service Providers' Association awards for : Best Unmetered ISP and Best Consumer Application. : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : _______________________________________________ : dba-VB mailing list : dba-VB at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-vb : 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 sgeller at cce.umn.edu Thu Jul 24 14:00:15 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Thu, 24 Jul 2003 14:00:15 -0500 Subject: [dba-SQLServer]Listbox truncating stored procedure data Message-ID: I have a listbox whose recordsource is a sproc. The sproc works fine even when run from Access. The listbox has an invisible column that contains a long text string, up to a couple of paragraphs in length. The listbox is only holding the first couple of lines even though the sproc returns the whole thing. I can work around this by getting at the data in another way, but I'm wondering if this is a bug of some kind? Access XP --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 From CWortz at tea.state.tx.us Thu Jul 24 14:10:48 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Thu, 24 Jul 2003 14:10:48 -0500 Subject: [dba-SQLServer]Listbox truncating stored procedure data Message-ID: Susan, Access has limits on character string length. Your strings may be exceeding one of these limits. All Access objects do not have Long Integer, or even Integer, position counters. Some only have a byte length counter. Charles Wortz Software Development Division Texas Education Agency 1701 N. Congress Ave Austin, TX 78701-1494 512-463-9493 CWortz at tea.state.tx.us -----Original Message----- From: Susan Geller [mailto:sgeller at cce.umn.edu] Sent: Thursday 2003 Jul 24 14:00 To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Listbox truncating stored procedure data I have a listbox whose recordsource is a sproc. The sproc works fine even when run from Access. The listbox has an invisible column that contains a long text string, up to a couple of paragraphs in length. The listbox is only holding the first couple of lines even though the sproc returns the whole thing. I can work around this by getting at the data in another way, but I'm wondering if this is a bug of some kind? Access XP --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 From paul.hartland at fsmail.net Fri Jul 25 04:00:33 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Fri, 25 Jul 2003 9:00:33 +0000 Subject: [dba-VB] [dba-SQLServer]Auto Supply Connection strings andpasswords to controls on forms(VB6 & SQL) Message-ID: <20030725090033.NFMG12389.fep02-svc.ttys.com@localhost> Any chance of anyone sending me some sample code of this, including how I tell the ADO Controls to use the connection string, I juts can't get my head round this one for some reason..... Thanks in advance.. Paul Hartland From: "Francisco H Tapia" Date: Thu 24/Jul/2003 15:59 GMT To: Subject: Re: [dba-VB] [dba-SQLServer]Auto Supply Connection strings andpasswords to controls on forms(VB6 & SQL) I second Arthur's suggestion along w/ maybe get a little bit of sleep ;o). Having constants w/ the connection string is so nice cuz you can modify the connection string in one place only. -Francisco http://rcm.netfirms.com On Thursday, July 24, 2003 8:48 AM [GMT-8], Arthur Fuller wrote: : Although retrofitting it might be a little work, why don't you define : the connection string as a constant? Then you could find and replace : all the literal occurrences : : "Those who would sacrifice liberty for security deserve neither." : -- Benjamin Franklin : : -----Original Message----- : From: dba-vb-bounces at databaseadvisors.com : [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of : paul.hartland at fsmail.net : Sent: July 23, 2003 10:07 AM : To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; : dba-vb at databaseadvisors.com : Subject: [dba-VB] [dba-SQLServer]Auto Supply Connection strings and : passwords to controls on forms(VB6 & SQL) : : : To all, : : I have a VB6 application which looks at a SQL Server 7 database : (which is on a development server), and I am using a mixture of : DataEnvironment and ADO Controls for the application. However when : it's finshed It will be moved to the live server so that everyone can : gain access to it. The problem being that when I move to the live : server I will have to remember to change all the ADO controls and the : DataEnvironment connection manually (I don't want to have to do this : if I can help it). : : What I thought of doing is have a table consisting of the : ConnectionString, Username & Password and then a table of all the : form names and ADO Controls, and somehow looping through the tables : and setting the connections automatically. This is where I am stuck, : I have created the tables and entered the connection strings etc, and : I can do the loop which will loop through the records, but I don;t : know how to set the connection strings, using the form names and ADO : Controls from the tables. : : Am I being stupid in doing it this way ? : : Is there a better way to do this ? : : Can anyone help on this, as the application is almost finished.....? : : Thanks for any help in advance.... : : Paul Hartland : : : __________________________________________________________________________ : Join Freeserve http://www.freeserve.com/time/ : : Winner of the 2003 Internet Service Providers' Association awards for : Best Unmetered ISP and Best Consumer Application. : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : _______________________________________________ : dba-VB mailing list : dba-VB at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-vb : 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 __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. From my.lists at verizon.net Fri Jul 25 14:06:46 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Fri, 25 Jul 2003 12:06:46 -0700 Subject: [dba-SQLServer]Auto Supply Connection stringsandpasswords to controls on forms(VB6 & SQL) References: <20030725090033.NFMG12389.fep02-svc.ttys.com@localhost> Message-ID: <002701c352df$e4e84dc0$b615010a@FHTAPIA> a connection string can be generated using a udl file (to that go to your desktop (or any folder really)) create a text file and rename it to udl then click it and set the connections to your db. now rename it again to a .txt file. use this connection string and simply in a module somewhere and create a public constant CONST myConnStr as string = "your connection string" for your ado objects you'll need to create a connection object and set it to your ado objects such as Dim conn as adodb.connection set conn = new adodb.connection conn.open myConnStr 'Your connection string then it's just a matter of setting your recordsets to it I personnally don't like the dataenvironment variable cuz it tends to cause more problems than help but that's just mho. most objects you can just set the connection by setting it as rst.activeconnection = Conn 'after following the above connection object settings -Francisco http://rcm.netfirms.com On Friday, July 25, 2003 2:00 AM [GMT-8], paul.hartland at fsmail.net wrote: : Any chance of anyone sending me some sample code of this, including : how I tell the ADO Controls to use the connection string, I juts : can't get my head round this one for some reason..... : : Thanks in advance.. : : Paul Hartland : : : From: "Francisco H Tapia" : Date: Thu 24/Jul/2003 15:59 GMT : To: : Subject: Re: [dba-VB] [dba-SQLServer]Auto Supply Connection strings : andpasswords to controls on forms(VB6 & SQL) : : I second Arthur's suggestion along w/ maybe get a little bit of sleep : ;o). : Having constants w/ the connection string is so nice cuz you can : modify the : connection string in one place only. : : -Francisco : http://rcm.netfirms.com : : On Thursday, July 24, 2003 8:48 AM [GMT-8], : Arthur Fuller wrote: : :: Although retrofitting it might be a little work, why don't you define :: the connection string as a constant? Then you could find and replace :: all the literal occurrences :: :: "Those who would sacrifice liberty for security deserve neither." :: -- Benjamin Franklin :: :: -----Original Message----- :: From: dba-vb-bounces at databaseadvisors.com :: [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of :: paul.hartland at fsmail.net :: Sent: July 23, 2003 10:07 AM :: To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; :: dba-vb at databaseadvisors.com :: Subject: [dba-VB] [dba-SQLServer]Auto Supply Connection strings and :: passwords to controls on forms(VB6 & SQL) :: :: :: To all, :: :: I have a VB6 application which looks at a SQL Server 7 database :: (which is on a development server), and I am using a mixture of :: DataEnvironment and ADO Controls for the application. However when :: it's finshed It will be moved to the live server so that everyone can :: gain access to it. The problem being that when I move to the live :: server I will have to remember to change all the ADO controls and the :: DataEnvironment connection manually (I don't want to have to do this :: if I can help it). :: :: What I thought of doing is have a table consisting of the :: ConnectionString, Username & Password and then a table of all the :: form names and ADO Controls, and somehow looping through the tables :: and setting the connections automatically. This is where I am stuck, :: I have created the tables and entered the connection strings etc, and :: I can do the loop which will loop through the records, but I don;t :: know how to set the connection strings, using the form names and ADO :: Controls from the tables. :: :: Am I being stupid in doing it this way ? :: :: Is there a better way to do this ? :: :: Can anyone help on this, as the application is almost finished.....? :: :: Thanks for any help in advance.... :: :: Paul Hartland :: :: :: __________________________________________________________________________ :: Join Freeserve http://www.freeserve.com/time/ :: :: Winner of the 2003 Internet Service Providers' Association awards for :: Best Unmetered ISP and Best Consumer Application. :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com :: :: _______________________________________________ :: dba-VB mailing list :: dba-VB at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-vb :: 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 : : : __________________________________________________________________________ : Join Freeserve http://www.freeserve.com/time/ : : Winner of the 2003 Internet Service Providers' Association awards for : Best Unmetered ISP and Best Consumer Application. : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From paul.hartland at fsmail.net Mon Jul 28 04:11:59 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Mon, 28 Jul 2003 9:11:59 +0000 Subject: [dba-SQLServer]ADO Control With Stored Procedure as Recordset Message-ID: <20030728091159.SGIT12389.fep02-svc.ttys.com@localhost> To all, I have a SQL Server 7.0 BE, with a Visual Basic 6 FE. In SQl Server 7.0 I have a stored procedure which requires two parameters (Payroll, JobDate) and this returns all the jobs that a person is programmed to do. On my VB6 FE I have a form with a DataGrid and an ADO Control, with the Datagrid pointing to the ADO Control for it's datasource. When the form opens I want to pass the payroll and jobdate to the SQL Server stored procedure and return the results to the ADO Control which will then be displayed in the DataGrid. Is there anyone out there that can tell me how to do this, or has some sample code that I could look at to show me exactly how this can be acheived. Thanks in advance. Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. From paul.hartland at fsmail.net Mon Jul 28 04:11:59 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Mon, 28 Jul 2003 9:11:59 +0000 Subject: [dba-SQLServer] [AccessD] ADO Control With Stored Procedure as Recordset Message-ID: <20030728091159.SGIT12389.fep02-svc.ttys.com@localhost> To all, I have a SQL Server 7.0 BE, with a Visual Basic 6 FE. In SQl Server 7.0 I have a stored procedure which requires two parameters (Payroll, JobDate) and this returns all the jobs that a person is programmed to do. On my VB6 FE I have a form with a DataGrid and an ADO Control, with the Datagrid pointing to the ADO Control for it's datasource. When the form opens I want to pass the payroll and jobdate to the SQL Server stored procedure and return the results to the ADO Control which will then be displayed in the DataGrid. Is there anyone out there that can tell me how to do this, or has some sample code that I could look at to show me exactly how this can be acheived. Thanks in advance. Paul Hartland __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From my.lists at verizon.net Mon Jul 28 18:01:33 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 28 Jul 2003 16:01:33 -0700 Subject: [dba-SQLServer]Sproc runs and then it doesn't Message-ID: <003a01c3555c$30abe630$b615010a@FHTAPIA> I have a stored procedure in my database that runs fine in QA. In fact I created 2 versions of this sproc and both of them run fine in QA. In an ADP that I have one sproc runs and the other does not. What would be different? In the where clause I am checking for >= or <. The code is "I D E N T I C A L" in both sprocs lets call them stp_New and stp_Old the new checks for any new entries since today 12:00am, and the Old checks for any records older than today at 12:00am. If I run the sproc in Access (ADP) it does not give me any data for stp_New but it does give me the correct results for stp_Old. If I go to QA I can run either sproc and they both execute correctly. I am at a loss about this one... anyone ever run into something similar? This is my code... ---------------------------------------------------------------------------- ---------------------------- ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls (@LoginID NVARCHAR(50)) AS SET NOCOUNT ON Declare @SetDateTime as datetime, @entryUser as uniqueidentifier SET @entryUser = dbo.udfEntryUSER(@LoginID) SET @SetDateTime = CAST ( CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' 00:00:00' AS DATETIME) IF EXISTS (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#MaxStatus')) BEGIN DROP TABLE #MaxStatus END CREATE TABLE #MaxStatus ([HelpDeskID] [UniqueIdentifier] Not Null, [HelpStatusID] [int] Not Null, [entryTime] [dateTIME] Not Null) INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) LEFT OUTER JOIN (SELECT HelpDeskID, Max(entryTIME) as entryTIME From dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME AND HelpStatusID < 2) IF EXISTS (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN DROP TABLE #HelpDeskCallDetails END CREATE TABLE #HelpDeskCallDetails ([HelpDeskID] [uniqueidentifier] Not Null, [CallNotes] [nvarchar](20) Null, [ContactAddrID] [uniqueidentifier] Null, [entryTIME] [datetime] Null, [entryUSER] [uniqueidentifier] Null) INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, ContactAddrID, entryTIME, entryUSER) Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, A.entryTIME, A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) INNER JOIN (SELECT HelpDeskID, Max(entryTIME) as entryTIME From dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) AS B ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME ) Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, Addr.LocationName,ZipList.State, HelpDeskCallDetails.CallNotes AS [Call Notes], HelpDeskCallDetails.entryTIME FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN dbo.tbl_Machine M WITH(NOLOCK) ON HD.MachineID = M.MachineID LEFT OUTER JOIN (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus ON HD.HelpDeskID = MaxStatus.HelpDeskID INNER JOIN (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS HelpDeskCallDetails ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr WITH(NOLOCK) ON HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON CtcAddr.ContactID = Ctc.ContactID LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON CtcAddr.AddrID = Addr.AddrID LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON Addr.CompanyID = Co.CompanyID LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) ON Addr.ZipID = ZipList.ZipID --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, but only the OLD (<) runs in Access Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND HelpDeskCallDetails.entryUSER = @entryUser ORDER BY HelpDeskCallDetails.entryTIME ASC IF EXISTS (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#MaxStatus')) BEGIN DROP TABLE #MaxStatus END IF EXISTS (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN DROP TABLE #HelpDeskCallDetails END SET NOCOUNT OFF -Francisco http://rcm.netfirms.com From tuxedo_man at hotmail.com Mon Jul 28 20:09:36 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Tue, 29 Jul 2003 01:09:36 +0000 Subject: [dba-SQLServer]Sproc runs and then it doesn't Message-ID: Are you tried running both sprocs in QA using the security authentication as ADP (eg. same login)? also, does SQL Profiler reveal anything? >From: "Francisco H Tapia" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]Sproc runs and then it doesn't >Date: Mon, 28 Jul 2003 16:01:33 -0700 > >I have a stored procedure in my database that runs fine in QA. In fact I >created 2 versions of this sproc and both of them run fine in QA. In an >ADP >that I have one sproc runs and the other does not. What would be >different? > >In the where clause I am checking for >= or <. > >The code is "I D E N T I C A L" in both sprocs lets call them stp_New and >stp_Old the new checks for any new entries since today 12:00am, and the >Old >checks for any records older than today at 12:00am. > >If I run the sproc in Access (ADP) it does not give me any data for stp_New >but it does give me the correct results for stp_Old. If I go to QA I can >run either sproc and they both execute correctly. I am at a loss about >this >one... anyone ever run into something similar? > >This is my code... > >---------------------------------------------------------------------------- >---------------------------- >ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls (@LoginID >NVARCHAR(50)) AS > >SET NOCOUNT ON >Declare @SetDateTime as datetime, @entryUser as uniqueidentifier >SET @entryUser = dbo.udfEntryUSER(@LoginID) >SET @SetDateTime = CAST ( > CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + > CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + > CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' 00:00:00' > AS DATETIME) > >IF EXISTS (select * from tempdb.dbo.sysobjects where id = >object_id(N'tempdb..#MaxStatus')) BEGIN > DROP TABLE #MaxStatus >END > CREATE TABLE #MaxStatus > ([HelpDeskID] [UniqueIdentifier] Not Null, > [HelpStatusID] [int] Not Null, > [entryTime] [dateTIME] Not Null) > INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) > Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM >dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) > LEFT OUTER JOIN > (SELECT HelpDeskID, Max(entryTIME) as entryTIME From >dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B > ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME AND >HelpStatusID < 2) > >IF EXISTS (select * from tempdb.dbo.sysobjects where id = >object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN > DROP TABLE #HelpDeskCallDetails >END > CREATE TABLE #HelpDeskCallDetails > ([HelpDeskID] [uniqueidentifier] Not Null, > [CallNotes] [nvarchar](20) Null, > [ContactAddrID] [uniqueidentifier] Null, > [entryTIME] [datetime] Null, > [entryUSER] [uniqueidentifier] Null) > > INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, ContactAddrID, >entryTIME, entryUSER) > Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, >A.entryTIME, >A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) > INNER JOIN > (SELECT HelpDeskID, Max(entryTIME) as entryTIME From >dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) AS B > ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME ) > > > >Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, >Addr.LocationName,ZipList.State, > HelpDeskCallDetails.CallNotes AS [Call Notes], >HelpDeskCallDetails.entryTIME >FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN dbo.tbl_Machine M >WITH(NOLOCK) ON HD.MachineID = M.MachineID > > LEFT OUTER JOIN > (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus > ON HD.HelpDeskID = MaxStatus.HelpDeskID > > INNER JOIN > (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS >HelpDeskCallDetails > ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID > > LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr WITH(NOLOCK) ON >HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID > LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON >CtcAddr.ContactID >= Ctc.ContactID > LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON CtcAddr.AddrID = >Addr.AddrID > LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON Addr.CompanyID = >Co.CompanyID > LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) ON >Addr.ZipID >= ZipList.ZipID > >--THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, but only >the >OLD (<) runs in Access > >Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND >HelpDeskCallDetails.entryUSER = @entryUser > >ORDER BY HelpDeskCallDetails.entryTIME ASC > > >IF EXISTS (select * from tempdb.dbo.sysobjects where id = >object_id(N'tempdb..#MaxStatus')) BEGIN > DROP TABLE #MaxStatus >END >IF EXISTS (select * from tempdb.dbo.sysobjects where id = >object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN > DROP TABLE #HelpDeskCallDetails >END > >SET NOCOUNT OFF > > >-Francisco >http://rcm.netfirms.com > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From my.lists at verizon.net Tue Jul 29 02:36:10 2003 From: my.lists at verizon.net (Francisco Tapia) Date: Tue, 29 Jul 2003 00:36:10 -0700 Subject: [dba-SQLServer]Sproc runs and then it doesn't References: Message-ID: <003c01c355a4$14fd7be0$fd512304@amd2k> I'm running it as windows authentication at the moment for both QA and the ADP, doh I did not think to use the profiler, I will check that next... -Francisco http://rcm.netfirms.com/ On Monday, July 28, 2003 6:09 PM [GMT -8], Billy Pang wrote: : Are you tried running both sprocs in QA using the security : authentication as ADP (eg. same login)? : also, does SQL Profiler reveal anything? : : : : : :: From: "Francisco H Tapia" :: Reply-To: dba-sqlserver at databaseadvisors.com :: To: :: Subject: [dba-SQLServer]Sproc runs and then it doesn't :: Date: Mon, 28 Jul 2003 16:01:33 -0700 :: :: I have a stored procedure in my database that runs fine in QA. In :: fact I created 2 versions of this sproc and both of them run fine in :: QA. In an ADP :: that I have one sproc runs and the other does not. What would be :: different? :: :: In the where clause I am checking for >= or <. :: :: The code is "I D E N T I C A L" in both sprocs lets call them :: stp_New and stp_Old the new checks for any new entries since today :: 12:00am, and the Old :: checks for any records older than today at 12:00am. :: :: If I run the sproc in Access (ADP) it does not give me any data for :: stp_New but it does give me the correct results for stp_Old. If I :: go to QA I can run either sproc and they both execute correctly. I :: am at a loss about this :: one... anyone ever run into something similar? :: :: This is my code... :: :: ------------------------------------------------------------------------- --- :: ---------------------------- :: ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls (@LoginID :: NVARCHAR(50)) AS :: :: SET NOCOUNT ON :: Declare @SetDateTime as datetime, @entryUser as uniqueidentifier :: SET @entryUser = dbo.udfEntryUSER(@LoginID) :: SET @SetDateTime = CAST ( :: CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + :: CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + :: CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' :: 00:00:00' AS DATETIME) :: :: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :: object_id(N'tempdb..#MaxStatus')) BEGIN :: DROP TABLE #MaxStatus :: END :: CREATE TABLE #MaxStatus :: ([HelpDeskID] [UniqueIdentifier] Not Null, :: [HelpStatusID] [int] Not Null, :: [entryTime] [dateTIME] Not Null) :: INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) :: Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM :: dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) :: LEFT OUTER JOIN :: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From :: dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B :: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME AND :: HelpStatusID < 2) :: :: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN :: DROP TABLE #HelpDeskCallDetails :: END :: CREATE TABLE #HelpDeskCallDetails :: ([HelpDeskID] [uniqueidentifier] Not Null, :: [CallNotes] [nvarchar](20) Null, :: [ContactAddrID] [uniqueidentifier] Null, :: [entryTIME] [datetime] Null, :: [entryUSER] [uniqueidentifier] Null) :: :: INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, :: ContactAddrID, entryTIME, entryUSER) :: Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, :: A.entryTIME, :: A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) :: INNER JOIN :: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From :: dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) AS B :: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME ) :: :: :: :: Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, :: Addr.LocationName,ZipList.State, :: HelpDeskCallDetails.CallNotes AS [Call Notes], :: HelpDeskCallDetails.entryTIME :: FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN dbo.tbl_Machine M :: WITH(NOLOCK) ON HD.MachineID = M.MachineID :: :: LEFT OUTER JOIN :: (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus :: ON HD.HelpDeskID = MaxStatus.HelpDeskID :: :: INNER JOIN :: (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS :: HelpDeskCallDetails :: ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID :: :: LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr WITH(NOLOCK) ON :: HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID :: LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON :: CtcAddr.ContactID :: = Ctc.ContactID :: LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON :: CtcAddr.AddrID = Addr.AddrID :: LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON :: Addr.CompanyID = Co.CompanyID :: LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) ON :: Addr.ZipID :: = ZipList.ZipID :: :: --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, but :: only the :: OLD (<) runs in Access :: :: Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND :: HelpDeskCallDetails.entryUSER = @entryUser :: :: ORDER BY HelpDeskCallDetails.entryTIME ASC :: :: :: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :: object_id(N'tempdb..#MaxStatus')) BEGIN :: DROP TABLE #MaxStatus :: END :: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN :: DROP TABLE #HelpDeskCallDetails :: END :: :: SET NOCOUNT OFF :: :: :: -Francisco :: http://rcm.netfirms.com :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com :: : : _________________________________________________________________ : STOP MORE SPAM with the new MSN 8 and get 2 months FREE* : http://join.msn.com/?page=features/junkmail : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From my.lists at verizon.net Tue Jul 29 04:05:33 2003 From: my.lists at verizon.net (Francisco Tapia) Date: Tue, 29 Jul 2003 02:05:33 -0700 Subject: [dba-SQLServer]Sproc runs and then it doesn't References: <003c01c355a4$14fd7be0$fd512304@amd2k> Message-ID: <00db01c355b0$91b21cc0$fd512304@amd2k> Billy, I took the adp, and the database home and updated my home sql developer copy with the office copy of the server w/ no code changes and off the cuff copy to my hdd from the office the adp now displays the record, Sql Server 2000 SP3, but at the office it still does not and it is the same version of the db, and access adp. this is most bazaar. -Francisco http://rcm.netfirms.com/ On Tuesday, July 29, 2003 12:36 AM [GMT -8], Francisco Tapia wrote: : I'm running it as windows authentication at the moment for both QA : and the ADP, doh I did not think to use the profiler, I will check : that next... : : -Francisco : http://rcm.netfirms.com/ : : On Monday, July 28, 2003 6:09 PM [GMT -8], : Billy Pang wrote: : :: Are you tried running both sprocs in QA using the security :: authentication as ADP (eg. same login)? :: also, does SQL Profiler reveal anything? :: :: :: :: :: ::: From: "Francisco H Tapia" ::: Reply-To: dba-sqlserver at databaseadvisors.com ::: To: ::: Subject: [dba-SQLServer]Sproc runs and then it doesn't ::: Date: Mon, 28 Jul 2003 16:01:33 -0700 ::: ::: I have a stored procedure in my database that runs fine in QA. In ::: fact I created 2 versions of this sproc and both of them run fine in ::: QA. In an ADP ::: that I have one sproc runs and the other does not. What would be ::: different? ::: ::: In the where clause I am checking for >= or <. ::: ::: The code is "I D E N T I C A L" in both sprocs lets call them ::: stp_New and stp_Old the new checks for any new entries since today ::: 12:00am, and the Old ::: checks for any records older than today at 12:00am. ::: ::: If I run the sproc in Access (ADP) it does not give me any data for ::: stp_New but it does give me the correct results for stp_Old. If I ::: go to QA I can run either sproc and they both execute correctly. I ::: am at a loss about this ::: one... anyone ever run into something similar? ::: ::: This is my code... ::: ::: ------------------------------------------------------------------------ - ::: --- ::: ---------------------------- ::: ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls (@LoginID ::: NVARCHAR(50)) AS ::: ::: SET NOCOUNT ON ::: Declare @SetDateTime as datetime, @entryUser as uniqueidentifier ::: SET @entryUser = dbo.udfEntryUSER(@LoginID) ::: SET @SetDateTime = CAST ( ::: CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + ::: CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + ::: CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' ::: 00:00:00' AS DATETIME) ::: ::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::: object_id(N'tempdb..#MaxStatus')) BEGIN ::: DROP TABLE #MaxStatus ::: END ::: CREATE TABLE #MaxStatus ::: ([HelpDeskID] [UniqueIdentifier] Not Null, ::: [HelpStatusID] [int] Not Null, ::: [entryTime] [dateTIME] Not Null) ::: INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) ::: Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM ::: dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) ::: LEFT OUTER JOIN ::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From ::: dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B ::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME AND ::: HelpStatusID < 2) ::: ::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN ::: DROP TABLE #HelpDeskCallDetails ::: END ::: CREATE TABLE #HelpDeskCallDetails ::: ([HelpDeskID] [uniqueidentifier] Not Null, ::: [CallNotes] [nvarchar](20) Null, ::: [ContactAddrID] [uniqueidentifier] Null, ::: [entryTIME] [datetime] Null, ::: [entryUSER] [uniqueidentifier] Null) ::: ::: INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, ::: ContactAddrID, entryTIME, entryUSER) ::: Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, ::: A.entryTIME, ::: A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) ::: INNER JOIN ::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From ::: dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) AS B ::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME ) ::: ::: ::: ::: Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, ::: Addr.LocationName,ZipList.State, ::: HelpDeskCallDetails.CallNotes AS [Call Notes], ::: HelpDeskCallDetails.entryTIME ::: FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN dbo.tbl_Machine M ::: WITH(NOLOCK) ON HD.MachineID = M.MachineID ::: ::: LEFT OUTER JOIN ::: (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus ::: ON HD.HelpDeskID = MaxStatus.HelpDeskID ::: ::: INNER JOIN ::: (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS ::: HelpDeskCallDetails ::: ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID ::: ::: LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr WITH(NOLOCK) ON ::: HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID ::: LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON ::: CtcAddr.ContactID ::: = Ctc.ContactID ::: LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON ::: CtcAddr.AddrID = Addr.AddrID ::: LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON ::: Addr.CompanyID = Co.CompanyID ::: LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) ON ::: Addr.ZipID ::: = ZipList.ZipID ::: ::: --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, but ::: only the ::: OLD (<) runs in Access ::: ::: Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND ::: HelpDeskCallDetails.entryUSER = @entryUser ::: ::: ORDER BY HelpDeskCallDetails.entryTIME ASC ::: ::: ::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::: object_id(N'tempdb..#MaxStatus')) BEGIN ::: DROP TABLE #MaxStatus ::: END ::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN ::: DROP TABLE #HelpDeskCallDetails ::: END ::: ::: SET NOCOUNT OFF ::: ::: ::: -Francisco ::: http://rcm.netfirms.com From Robert.Djabarov at usaa.com Tue Jul 29 08:41:02 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 29 Jul 2003 08:41:02 -0500 Subject: [dba-SQLServer]Auto Supply Connection strings and passwordsto controls on forms(VB6 & SQL) Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC3C@ex02.eagle.usaa.com> Dim rs as object clsADO.OpenRS rs, "exec dbo.sp_AdjudicateClaim " & mClaimID, RSReadWrite If clsADO.ADOErrorsFound Then Exit Sub 'Error message is displayed by the class, so no need to do anything else here clsADO.CloseRS rs -----Original Message----- From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net] Sent: Thursday, July 24, 2003 3:13 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: RE: [dba-SQLServer]Auto Supply Connection strings and passwordsto controls on forms(VB6 & SQL) Although, you are making this sound really simple.....could I sse some sample code to get me started etc, I can build the connection string no problem, but whats clsADO and how does it control all data-related activity....?? Paul From: "Djabarov, Robert" Date: Wed 23/Jul/2003 16:05 GMT To: Subject: RE: [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) I resolved it by doing the following: - The app has a logon screen that has UID, PWD, SRV, DB, and Network Library. All values are "memorizable" except for the password (SaveSetting/GetSetting) - If logon successful, - I check for the presence of a specific set of objects in the database that was specified at the logon. If this set is missing or incomplete, - app terminates, otherwise you're in. The ConnectionString gets built based on values mentioned for the logon screen and become part of clsADO class that controls all data-related activity. Once I implemented this very simple "architecture", I never worry about where my back-end lives. All the user needs to do is specify new server and new database (if different) to be able to connect along with their new user ID and new password (again, if different). The next time they logon only the password needs to be retyped. Robert Djabarov * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net] Sent: Wednesday, July 23, 2003 9:07 AM To: dba-sqlserver at databaseadvisors.com; accessd at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-SQLServer]Auto Supply Connection strings and passwords to controls on forms(VB6 & SQL) To all, I have a VB6 application which looks at a SQL Server 7 database (which is on a development server), and I am using a mixture of DataEnvironment and ADO Controls for the application. However when it's finshed It will be moved to the live server so that everyone can gain access to it. The problem being that when I move to the live server I will have to remember to change all the ADO controls and the DataEnvironment connection manually (I don't want to have to do this if I can help it). What I thought of doing is have a table consisting of the ConnectionString, Username & Password and then a table of all the form names and ADO Controls, and somehow looping through the tables and setting the connections automatically. This is where I am stuck, I have created the tables and entered the connection strings etc, and I can do the loop which will loop through the records, but I don;t know how to set the connection strings, using the form names and ADO Controls from the tables. Am I being stupid in doing it this way ? Is there a better way to do this ? Can anyone help on this, as the application is almost finished.....? Thanks for any help in advance.... Paul Hartland ________________________________________________________________________ __ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ 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 ________________________________________________________________________ __ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From tuxedo_man at hotmail.com Tue Jul 29 10:28:49 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Tue, 29 Jul 2003 15:28:49 +0000 Subject: [dba-SQLServer]Sproc runs and then it doesn't Message-ID: so both sprocs work perfectly at home? Can you alter both sprocs so that it just does one simple select? if both sprocs work at the office, then alter the sproc again using the real code and see if it still works. also, are you running both sprocs concurrently? also, since you are using ss2k, how about replacing your temp tables with table variables? >From: "Francisco Tapia" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't >Date: Tue, 29 Jul 2003 02:05:33 -0700 > >Billy, > I took the adp, and the database home and updated my home sql developer >copy with the office copy of the server w/ no code changes and off the cuff >copy to my hdd from the office the adp now displays the record, Sql Server >2000 SP3, but at the office it still does not and it is the same version of >the db, and access adp. > >this is most bazaar. > > >-Francisco >http://rcm.netfirms.com/ > >On Tuesday, July 29, 2003 12:36 AM [GMT -8], >Francisco Tapia wrote: > >: I'm running it as windows authentication at the moment for both QA >: and the ADP, doh I did not think to use the profiler, I will check >: that next... >: >: -Francisco >: http://rcm.netfirms.com/ >: >: On Monday, July 28, 2003 6:09 PM [GMT -8], >: Billy Pang wrote: >: >:: Are you tried running both sprocs in QA using the security >:: authentication as ADP (eg. same login)? >:: also, does SQL Profiler reveal anything? >:: >:: >:: >:: >:: >::: From: "Francisco H Tapia" >::: Reply-To: dba-sqlserver at databaseadvisors.com >::: To: >::: Subject: [dba-SQLServer]Sproc runs and then it doesn't >::: Date: Mon, 28 Jul 2003 16:01:33 -0700 >::: >::: I have a stored procedure in my database that runs fine in QA. In >::: fact I created 2 versions of this sproc and both of them run fine in >::: QA. In an ADP >::: that I have one sproc runs and the other does not. What would be >::: different? >::: >::: In the where clause I am checking for >= or <. >::: >::: The code is "I D E N T I C A L" in both sprocs lets call them >::: stp_New and stp_Old the new checks for any new entries since today >::: 12:00am, and the Old >::: checks for any records older than today at 12:00am. >::: >::: If I run the sproc in Access (ADP) it does not give me any data for >::: stp_New but it does give me the correct results for stp_Old. If I >::: go to QA I can run either sproc and they both execute correctly. I >::: am at a loss about this >::: one... anyone ever run into something similar? >::: >::: This is my code... >::: >::: >------------------------------------------------------------------------ >- >::: --- >::: ---------------------------- >::: ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls (@LoginID >::: NVARCHAR(50)) AS >::: >::: SET NOCOUNT ON >::: Declare @SetDateTime as datetime, @entryUser as uniqueidentifier >::: SET @entryUser = dbo.udfEntryUSER(@LoginID) >::: SET @SetDateTime = CAST ( >::: CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + >::: CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + >::: CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' >::: 00:00:00' AS DATETIME) >::: >::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = >::: object_id(N'tempdb..#MaxStatus')) BEGIN >::: DROP TABLE #MaxStatus >::: END >::: CREATE TABLE #MaxStatus >::: ([HelpDeskID] [UniqueIdentifier] Not Null, >::: [HelpStatusID] [int] Not Null, >::: [entryTime] [dateTIME] Not Null) >::: INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) >::: Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM >::: dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) >::: LEFT OUTER JOIN >::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From >::: dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B >::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME AND >::: HelpStatusID < 2) >::: >::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = >::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN >::: DROP TABLE #HelpDeskCallDetails >::: END >::: CREATE TABLE #HelpDeskCallDetails >::: ([HelpDeskID] [uniqueidentifier] Not Null, >::: [CallNotes] [nvarchar](20) Null, >::: [ContactAddrID] [uniqueidentifier] Null, >::: [entryTIME] [datetime] Null, >::: [entryUSER] [uniqueidentifier] Null) >::: >::: INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, >::: ContactAddrID, entryTIME, entryUSER) >::: Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, >::: A.entryTIME, >::: A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) >::: INNER JOIN >::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From >::: dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) AS B >::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME ) >::: >::: >::: >::: Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, >::: Addr.LocationName,ZipList.State, >::: HelpDeskCallDetails.CallNotes AS [Call Notes], >::: HelpDeskCallDetails.entryTIME >::: FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN dbo.tbl_Machine M >::: WITH(NOLOCK) ON HD.MachineID = M.MachineID >::: >::: LEFT OUTER JOIN >::: (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus >::: ON HD.HelpDeskID = MaxStatus.HelpDeskID >::: >::: INNER JOIN >::: (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS >::: HelpDeskCallDetails >::: ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID >::: >::: LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr WITH(NOLOCK) ON >::: HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID >::: LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON >::: CtcAddr.ContactID >::: = Ctc.ContactID >::: LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON >::: CtcAddr.AddrID = Addr.AddrID >::: LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON >::: Addr.CompanyID = Co.CompanyID >::: LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) ON >::: Addr.ZipID >::: = ZipList.ZipID >::: >::: --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, but >::: only the >::: OLD (<) runs in Access >::: >::: Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND >::: HelpDeskCallDetails.entryUSER = @entryUser >::: >::: ORDER BY HelpDeskCallDetails.entryTIME ASC >::: >::: >::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = >::: object_id(N'tempdb..#MaxStatus')) BEGIN >::: DROP TABLE #MaxStatus >::: END >::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = >::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN >::: DROP TABLE #HelpDeskCallDetails >::: END >::: >::: SET NOCOUNT OFF >::: >::: >::: -Francisco >::: http://rcm.netfirms.com > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From DavidL at sierranevada.com Tue Jul 29 10:49:25 2003 From: DavidL at sierranevada.com (David Lewis) Date: Tue, 29 Jul 2003 08:49:25 -0700 Subject: [dba-SQLServer]Architecture/how to do it advice Message-ID: <229F7C29573CC4479A3313CC55B096541BC96E@pale.sierranevada.corp> This seems to be a good collection of people with wide experience, so I'd like to ask a strategy type question. I don't have any certifications, but am reasonably experienced in vb, access and now sql server 2000. Nothing on too large a scale, but what I've built is a sophisticated app for a brewery to track and evaluate production and r&d. I've done my reading and have tried to incorporate what I understand to be good practices (good quality code, copious sprocs, udfs where appropriate, good security...) I am in the middle of porting much of the reporting part of the app to the web (an intranet) to make it more easily available to users. I have hired an outside consultant to help with much of it. He is not a db guy, so is most comfortable with opening connections as needed on an asp page, sending a query string over the network, etc. We argue constantly about many aspects of architecture, for example the use of sprocs (he doesn't see the need for them, doesn't understand their advantages, knows only that he can't see them) in spite of me trying to explain the advantages, some of which are not relevant to our situation (we are unlikely to suffer an sql injection attack). However I am of the opinion that forming good habits is essential, because sooner or later it will become important that something be done the 'right' way, and if it is a habit you won't have to stop and think about it. The real point of this message is: he described to me another project he is working on for a major state agency that will be web based. As he described it, each time a user opens the app there are 500 round trips across the server, each to fire a separate stored procedure or execute an sql string. Each time, for each user! This has been architected by people who at least locally (and I also suspect on a statewide level) have reputations for being expert, professional and experienced (oracle guys). I was stunned. So my questions are: I don't have experience with lots of different companies, or with meeting strict deadlines -- do I need to lighten up? I think some of the reasons for their approach was that they had time constraints (you know, never enough time to do it right...). I don't mean to start people off on rants (for or against). But should I be sticking to my guns? D. Lewis From my.lists at verizon.net Tue Jul 29 11:14:44 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 29 Jul 2003 09:14:44 -0700 Subject: [dba-SQLServer]Sproc runs and then it doesn't References: Message-ID: <003201c355ec$86690c20$b615010a@FHTAPIA> That's right Billy, If unmodiffied Database / sprocs and Unmoddifed Front End Access ADP return the data via Access and QA as expected at home the machine is an AMD2000+ w/ 1gig of ram Win2k SP2 + ss2kdev SP3 WORK: Dual 800 Intel Xeon w/1gig of ram Win2kServer SP2 +ss2kserver SP3 well I tried just as you suggested... and no dice :( the >= still doesnt return via access what do you mean Table Variables? Thanks -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 8:28 AM [GMT-8], Billy Pang wrote: : so both sprocs work perfectly at home? : : Can you alter both sprocs so that it just does one simple select? if : both sprocs work at the office, then alter the sproc again using the : real code and see if it still works. : : also, are you running both sprocs concurrently? : : also, since you are using ss2k, how about replacing your temp tables : with table variables? : : : : :: From: "Francisco Tapia" :: Reply-To: dba-sqlserver at databaseadvisors.com :: To: :: Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't :: Date: Tue, 29 Jul 2003 02:05:33 -0700 :: :: Billy, :: I took the adp, and the database home and updated my home sql :: developer copy with the office copy of the server w/ no code changes :: and off the cuff copy to my hdd from the office the adp now displays :: the record, Sql Server 2000 SP3, but at the office it still does not :: and it is the same version of the db, and access adp. :: :: this is most bazaar. :: :: :: -Francisco :: http://rcm.netfirms.com/ :: :: On Tuesday, July 29, 2003 12:36 AM [GMT -8], :: Francisco Tapia wrote: :: ::: I'm running it as windows authentication at the moment for both QA ::: and the ADP, doh I did not think to use the profiler, I will check ::: that next... ::: ::: -Francisco ::: http://rcm.netfirms.com/ ::: ::: On Monday, July 28, 2003 6:09 PM [GMT -8], ::: Billy Pang wrote: ::: :::: Are you tried running both sprocs in QA using the security :::: authentication as ADP (eg. same login)? :::: also, does SQL Profiler reveal anything? :::: :::: :::: :::: :::: ::::: From: "Francisco H Tapia" ::::: Reply-To: dba-sqlserver at databaseadvisors.com ::::: To: ::::: Subject: [dba-SQLServer]Sproc runs and then it doesn't ::::: Date: Mon, 28 Jul 2003 16:01:33 -0700 ::::: ::::: I have a stored procedure in my database that runs fine in QA. In ::::: fact I created 2 versions of this sproc and both of them run fine ::::: in QA. In an ADP ::::: that I have one sproc runs and the other does not. What would be ::::: different? ::::: ::::: In the where clause I am checking for >= or <. ::::: ::::: The code is "I D E N T I C A L" in both sprocs lets call them ::::: stp_New and stp_Old the new checks for any new entries since ::::: today 12:00am, and the Old ::::: checks for any records older than today at 12:00am. ::::: ::::: If I run the sproc in Access (ADP) it does not give me any data ::::: for stp_New but it does give me the correct results for stp_Old. ::::: If I ::::: go to QA I can run either sproc and they both execute correctly. ::::: I ::::: am at a loss about this ::::: one... anyone ever run into something similar? ::::: ::::: This is my code... ::::: ::::: :: ------------------------------------------------------------------------ :: - ::::: --- ::::: ---------------------------- ::::: ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls (@LoginID ::::: NVARCHAR(50)) AS ::::: ::::: SET NOCOUNT ON ::::: Declare @SetDateTime as datetime, @entryUser as uniqueidentifier ::::: SET @entryUser = dbo.udfEntryUSER(@LoginID) ::::: SET @SetDateTime = CAST ( ::::: CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + ::::: CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + ::::: CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' ::::: 00:00:00' AS DATETIME) ::::: ::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::::: object_id(N'tempdb..#MaxStatus')) BEGIN ::::: DROP TABLE #MaxStatus ::::: END ::::: CREATE TABLE #MaxStatus ::::: ([HelpDeskID] [UniqueIdentifier] Not Null, ::::: [HelpStatusID] [int] Not Null, ::::: [entryTime] [dateTIME] Not Null) ::::: INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) ::::: Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM ::::: dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) ::::: LEFT OUTER JOIN ::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From ::::: dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B ::::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME ::::: AND HelpStatusID < 2) ::::: ::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN ::::: DROP TABLE #HelpDeskCallDetails ::::: END ::::: CREATE TABLE #HelpDeskCallDetails ::::: ([HelpDeskID] [uniqueidentifier] Not Null, ::::: [CallNotes] [nvarchar](20) Null, ::::: [ContactAddrID] [uniqueidentifier] Null, ::::: [entryTIME] [datetime] Null, ::::: [entryUSER] [uniqueidentifier] Null) ::::: ::::: INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, ::::: ContactAddrID, entryTIME, entryUSER) ::::: Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, ::::: A.entryTIME, ::::: A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) ::::: INNER JOIN ::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From ::::: dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) AS ::::: B ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME ::::: ) ::::: ::::: ::::: ::::: Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, ::::: Addr.LocationName,ZipList.State, ::::: HelpDeskCallDetails.CallNotes AS [Call Notes], ::::: HelpDeskCallDetails.entryTIME ::::: FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN dbo.tbl_Machine M ::::: WITH(NOLOCK) ON HD.MachineID = M.MachineID ::::: ::::: LEFT OUTER JOIN ::::: (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus ::::: ON HD.HelpDeskID = MaxStatus.HelpDeskID ::::: ::::: INNER JOIN ::::: (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS ::::: HelpDeskCallDetails ::::: ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID ::::: ::::: LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr WITH(NOLOCK) ::::: ON HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID ::::: LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON ::::: CtcAddr.ContactID ::::: = Ctc.ContactID ::::: LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON ::::: CtcAddr.AddrID = Addr.AddrID ::::: LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON ::::: Addr.CompanyID = Co.CompanyID ::::: LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) ON ::::: Addr.ZipID ::::: = ZipList.ZipID ::::: ::::: --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, ::::: but only the ::::: OLD (<) runs in Access ::::: ::::: Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND ::::: HelpDeskCallDetails.entryUSER = @entryUser ::::: ::::: ORDER BY HelpDeskCallDetails.entryTIME ASC ::::: ::::: ::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::::: object_id(N'tempdb..#MaxStatus')) BEGIN ::::: DROP TABLE #MaxStatus ::::: END ::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN ::::: DROP TABLE #HelpDeskCallDetails ::::: END ::::: ::::: SET NOCOUNT OFF ::::: ::::: ::::: -Francisco ::::: http://rcm.netfirms.com From Robert.Djabarov at usaa.com Tue Jul 29 11:18:30 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 29 Jul 2003 11:18:30 -0500 Subject: [dba-SQLServer]Architecture/how to do it advice Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DAC0F6@ex02.eagle.usaa.com> You're absolutely right, and stick to your guns, they are in the right direction. As per your contractor, - you need him for the web stuff, but make sure you have a solid back end guy backing you up and demanding standards compliance from the web people. Robert. -----Original Message----- From: David Lewis [mailto:DavidL at sierranevada.com] Sent: Tuesday, July 29, 2003 10:49 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer]Architecture/how to do it advice This seems to be a good collection of people with wide experience, so I'd like to ask a strategy type question. I don't have any certifications, but am reasonably experienced in vb, access and now sql server 2000. Nothing on too large a scale, but what I've built is a sophisticated app for a brewery to track and evaluate production and r&d. I've done my reading and have tried to incorporate what I understand to be good practices (good quality code, copious sprocs, udfs where appropriate, good security...) I am in the middle of porting much of the reporting part of the app to the web (an intranet) to make it more easily available to users. I have hired an outside consultant to help with much of it. He is not a db guy, so is most comfortable with opening connections as needed on an asp page, sending a query string over the network, etc. We argue constantly about many aspects of architecture, for example the use of sprocs (he doesn't see the need for them, doesn't understand their advantages, knows only that he can't see them) in spite of me trying to explain the advantages, some of which are not relevant to our situation (we are unlikely to suffer an sql injection attack). However I am of the opinion that forming good habits is essential, because sooner or later it will become important that something be done the 'right' way, and if it is a habit you won't have to stop and think about it. The real point of this message is: he described to me another project he is working on for a major state agency that will be web based. As he described it, each time a user opens the app there are 500 round trips across the server, each to fire a separate stored procedure or execute an sql string. Each time, for each user! This has been architected by people who at least locally (and I also suspect on a statewide level) have reputations for being expert, professional and experienced (oracle guys). I was stunned. So my questions are: I don't have experience with lots of different companies, or with meeting strict deadlines -- do I need to lighten up? I think some of the reasons for their approach was that they had time constraints (you know, never enough time to do it right...). I don't mean to start people off on rants (for or against). But should I be sticking to my guns? D. Lewis _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From my.lists at verizon.net Tue Jul 29 11:55:32 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 29 Jul 2003 09:55:32 -0700 Subject: [dba-SQLServer]Sproc runs and then it doesn't References: <003201c355ec$86690c20$b615010a@FHTAPIA> Message-ID: <005601c355f2$3cba1320$b615010a@FHTAPIA> perhaps I'm not reviewing the profiler correctly, but this is what I see from QA EXEC stp_004A_lstHelpDeskTESTCalls 'troy', 1 (this is the merged sproc from the previous 2) but the same execution from Access looks like this but also returns data in QA. exec sp_executesql N' EXEC "stp_004A_lstHelpDeskTESTCalls" @P1 , @P2 ', N'@P1 nvarchar(4), at P2 bit', N'troy', 1 Another step I tried... was to call the sproc via an ADO command and the recordset is populated as expected. SO, my conclusion is that ACCESS is trying to be tooo smart and is gumming up the process. Thanks for any other tips. -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 9:14 AM [GMT-8], Francisco H Tapia wrote: : That's right Billy, If unmodiffied Database / sprocs and Unmoddifed : Front End Access ADP return the data via Access and QA as expected at : home the machine is an AMD2000+ w/ 1gig of ram Win2k SP2 + ss2kdev SP3 : : WORK: Dual 800 Intel Xeon w/1gig of ram Win2kServer SP2 +ss2kserver : SP3 : : well I tried just as you suggested... and no dice :( the >= still : doesnt return via access : what do you mean Table Variables? : : Thanks : : -Francisco : http://rcm.netfirms.com : : On Tuesday, July 29, 2003 8:28 AM [GMT-8], : Billy Pang wrote: : :: so both sprocs work perfectly at home? :: :: Can you alter both sprocs so that it just does one simple select? if :: both sprocs work at the office, then alter the sproc again using the :: real code and see if it still works. :: :: also, are you running both sprocs concurrently? :: :: also, since you are using ss2k, how about replacing your temp tables :: with table variables? :: :: :: :: ::: From: "Francisco Tapia" ::: Reply-To: dba-sqlserver at databaseadvisors.com ::: To: ::: Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't ::: Date: Tue, 29 Jul 2003 02:05:33 -0700 ::: ::: Billy, ::: I took the adp, and the database home and updated my home sql ::: developer copy with the office copy of the server w/ no code changes ::: and off the cuff copy to my hdd from the office the adp now displays ::: the record, Sql Server 2000 SP3, but at the office it still does not ::: and it is the same version of the db, and access adp. ::: ::: this is most bazaar. ::: ::: ::: -Francisco ::: http://rcm.netfirms.com/ ::: ::: On Tuesday, July 29, 2003 12:36 AM [GMT -8], ::: Francisco Tapia wrote: ::: :::: I'm running it as windows authentication at the moment for both QA :::: and the ADP, doh I did not think to use the profiler, I will check :::: that next... :::: :::: -Francisco :::: http://rcm.netfirms.com/ :::: :::: On Monday, July 28, 2003 6:09 PM [GMT -8], :::: Billy Pang wrote: :::: ::::: Are you tried running both sprocs in QA using the security ::::: authentication as ADP (eg. same login)? ::::: also, does SQL Profiler reveal anything? ::::: ::::: ::::: ::::: ::::: :::::: From: "Francisco H Tapia" :::::: Reply-To: dba-sqlserver at databaseadvisors.com :::::: To: :::::: Subject: [dba-SQLServer]Sproc runs and then it doesn't :::::: Date: Mon, 28 Jul 2003 16:01:33 -0700 :::::: :::::: I have a stored procedure in my database that runs fine in QA. :::::: In fact I created 2 versions of this sproc and both of them run :::::: fine :::::: in QA. In an ADP :::::: that I have one sproc runs and the other does not. What would be :::::: different? :::::: :::::: In the where clause I am checking for >= or <. :::::: :::::: The code is "I D E N T I C A L" in both sprocs lets call them :::::: stp_New and stp_Old the new checks for any new entries since :::::: today 12:00am, and the Old :::::: checks for any records older than today at 12:00am. :::::: :::::: If I run the sproc in Access (ADP) it does not give me any data :::::: for stp_New but it does give me the correct results for stp_Old. :::::: If I :::::: go to QA I can run either sproc and they both execute correctly. :::::: I :::::: am at a loss about this :::::: one... anyone ever run into something similar? :::::: :::::: This is my code... :::::: :::::: ::: ------------------------------------------------------------------------ ::: - :::::: --- :::::: ---------------------------- :::::: ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls (@LoginID :::::: NVARCHAR(50)) AS :::::: :::::: SET NOCOUNT ON :::::: Declare @SetDateTime as datetime, @entryUser as uniqueidentifier :::::: SET @entryUser = dbo.udfEntryUSER(@LoginID) :::::: SET @SetDateTime = CAST ( :::::: CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + :::::: CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + :::::: CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' :::::: 00:00:00' AS DATETIME) :::::: :::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::: object_id(N'tempdb..#MaxStatus')) BEGIN :::::: DROP TABLE #MaxStatus :::::: END :::::: CREATE TABLE #MaxStatus :::::: ([HelpDeskID] [UniqueIdentifier] Not Null, :::::: [HelpStatusID] [int] Not Null, :::::: [entryTime] [dateTIME] Not Null) :::::: INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) :::::: Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM :::::: dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) :::::: LEFT OUTER JOIN :::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From :::::: dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B :::::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME :::::: AND HelpStatusID < 2) :::::: :::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN :::::: DROP TABLE #HelpDeskCallDetails :::::: END :::::: CREATE TABLE #HelpDeskCallDetails :::::: ([HelpDeskID] [uniqueidentifier] Not Null, :::::: [CallNotes] [nvarchar](20) Null, :::::: [ContactAddrID] [uniqueidentifier] Null, :::::: [entryTIME] [datetime] Null, :::::: [entryUSER] [uniqueidentifier] Null) :::::: :::::: INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, :::::: ContactAddrID, entryTIME, entryUSER) :::::: Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, :::::: A.entryTIME, :::::: A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) :::::: INNER JOIN :::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From :::::: dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) AS :::::: B ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME :::::: ) :::::: :::::: :::::: :::::: Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, :::::: Addr.LocationName,ZipList.State, :::::: HelpDeskCallDetails.CallNotes AS [Call Notes], :::::: HelpDeskCallDetails.entryTIME :::::: FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN dbo.tbl_Machine :::::: M WITH(NOLOCK) ON HD.MachineID = M.MachineID :::::: :::::: LEFT OUTER JOIN :::::: (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus :::::: ON HD.HelpDeskID = MaxStatus.HelpDeskID :::::: :::::: INNER JOIN :::::: (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS :::::: HelpDeskCallDetails :::::: ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID :::::: :::::: LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr WITH(NOLOCK) :::::: ON HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID :::::: LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON :::::: CtcAddr.ContactID :::::: = Ctc.ContactID :::::: LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON :::::: CtcAddr.AddrID = Addr.AddrID :::::: LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON :::::: Addr.CompanyID = Co.CompanyID :::::: LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) ON :::::: Addr.ZipID :::::: = ZipList.ZipID :::::: :::::: --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, :::::: but only the :::::: OLD (<) runs in Access :::::: :::::: Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND :::::: HelpDeskCallDetails.entryUSER = @entryUser :::::: :::::: ORDER BY HelpDeskCallDetails.entryTIME ASC :::::: :::::: :::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::: object_id(N'tempdb..#MaxStatus')) BEGIN :::::: DROP TABLE #MaxStatus :::::: END :::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN :::::: DROP TABLE #HelpDeskCallDetails :::::: END :::::: :::::: SET NOCOUNT OFF :::::: :::::: :::::: -Francisco :::::: http://rcm.netfirms.com : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From subs at solution-providers.ie Tue Jul 29 12:21:19 2003 From: subs at solution-providers.ie (Mark L. Breen) Date: Tue, 29 Jul 2003 18:21:19 +0100 Subject: [dba-SQLServer]Architecture/how to do it advice References: <229F7C29573CC4479A3313CC55B096541BC96E@pale.sierranevada.corp> Message-ID: <000001c355f6$66786d70$6a1118ac@D8TZHN0J> Hello David, I would agree with you entirely. It is a mindset firstly, if you do not have that mindset, you have trouble up ahead. Secondly, that is what sprocs are for, Thirdly, they probably could combine some of the sproc calls into lesser return journeys which is better. Fourth, what happens when the app builds up the volumes of data, it may be OK now. Fifth, if you let them away with it now, they start using cursors and all sorts or other things, Best aim for it to be right at the start at least. Then when it goes wrong, at least you are starting from a good position. Finally, the so called experts must either have some really good reason to develop their system that way, or else they are not experts. Keep your nerve, you may be surprised how much you do know, Mark ----- Original Message ----- From: "David Lewis" To: Sent: Tuesday, July 29, 2003 4:49 PM Subject: [dba-SQLServer]Architecture/how to do it advice > > This seems to be a good collection of people with wide experience, so I'd > like to ask a strategy type question. I don't have any certifications, but > am reasonably experienced in vb, access and now sql server 2000. Nothing on > too large a scale, but what I've built is a sophisticated app for a brewery > to track and evaluate production and r&d. I've done my reading and have > tried to incorporate what I understand to be good practices (good quality > code, copious sprocs, udfs where appropriate, good security...) > > I am in the middle of porting much of the reporting part of the app to the > web (an intranet) to make it more easily available to users. I have hired > an outside consultant to help with much of it. He is not a db guy, so is > most comfortable with opening connections as needed on an asp page, sending > a query string over the network, etc. We argue constantly about many > aspects of architecture, for example the use of sprocs (he doesn't see the > need for them, doesn't understand their advantages, knows only that he can't > see them) in spite of me trying to explain the advantages, some of which are > not relevant to our situation (we are unlikely to suffer an sql injection > attack). However I am of the opinion that forming good habits is essential, > because sooner or later it will become important that something be done the > 'right' way, and if it is a habit you won't have to stop and think about it. > > The real point of this message is: he described to me another project he is > working on for a major state agency that will be web based. As he described > it, each time a user opens the app there are 500 round trips across the > server, each to fire a separate stored procedure or execute an sql string. > Each time, for each user! This has been architected by people who at least > locally (and I also suspect on a statewide level) have reputations for being > expert, professional and experienced (oracle guys). I was stunned. So my > questions are: I don't have experience with lots of different companies, or > with meeting strict deadlines -- do I need to lighten up? I think some of > the reasons for their approach was that they had time constraints (you know, > never enough time to do it right...). > > I don't mean to start people off on rants (for or against). But should I be > sticking to my guns? D. Lewis > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From tuxedo_man at hotmail.com Tue Jul 29 12:26:10 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Tue, 29 Jul 2003 17:26:10 +0000 Subject: [dba-SQLServer]Sproc runs and then it doesn't Message-ID: There are a lot of temp tables in the sprocs you are trying to running. You can convert them into table variables. They work just like regular temporary tables except that it is not written onto disk. look up data type - table in BOL. ==cut here =========================== SET NOCOUNT ON DECLARE @my_product TABLE(PROD_ID INT IDENTITY(1,1) PRIMARY KEY, PROD_NAME VARCHAR(50), PROD_DATE SMALLDATETIME DEFAULT(GETDATE())) INSERT INTO @my_product(PROD_NAME) VALUES('red book'); INSERT INTO @my_product(PROD_NAME) VALUES('blue book'); INSERT INTO @my_product(PROD_NAME) VALUES('green book'); INSERT INTO @my_product(PROD_NAME) VALUES('white book'); UPDATE @my_product SET PROD_NAME = 'BLUE BOOK1' WHERE PROD_ID = 2 DELETE FROM @my_product where PROD_ID = 3 SELECT * FROM @my_product SET NOCOUNT OFF ============================= >From: "Francisco H Tapia" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't >Date: Tue, 29 Jul 2003 09:14:44 -0700 > >That's right Billy, If unmodiffied Database / sprocs and Unmoddifed Front >End Access ADP return the data via Access and QA as expected at home the >machine is an AMD2000+ w/ 1gig of ram Win2k SP2 + ss2kdev SP3 > >WORK: Dual 800 Intel Xeon w/1gig of ram Win2kServer SP2 +ss2kserver SP3 > >well I tried just as you suggested... and no dice :( the >= still doesnt >return via access >what do you mean Table Variables? > >Thanks > >-Francisco >http://rcm.netfirms.com > >On Tuesday, July 29, 2003 8:28 AM [GMT-8], >Billy Pang wrote: > >: so both sprocs work perfectly at home? >: >: Can you alter both sprocs so that it just does one simple select? if >: both sprocs work at the office, then alter the sproc again using the >: real code and see if it still works. >: >: also, are you running both sprocs concurrently? >: >: also, since you are using ss2k, how about replacing your temp tables >: with table variables? >: >: >: >: >:: From: "Francisco Tapia" >:: Reply-To: dba-sqlserver at databaseadvisors.com >:: To: >:: Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't >:: Date: Tue, 29 Jul 2003 02:05:33 -0700 >:: >:: Billy, >:: I took the adp, and the database home and updated my home sql >:: developer copy with the office copy of the server w/ no code changes >:: and off the cuff copy to my hdd from the office the adp now displays >:: the record, Sql Server 2000 SP3, but at the office it still does not >:: and it is the same version of the db, and access adp. >:: >:: this is most bazaar. >:: >:: >:: -Francisco >:: http://rcm.netfirms.com/ >:: >:: On Tuesday, July 29, 2003 12:36 AM [GMT -8], >:: Francisco Tapia wrote: >:: >::: I'm running it as windows authentication at the moment for both QA >::: and the ADP, doh I did not think to use the profiler, I will check >::: that next... >::: >::: -Francisco >::: http://rcm.netfirms.com/ >::: >::: On Monday, July 28, 2003 6:09 PM [GMT -8], >::: Billy Pang wrote: >::: >:::: Are you tried running both sprocs in QA using the security >:::: authentication as ADP (eg. same login)? >:::: also, does SQL Profiler reveal anything? >:::: >:::: >:::: >:::: >:::: >::::: From: "Francisco H Tapia" >::::: Reply-To: dba-sqlserver at databaseadvisors.com >::::: To: >::::: Subject: [dba-SQLServer]Sproc runs and then it doesn't >::::: Date: Mon, 28 Jul 2003 16:01:33 -0700 >::::: >::::: I have a stored procedure in my database that runs fine in QA. In >::::: fact I created 2 versions of this sproc and both of them run fine >::::: in QA. In an ADP >::::: that I have one sproc runs and the other does not. What would be >::::: different? >::::: >::::: In the where clause I am checking for >= or <. >::::: >::::: The code is "I D E N T I C A L" in both sprocs lets call them >::::: stp_New and stp_Old the new checks for any new entries since >::::: today 12:00am, and the Old >::::: checks for any records older than today at 12:00am. >::::: >::::: If I run the sproc in Access (ADP) it does not give me any data >::::: for stp_New but it does give me the correct results for stp_Old. >::::: If I >::::: go to QA I can run either sproc and they both execute correctly. >::::: I >::::: am at a loss about this >::::: one... anyone ever run into something similar? >::::: >::::: This is my code... >::::: >::::: >:: ------------------------------------------------------------------------ >:: - >::::: --- >::::: ---------------------------- >::::: ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls (@LoginID >::::: NVARCHAR(50)) AS >::::: >::::: SET NOCOUNT ON >::::: Declare @SetDateTime as datetime, @entryUser as uniqueidentifier >::::: SET @entryUser = dbo.udfEntryUSER(@LoginID) >::::: SET @SetDateTime = CAST ( >::::: CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + >::::: CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + >::::: CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' >::::: 00:00:00' AS DATETIME) >::::: >::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = >::::: object_id(N'tempdb..#MaxStatus')) BEGIN >::::: DROP TABLE #MaxStatus >::::: END >::::: CREATE TABLE #MaxStatus >::::: ([HelpDeskID] [UniqueIdentifier] Not Null, >::::: [HelpStatusID] [int] Not Null, >::::: [entryTime] [dateTIME] Not Null) >::::: INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) >::::: Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM >::::: dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) >::::: LEFT OUTER JOIN >::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From >::::: dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B >::::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME >::::: AND HelpStatusID < 2) >::::: >::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = >::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN >::::: DROP TABLE #HelpDeskCallDetails >::::: END >::::: CREATE TABLE #HelpDeskCallDetails >::::: ([HelpDeskID] [uniqueidentifier] Not Null, >::::: [CallNotes] [nvarchar](20) Null, >::::: [ContactAddrID] [uniqueidentifier] Null, >::::: [entryTIME] [datetime] Null, >::::: [entryUSER] [uniqueidentifier] Null) >::::: >::::: INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, >::::: ContactAddrID, entryTIME, entryUSER) >::::: Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, >::::: A.entryTIME, >::::: A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) >::::: INNER JOIN >::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From >::::: dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) AS >::::: B ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME >::::: ) >::::: >::::: >::::: >::::: Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, >::::: Addr.LocationName,ZipList.State, >::::: HelpDeskCallDetails.CallNotes AS [Call Notes], >::::: HelpDeskCallDetails.entryTIME >::::: FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN dbo.tbl_Machine M >::::: WITH(NOLOCK) ON HD.MachineID = M.MachineID >::::: >::::: LEFT OUTER JOIN >::::: (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus >::::: ON HD.HelpDeskID = MaxStatus.HelpDeskID >::::: >::::: INNER JOIN >::::: (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS >::::: HelpDeskCallDetails >::::: ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID >::::: >::::: LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr WITH(NOLOCK) >::::: ON HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID >::::: LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON >::::: CtcAddr.ContactID >::::: = Ctc.ContactID >::::: LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON >::::: CtcAddr.AddrID = Addr.AddrID >::::: LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON >::::: Addr.CompanyID = Co.CompanyID >::::: LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) ON >::::: Addr.ZipID >::::: = ZipList.ZipID >::::: >::::: --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, >::::: but only the >::::: OLD (<) runs in Access >::::: >::::: Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND >::::: HelpDeskCallDetails.entryUSER = @entryUser >::::: >::::: ORDER BY HelpDeskCallDetails.entryTIME ASC >::::: >::::: >::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = >::::: object_id(N'tempdb..#MaxStatus')) BEGIN >::::: DROP TABLE #MaxStatus >::::: END >::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = >::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN >::::: DROP TABLE #HelpDeskCallDetails >::::: END >::::: >::::: SET NOCOUNT OFF >::::: >::::: >::::: -Francisco >::::: http://rcm.netfirms.com > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From my.lists at verizon.net Tue Jul 29 13:12:00 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 29 Jul 2003 11:12:00 -0700 Subject: [dba-SQLServer]Sproc runs and then it doesn't References: Message-ID: <008d01c355fc$e833e320$b615010a@FHTAPIA> Thanks Billy, that seems to have sped up the sproc from a runtime of 13seconds down to 8-7 seconds nice... tested on a fellow developer's pc, I was running Access 2k out of the box and at work I have Access2k sr1, the other developer has Access2k sr1 loaded at home and it ran well there too. so there is some other problem locally at work that breaks this. -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 10:26 AM [GMT-8], Billy Pang wrote: : There are a lot of temp tables in the sprocs you are trying to : running. You can convert them into table variables. They work just : like regular temporary tables except that it is not written onto disk. : : look up data type - table in BOL. : : ==cut here =========================== : SET NOCOUNT ON : DECLARE @my_product TABLE(PROD_ID INT IDENTITY(1,1) PRIMARY KEY, : PROD_NAME VARCHAR(50), PROD_DATE SMALLDATETIME DEFAULT(GETDATE())) : : INSERT INTO @my_product(PROD_NAME) VALUES('red book'); : INSERT INTO @my_product(PROD_NAME) VALUES('blue book'); : INSERT INTO @my_product(PROD_NAME) VALUES('green book'); : INSERT INTO @my_product(PROD_NAME) VALUES('white book'); : : UPDATE @my_product SET PROD_NAME = 'BLUE BOOK1' WHERE PROD_ID = 2 : DELETE FROM @my_product where PROD_ID = 3 : SELECT * FROM @my_product : : SET NOCOUNT OFF : ============================= : : :: From: "Francisco H Tapia" :: Reply-To: dba-sqlserver at databaseadvisors.com :: To: :: Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't :: Date: Tue, 29 Jul 2003 09:14:44 -0700 :: :: That's right Billy, If unmodiffied Database / sprocs and Unmoddifed :: Front End Access ADP return the data via Access and QA as expected :: at home the machine is an AMD2000+ w/ 1gig of ram Win2k SP2 + :: ss2kdev SP3 :: :: WORK: Dual 800 Intel Xeon w/1gig of ram Win2kServer SP2 +ss2kserver :: SP3 :: :: well I tried just as you suggested... and no dice :( the >= still :: doesnt return via access :: what do you mean Table Variables? :: :: Thanks :: :: -Francisco :: http://rcm.netfirms.com :: :: On Tuesday, July 29, 2003 8:28 AM [GMT-8], :: Billy Pang wrote: :: ::: so both sprocs work perfectly at home? ::: ::: Can you alter both sprocs so that it just does one simple select? ::: if both sprocs work at the office, then alter the sproc again using ::: the real code and see if it still works. ::: ::: also, are you running both sprocs concurrently? ::: ::: also, since you are using ss2k, how about replacing your temp tables ::: with table variables? ::: ::: ::: ::: :::: From: "Francisco Tapia" :::: Reply-To: dba-sqlserver at databaseadvisors.com :::: To: :::: Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't :::: Date: Tue, 29 Jul 2003 02:05:33 -0700 :::: :::: Billy, :::: I took the adp, and the database home and updated my home sql :::: developer copy with the office copy of the server w/ no code :::: changes and off the cuff copy to my hdd from the office the adp :::: now displays the record, Sql Server 2000 SP3, but at the office it :::: still does not and it is the same version of the db, and access :::: adp. :::: :::: this is most bazaar. :::: :::: :::: -Francisco :::: http://rcm.netfirms.com/ :::: :::: On Tuesday, July 29, 2003 12:36 AM [GMT -8], :::: Francisco Tapia wrote: :::: ::::: I'm running it as windows authentication at the moment for both QA ::::: and the ADP, doh I did not think to use the profiler, I will check ::::: that next... ::::: ::::: -Francisco ::::: http://rcm.netfirms.com/ ::::: ::::: On Monday, July 28, 2003 6:09 PM [GMT -8], ::::: Billy Pang wrote: ::::: :::::: Are you tried running both sprocs in QA using the security :::::: authentication as ADP (eg. same login)? :::::: also, does SQL Profiler reveal anything? :::::: :::::: :::::: :::::: :::::: ::::::: From: "Francisco H Tapia" ::::::: Reply-To: dba-sqlserver at databaseadvisors.com ::::::: To: ::::::: Subject: [dba-SQLServer]Sproc runs and then it doesn't ::::::: Date: Mon, 28 Jul 2003 16:01:33 -0700 ::::::: ::::::: I have a stored procedure in my database that runs fine in QA. ::::::: In fact I created 2 versions of this sproc and both of them run ::::::: fine ::::::: in QA. In an ADP ::::::: that I have one sproc runs and the other does not. What would ::::::: be different? ::::::: ::::::: In the where clause I am checking for >= or <. ::::::: ::::::: The code is "I D E N T I C A L" in both sprocs lets call them ::::::: stp_New and stp_Old the new checks for any new entries since ::::::: today 12:00am, and the Old ::::::: checks for any records older than today at 12:00am. ::::::: ::::::: If I run the sproc in Access (ADP) it does not give me any data ::::::: for stp_New but it does give me the correct results for stp_Old. ::::::: If I ::::::: go to QA I can run either sproc and they both execute correctly. ::::::: I ::::::: am at a loss about this ::::::: one... anyone ever run into something similar? ::::::: ::::::: This is my code... ::::::: ::::::: :::: ----------------------------------------------------------------------- - :::: - ::::::: --- ::::::: ---------------------------- ::::::: ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls ::::::: (@LoginID NVARCHAR(50)) AS ::::::: ::::::: SET NOCOUNT ON ::::::: Declare @SetDateTime as datetime, @entryUser as uniqueidentifier ::::::: SET @entryUser = dbo.udfEntryUSER(@LoginID) ::::::: SET @SetDateTime = CAST ( ::::::: CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + ::::::: CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + ::::::: CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' ::::::: 00:00:00' AS DATETIME) ::::::: ::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::::::: object_id(N'tempdb..#MaxStatus')) BEGIN ::::::: DROP TABLE #MaxStatus ::::::: END ::::::: CREATE TABLE #MaxStatus ::::::: ([HelpDeskID] [UniqueIdentifier] Not Null, ::::::: [HelpStatusID] [int] Not Null, ::::::: [entryTime] [dateTIME] Not Null) ::::::: INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) ::::::: Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM ::::::: dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) ::::::: LEFT OUTER JOIN ::::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From ::::::: dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B ::::::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME ::::::: AND HelpStatusID < 2) ::::::: ::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN ::::::: DROP TABLE #HelpDeskCallDetails ::::::: END ::::::: CREATE TABLE #HelpDeskCallDetails ::::::: ([HelpDeskID] [uniqueidentifier] Not Null, ::::::: [CallNotes] [nvarchar](20) Null, ::::::: [ContactAddrID] [uniqueidentifier] Null, ::::::: [entryTIME] [datetime] Null, ::::::: [entryUSER] [uniqueidentifier] Null) ::::::: ::::::: INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, ::::::: ContactAddrID, entryTIME, entryUSER) ::::::: Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, ::::::: A.entryTIME, ::::::: A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) ::::::: INNER JOIN ::::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From ::::::: dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) ::::::: AS B ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = ::::::: B.entryTIME ) ::::::: ::::::: ::::::: ::::::: Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, ::::::: Addr.LocationName,ZipList.State, ::::::: HelpDeskCallDetails.CallNotes AS [Call Notes], ::::::: HelpDeskCallDetails.entryTIME ::::::: FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN ::::::: dbo.tbl_Machine M WITH(NOLOCK) ON HD.MachineID = M.MachineID ::::::: ::::::: LEFT OUTER JOIN ::::::: (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus ::::::: ON HD.HelpDeskID = MaxStatus.HelpDeskID ::::::: ::::::: INNER JOIN ::::::: (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS ::::::: HelpDeskCallDetails ::::::: ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID ::::::: ::::::: LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr WITH(NOLOCK) ::::::: ON HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID ::::::: LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON ::::::: CtcAddr.ContactID ::::::: = Ctc.ContactID ::::::: LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON ::::::: CtcAddr.AddrID = Addr.AddrID ::::::: LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON ::::::: Addr.CompanyID = Co.CompanyID ::::::: LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) ON ::::::: Addr.ZipID ::::::: = ZipList.ZipID ::::::: ::::::: --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, ::::::: but only the ::::::: OLD (<) runs in Access ::::::: ::::::: Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND ::::::: HelpDeskCallDetails.entryUSER = @entryUser ::::::: ::::::: ORDER BY HelpDeskCallDetails.entryTIME ASC ::::::: ::::::: ::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::::::: object_id(N'tempdb..#MaxStatus')) BEGIN ::::::: DROP TABLE #MaxStatus ::::::: END ::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = ::::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN ::::::: DROP TABLE #HelpDeskCallDetails ::::::: END ::::::: ::::::: SET NOCOUNT OFF ::::::: ::::::: ::::::: -Francisco ::::::: http://rcm.netfirms.com :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com :: : : _________________________________________________________________ : The new MSN 8: smart spam protection and 2 months FREE* : http://join.msn.com/?page=features/junkmail : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From MPorter at acsalaska.com Tue Jul 29 13:24:51 2003 From: MPorter at acsalaska.com (Porter, Mark) Date: Tue, 29 Jul 2003 10:24:51 -0800 Subject: [dba-SQLServer]Architecture/how to do it advice Message-ID: I've noticed that some contractors can be very short sighted. They are there for a specific job, care only for that specific job, and do not take the long term goals of the company at heart. They can be very good at what they do, but tend to do it using their own methodologies. There are many ways to architect software, and standards exist to keep everyone in the organization on the same page. If the software they create is to be maintained by your organization, it has to be made to your standards. Mark -----Original Message----- From: Mark L. Breen [mailto:subs at solution-providers.ie] Sent: Tuesday, July 29, 2003 9:21 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Architecture/how to do it advice Hello David, I would agree with you entirely. It is a mindset firstly, if you do not have that mindset, you have trouble up ahead. Secondly, that is what sprocs are for, Thirdly, they probably could combine some of the sproc calls into lesser return journeys which is better. Fourth, what happens when the app builds up the volumes of data, it may be OK now. Fifth, if you let them away with it now, they start using cursors and all sorts or other things, Best aim for it to be right at the start at least. Then when it goes wrong, at least you are starting from a good position. Finally, the so called experts must either have some really good reason to develop their system that way, or else they are not experts. Keep your nerve, you may be surprised how much you do know, Mark ----- Original Message ----- From: "David Lewis" To: Sent: Tuesday, July 29, 2003 4:49 PM Subject: [dba-SQLServer]Architecture/how to do it advice > > This seems to be a good collection of people with wide experience, so I'd > like to ask a strategy type question. I don't have any certifications, but > am reasonably experienced in vb, access and now sql server 2000. Nothing on > too large a scale, but what I've built is a sophisticated app for a brewery > to track and evaluate production and r&d. I've done my reading and have > tried to incorporate what I understand to be good practices (good quality > code, copious sprocs, udfs where appropriate, good security...) > > I am in the middle of porting much of the reporting part of the app to the > web (an intranet) to make it more easily available to users. I have hired > an outside consultant to help with much of it. He is not a db guy, so is > most comfortable with opening connections as needed on an asp page, sending > a query string over the network, etc. We argue constantly about many > aspects of architecture, for example the use of sprocs (he doesn't see the > need for them, doesn't understand their advantages, knows only that he can't > see them) in spite of me trying to explain the advantages, some of which are > not relevant to our situation (we are unlikely to suffer an sql injection > attack). However I am of the opinion that forming good habits is essential, > because sooner or later it will become important that something be done the > 'right' way, and if it is a habit you won't have to stop and think about it. > > The real point of this message is: he described to me another project he is > working on for a major state agency that will be web based. As he described > it, each time a user opens the app there are 500 round trips across the > server, each to fire a separate stored procedure or execute an sql string. > Each time, for each user! This has been architected by people who at least > locally (and I also suspect on a statewide level) have reputations for being > expert, professional and experienced (oracle guys). I was stunned. So my > questions are: I don't have experience with lots of different companies, or > with meeting strict deadlines -- do I need to lighten up? I think some of > the reasons for their approach was that they had time constraints (you know, > never enough time to do it right...). > > I don't mean to start people off on rants (for or against). But should I be > sticking to my guns? D. Lewis > > _______________________________________________ > 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 transmittal may contain confidential information intended solely for the addressee. If you are not the intended recipient, you are hereby notified that you have received this transmittal in error; any review, dissemination, distribution or copying of this transmittal is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (collect at 907-564-1000) and ask to speak with the message sender. In addition, please immediately delete this message and all attachments. Thank you. From CWortz at tea.state.tx.us Tue Jul 29 13:41:13 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Tue, 29 Jul 2003 13:41:13 -0500 Subject: [dba-SQLServer]Architecture/how to do it advice Message-ID: Mark, You said "There are many ways to architect software, and standards exist to keep everyone in the organization on the same page. If the software they create is to be maintained by your organization, it has to be made to your standards." Truer words were never spoken. I've worked at some places that had no software standards and trying to clean up the messes left by contractors/former employees was no fun. I remember one example where it took me two weeks to figure out what a seven page procedure did. It was easy to see the procedure had been patched at least three different times by three different people that used different naming and coding styles, all different from the original. Several of the patches duplicated work of the original probably because the patcher couldn't figure out where or how the existing code did it. Charles Wortz Software Development Division Texas Education Agency 1701 N. Congress Ave Austin, TX 78701-1494 512-463-9493 CWortz at tea.state.tx.us -----Original Message----- From: Porter, Mark [mailto:MPorter at acsalaska.com] Sent: Tuesday 2003 Jul 29 13:25 To: 'dba-sqlserver at databaseadvisors.com' Subject: RE: [dba-SQLServer]Architecture/how to do it advice I've noticed that some contractors can be very short sighted. They are there for a specific job, care only for that specific job, and do not take the long term goals of the company at heart. They can be very good at what they do, but tend to do it using their own methodologies. There are many ways to architect software, and standards exist to keep everyone in the organization on the same page. If the software they create is to be maintained by your organization, it has to be made to your standards. Mark -----Original Message----- From: Mark L. Breen [mailto:subs at solution-providers.ie] Sent: Tuesday, July 29, 2003 9:21 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Architecture/how to do it advice Hello David, I would agree with you entirely. It is a mindset firstly, if you do not have that mindset, you have trouble up ahead. Secondly, that is what sprocs are for, Thirdly, they probably could combine some of the sproc calls into lesser return journeys which is better. Fourth, what happens when the app builds up the volumes of data, it may be OK now. Fifth, if you let them away with it now, they start using cursors and all sorts or other things, Best aim for it to be right at the start at least. Then when it goes wrong, at least you are starting from a good position. Finally, the so called experts must either have some really good reason to develop their system that way, or else they are not experts. Keep your nerve, you may be surprised how much you do know, Mark From my.lists at verizon.net Tue Jul 29 13:54:45 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 29 Jul 2003 11:54:45 -0700 Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't References: <008d01c355fc$e833e320$b615010a@FHTAPIA> Message-ID: <00a401c35602$e1897070$b615010a@FHTAPIA> My co-worker found an option in Access for the amount of records to limit the return to, in Access it is defaulted to 10k, for my home version it is set to this limit as well as here at work, but at home the results are as expected, at work I had to modify this result to > 10,000 records, I chose as a test 100,000,000 which yields the correct results. boy do I hate Access sometimes... /RANT/ Now if the resulting records are limited to the 10k, why on earth would it be blocking the 1 returned record (this is a test of course but in normal everyday results it would return anywhere between 20 - 100 records for new entries. Access is trying to be way too smart for it's own good... I know I could avoid this headache and do it all VB but I do like the simple things in access for speedy RAD, Listbox population, automatic handling of cbo's for auto search select when you type into the box. OpenArguments... well thanks for the vent. /end RANT/ -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 11:12 AM [GMT-8], Francisco H Tapia wrote: : Thanks Billy, : that seems to have sped up the sproc from a runtime of 13seconds : down to 8-7 seconds nice... tested on a fellow developer's pc, I was : running Access 2k out of the box and at work I have Access2k sr1, the : other developer has Access2k sr1 loaded at home and it ran well there : too. : : so there is some other problem locally at work that breaks this. : : : -Francisco : http://rcm.netfirms.com : : On Tuesday, July 29, 2003 10:26 AM [GMT-8], : Billy Pang wrote: : :: There are a lot of temp tables in the sprocs you are trying to :: running. You can convert them into table variables. They work just :: like regular temporary tables except that it is not written onto :: disk. :: :: look up data type - table in BOL. :: :: ==cut here =========================== :: SET NOCOUNT ON :: DECLARE @my_product TABLE(PROD_ID INT IDENTITY(1,1) PRIMARY KEY, :: PROD_NAME VARCHAR(50), PROD_DATE SMALLDATETIME DEFAULT(GETDATE())) :: :: INSERT INTO @my_product(PROD_NAME) VALUES('red book'); :: INSERT INTO @my_product(PROD_NAME) VALUES('blue book'); :: INSERT INTO @my_product(PROD_NAME) VALUES('green book'); :: INSERT INTO @my_product(PROD_NAME) VALUES('white book'); :: :: UPDATE @my_product SET PROD_NAME = 'BLUE BOOK1' WHERE PROD_ID = 2 :: DELETE FROM @my_product where PROD_ID = 3 :: SELECT * FROM @my_product :: :: SET NOCOUNT OFF :: ============================= :: :: ::: From: "Francisco H Tapia" ::: Reply-To: dba-sqlserver at databaseadvisors.com ::: To: ::: Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't ::: Date: Tue, 29 Jul 2003 09:14:44 -0700 ::: ::: That's right Billy, If unmodiffied Database / sprocs and Unmoddifed ::: Front End Access ADP return the data via Access and QA as expected ::: at home the machine is an AMD2000+ w/ 1gig of ram Win2k SP2 + ::: ss2kdev SP3 ::: ::: WORK: Dual 800 Intel Xeon w/1gig of ram Win2kServer SP2 +ss2kserver ::: SP3 ::: ::: well I tried just as you suggested... and no dice :( the >= still ::: doesnt return via access ::: what do you mean Table Variables? ::: ::: Thanks ::: ::: -Francisco ::: http://rcm.netfirms.com ::: ::: On Tuesday, July 29, 2003 8:28 AM [GMT-8], ::: Billy Pang wrote: ::: :::: so both sprocs work perfectly at home? :::: :::: Can you alter both sprocs so that it just does one simple select? :::: if both sprocs work at the office, then alter the sproc again using :::: the real code and see if it still works. :::: :::: also, are you running both sprocs concurrently? :::: :::: also, since you are using ss2k, how about replacing your temp :::: tables with table variables? :::: :::: :::: :::: ::::: From: "Francisco Tapia" ::::: Reply-To: dba-sqlserver at databaseadvisors.com ::::: To: ::::: Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't ::::: Date: Tue, 29 Jul 2003 02:05:33 -0700 ::::: ::::: Billy, ::::: I took the adp, and the database home and updated my home sql ::::: developer copy with the office copy of the server w/ no code ::::: changes and off the cuff copy to my hdd from the office the adp ::::: now displays the record, Sql Server 2000 SP3, but at the office it ::::: still does not and it is the same version of the db, and access ::::: adp. ::::: ::::: this is most bazaar. ::::: ::::: ::::: -Francisco ::::: http://rcm.netfirms.com/ ::::: ::::: On Tuesday, July 29, 2003 12:36 AM [GMT -8], ::::: Francisco Tapia wrote: ::::: :::::: I'm running it as windows authentication at the moment for both :::::: QA and the ADP, doh I did not think to use the profiler, I will :::::: check that next... :::::: :::::: -Francisco :::::: http://rcm.netfirms.com/ :::::: :::::: On Monday, July 28, 2003 6:09 PM [GMT -8], :::::: Billy Pang wrote: :::::: ::::::: Are you tried running both sprocs in QA using the security ::::::: authentication as ADP (eg. same login)? ::::::: also, does SQL Profiler reveal anything? ::::::: ::::::: ::::::: ::::::: ::::::: :::::::: From: "Francisco H Tapia" :::::::: Reply-To: dba-sqlserver at databaseadvisors.com :::::::: To: :::::::: Subject: [dba-SQLServer]Sproc runs and then it doesn't :::::::: Date: Mon, 28 Jul 2003 16:01:33 -0700 :::::::: :::::::: I have a stored procedure in my database that runs fine in QA. :::::::: In fact I created 2 versions of this sproc and both of them run :::::::: fine :::::::: in QA. In an ADP :::::::: that I have one sproc runs and the other does not. What would :::::::: be different? :::::::: :::::::: In the where clause I am checking for >= or <. :::::::: :::::::: The code is "I D E N T I C A L" in both sprocs lets call them :::::::: stp_New and stp_Old the new checks for any new entries since :::::::: today 12:00am, and the Old :::::::: checks for any records older than today at 12:00am. :::::::: :::::::: If I run the sproc in Access (ADP) it does not give me any data :::::::: for stp_New but it does give me the correct results for :::::::: stp_Old. :::::::: If I :::::::: go to QA I can run either sproc and they both execute :::::::: correctly. :::::::: I :::::::: am at a loss about this :::::::: one... anyone ever run into something similar? :::::::: :::::::: This is my code... :::::::: :::::::: ::::: ---------------------------------------------------------------------- - ::::: - - :::::::: --- :::::::: ---------------------------- :::::::: ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls :::::::: (@LoginID NVARCHAR(50)) AS :::::::: :::::::: SET NOCOUNT ON :::::::: Declare @SetDateTime as datetime, @entryUser as :::::::: uniqueidentifier SET @entryUser = dbo.udfEntryUSER(@LoginID) :::::::: SET @SetDateTime = CAST ( :::::::: CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + :::::::: CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + :::::::: CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' :::::::: 00:00:00' AS DATETIME) :::::::: :::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::::: object_id(N'tempdb..#MaxStatus')) BEGIN :::::::: DROP TABLE #MaxStatus :::::::: END :::::::: CREATE TABLE #MaxStatus :::::::: ([HelpDeskID] [UniqueIdentifier] Not Null, :::::::: [HelpStatusID] [int] Not Null, :::::::: [entryTime] [dateTIME] Not Null) :::::::: INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) :::::::: Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM :::::::: dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) :::::::: LEFT OUTER JOIN :::::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From :::::::: dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B :::::::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME :::::::: AND HelpStatusID < 2) :::::::: :::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN :::::::: DROP TABLE #HelpDeskCallDetails :::::::: END :::::::: CREATE TABLE #HelpDeskCallDetails :::::::: ([HelpDeskID] [uniqueidentifier] Not Null, :::::::: [CallNotes] [nvarchar](20) Null, :::::::: [ContactAddrID] [uniqueidentifier] Null, :::::::: [entryTIME] [datetime] Null, :::::::: [entryUSER] [uniqueidentifier] Null) :::::::: :::::::: INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, :::::::: ContactAddrID, entryTIME, entryUSER) :::::::: Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, :::::::: A.entryTIME, :::::::: A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) :::::::: INNER JOIN :::::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From :::::::: dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) :::::::: AS B ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = :::::::: B.entryTIME ) :::::::: :::::::: :::::::: :::::::: Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, :::::::: Addr.LocationName,ZipList.State, :::::::: HelpDeskCallDetails.CallNotes AS [Call Notes], :::::::: HelpDeskCallDetails.entryTIME :::::::: FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN :::::::: dbo.tbl_Machine M WITH(NOLOCK) ON HD.MachineID = M.MachineID :::::::: :::::::: LEFT OUTER JOIN :::::::: (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus :::::::: ON HD.HelpDeskID = MaxStatus.HelpDeskID :::::::: :::::::: INNER JOIN :::::::: (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS :::::::: HelpDeskCallDetails :::::::: ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID :::::::: :::::::: LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr :::::::: WITH(NOLOCK) :::::::: ON HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID :::::::: LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON :::::::: CtcAddr.ContactID :::::::: = Ctc.ContactID :::::::: LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON :::::::: CtcAddr.AddrID = Addr.AddrID :::::::: LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON :::::::: Addr.CompanyID = Co.CompanyID :::::::: LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) :::::::: ON Addr.ZipID :::::::: = ZipList.ZipID :::::::: :::::::: --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, :::::::: but only the :::::::: OLD (<) runs in Access :::::::: :::::::: Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND :::::::: HelpDeskCallDetails.entryUSER = @entryUser :::::::: :::::::: ORDER BY HelpDeskCallDetails.entryTIME ASC :::::::: :::::::: :::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::::: object_id(N'tempdb..#MaxStatus')) BEGIN :::::::: DROP TABLE #MaxStatus :::::::: END :::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN :::::::: DROP TABLE #HelpDeskCallDetails :::::::: END :::::::: :::::::: SET NOCOUNT OFF :::::::: :::::::: :::::::: -Francisco :::::::: http://rcm.netfirms.com ::: ::: ::: _______________________________________________ ::: dba-SQLServer mailing list ::: dba-SQLServer at databaseadvisors.com ::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver ::: http://www.databaseadvisors.com ::: :: :: _________________________________________________________________ :: The new MSN 8: smart spam protection and 2 months FREE* :: http://join.msn.com/?page=features/junkmail :: :: _______________________________________________ :: 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 mikedorism at ntelos.net Tue Jul 29 15:53:01 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Tue, 29 Jul 2003 16:53:01 -0400 Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't In-Reply-To: <00a401c35602$e1897070$b615010a@FHTAPIA> Message-ID: <001901c35613$6a4db230$66330cd8@hargrove.internal> If you set the default to 0, it will always return all the records. Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: Tuesday, July 29, 2003 2:55 PM To: dba-sqlserver at databaseadvisors.com Cc: SQL Server 2k List Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't My co-worker found an option in Access for the amount of records to limit the return to, in Access it is defaulted to 10k, for my home version it is set to this limit as well as here at work, but at home the results are as expected, at work I had to modify this result to > 10,000 records, I chose as a test 100,000,000 which yields the correct results. boy do I hate Access sometimes... /RANT/ Now if the resulting records are limited to the 10k, why on earth would it be blocking the 1 returned record (this is a test of course but in normal everyday results it would return anywhere between 20 - 100 records for new entries. Access is trying to be way too smart for it's own good... I know I could avoid this headache and do it all VB but I do like the simple things in access for speedy RAD, Listbox population, automatic handling of cbo's for auto search select when you type into the box. OpenArguments... well thanks for the vent. /end RANT/ -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 11:12 AM [GMT-8], Francisco H Tapia wrote: : Thanks Billy, : that seems to have sped up the sproc from a runtime of 13seconds : down to 8-7 seconds nice... tested on a fellow developer's pc, I was : running Access 2k out of the box and at work I have Access2k sr1, the : other developer has Access2k sr1 loaded at home and it ran well there : too. : : so there is some other problem locally at work that breaks this. : : : -Francisco : http://rcm.netfirms.com : : On Tuesday, July 29, 2003 10:26 AM [GMT-8], : Billy Pang wrote: : :: There are a lot of temp tables in the sprocs you are trying to :: running. You can convert them into table variables. They work just :: like regular temporary tables except that it is not written onto :: disk. :: :: look up data type - table in BOL. :: :: ==cut here =========================== :: SET NOCOUNT ON :: DECLARE @my_product TABLE(PROD_ID INT IDENTITY(1,1) PRIMARY KEY, :: PROD_NAME VARCHAR(50), PROD_DATE SMALLDATETIME DEFAULT(GETDATE())) :: :: INSERT INTO @my_product(PROD_NAME) VALUES('red book'); :: INSERT INTO @my_product(PROD_NAME) VALUES('blue book'); :: INSERT INTO @my_product(PROD_NAME) VALUES('green book'); :: INSERT INTO @my_product(PROD_NAME) VALUES('white book'); :: :: UPDATE @my_product SET PROD_NAME = 'BLUE BOOK1' WHERE PROD_ID = 2 :: DELETE FROM @my_product where PROD_ID = 3 :: SELECT * FROM @my_product :: :: SET NOCOUNT OFF :: ============================= :: :: ::: From: "Francisco H Tapia" ::: Reply-To: dba-sqlserver at databaseadvisors.com ::: To: ::: Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't ::: Date: Tue, 29 Jul 2003 09:14:44 -0700 ::: ::: That's right Billy, If unmodiffied Database / sprocs and Unmoddifed ::: Front End Access ADP return the data via Access and QA as expected ::: at home the machine is an AMD2000+ w/ 1gig of ram Win2k SP2 + ::: ss2kdev SP3 ::: ::: WORK: Dual 800 Intel Xeon w/1gig of ram Win2kServer SP2 +ss2kserver ::: SP3 ::: ::: well I tried just as you suggested... and no dice :( the >= still ::: doesnt return via access ::: what do you mean Table Variables? ::: ::: Thanks ::: ::: -Francisco ::: http://rcm.netfirms.com ::: ::: On Tuesday, July 29, 2003 8:28 AM [GMT-8], ::: Billy Pang wrote: ::: :::: so both sprocs work perfectly at home? :::: :::: Can you alter both sprocs so that it just does one simple select? :::: if both sprocs work at the office, then alter the sproc again using :::: the real code and see if it still works. :::: :::: also, are you running both sprocs concurrently? :::: :::: also, since you are using ss2k, how about replacing your temp :::: tables with table variables? :::: :::: :::: :::: ::::: From: "Francisco Tapia" ::::: Reply-To: dba-sqlserver at databaseadvisors.com ::::: To: ::::: Subject: Re: [dba-SQLServer]Sproc runs and then it doesn't ::::: Date: Tue, 29 Jul 2003 02:05:33 -0700 ::::: ::::: Billy, ::::: I took the adp, and the database home and updated my home sql ::::: developer copy with the office copy of the server w/ no code ::::: changes and off the cuff copy to my hdd from the office the adp ::::: now displays the record, Sql Server 2000 SP3, but at the office it ::::: still does not and it is the same version of the db, and access ::::: adp. ::::: ::::: this is most bazaar. ::::: ::::: ::::: -Francisco ::::: http://rcm.netfirms.com/ ::::: ::::: On Tuesday, July 29, 2003 12:36 AM [GMT -8], ::::: Francisco Tapia wrote: ::::: :::::: I'm running it as windows authentication at the moment for both :::::: QA and the ADP, doh I did not think to use the profiler, I will :::::: check that next... :::::: :::::: -Francisco :::::: http://rcm.netfirms.com/ :::::: :::::: On Monday, July 28, 2003 6:09 PM [GMT -8], :::::: Billy Pang wrote: :::::: ::::::: Are you tried running both sprocs in QA using the security ::::::: authentication as ADP (eg. same login)? ::::::: also, does SQL Profiler reveal anything? ::::::: ::::::: ::::::: ::::::: ::::::: :::::::: From: "Francisco H Tapia" :::::::: Reply-To: dba-sqlserver at databaseadvisors.com :::::::: To: :::::::: Subject: [dba-SQLServer]Sproc runs and then it doesn't :::::::: Date: Mon, 28 Jul 2003 16:01:33 -0700 :::::::: :::::::: I have a stored procedure in my database that runs fine in QA. :::::::: In fact I created 2 versions of this sproc and both of them run :::::::: fine :::::::: in QA. In an ADP :::::::: that I have one sproc runs and the other does not. What would :::::::: be different? :::::::: :::::::: In the where clause I am checking for >= or <. :::::::: :::::::: The code is "I D E N T I C A L" in both sprocs lets call them :::::::: stp_New and stp_Old the new checks for any new entries since :::::::: today 12:00am, and the Old :::::::: checks for any records older than today at 12:00am. :::::::: :::::::: If I run the sproc in Access (ADP) it does not give me any data :::::::: for stp_New but it does give me the correct results for :::::::: stp_Old. :::::::: If I :::::::: go to QA I can run either sproc and they both execute :::::::: correctly. :::::::: I :::::::: am at a loss about this :::::::: one... anyone ever run into something similar? :::::::: :::::::: This is my code... :::::::: :::::::: ::::: ---------------------------------------------------------------------- - ::::: - - :::::::: --- :::::::: ---------------------------- :::::::: ALTER PROCEDURE stp_004A_lstHelpDeskNewCalls :::::::: (@LoginID NVARCHAR(50)) AS :::::::: :::::::: SET NOCOUNT ON :::::::: Declare @SetDateTime as datetime, @entryUser as :::::::: uniqueidentifier SET @entryUser = dbo.udfEntryUSER(@LoginID) :::::::: SET @SetDateTime = CAST ( :::::::: CAST (DATEPART(m, getUTCdate()) AS VARCHAR(4)) + '/' + :::::::: CAST (DATEPART(d, getUTCdate()) AS VARCHAR(4))+ '/' + :::::::: CAST (DATEPART(yyyy, getUTCdate()) AS VARCHAR(4)) + ' :::::::: 00:00:00' AS DATETIME) :::::::: :::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::::: object_id(N'tempdb..#MaxStatus')) BEGIN :::::::: DROP TABLE #MaxStatus :::::::: END :::::::: CREATE TABLE #MaxStatus :::::::: ([HelpDeskID] [UniqueIdentifier] Not Null, :::::::: [HelpStatusID] [int] Not Null, :::::::: [entryTime] [dateTIME] Not Null) :::::::: INSERT INTO #MaxStatus(HelpDeskID, HelpStatusID, entryTIME) :::::::: Select A.HelpDeskID, A.HelpStatusID, A.entryTIME FROM :::::::: dbo.tbl_HelpDeskStatus AS A WITH(NOLOCK) :::::::: LEFT OUTER JOIN :::::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From :::::::: dbo.tbl_HelpDeskStatus WITH(NOLOCK) Group By HelpDeskID) AS B :::::::: ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = B.entryTIME :::::::: AND HelpStatusID < 2) :::::::: :::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN :::::::: DROP TABLE #HelpDeskCallDetails :::::::: END :::::::: CREATE TABLE #HelpDeskCallDetails :::::::: ([HelpDeskID] [uniqueidentifier] Not Null, :::::::: [CallNotes] [nvarchar](20) Null, :::::::: [ContactAddrID] [uniqueidentifier] Null, :::::::: [entryTIME] [datetime] Null, :::::::: [entryUSER] [uniqueidentifier] Null) :::::::: :::::::: INSERT INTO #HelpDeskCallDetails (HelpDeskID, CallNotes, :::::::: ContactAddrID, entryTIME, entryUSER) :::::::: Select A.HelpDeskID, LEFT(A.CallNotes, 20), A.ContactAddrID, :::::::: A.entryTIME, :::::::: A.entryUSER FROM dbo.tbl_HelpDeskCallDetails AS A WITH(NOLOCK) :::::::: INNER JOIN :::::::: (SELECT HelpDeskID, Max(entryTIME) as entryTIME From :::::::: dbo.tbl_HelpDeskCallDetails WITH(NOLOCK) Group By HelpDeskID) :::::::: AS B ON (A.HelpDeskID = B.HelpDeskID AND A.entryTIME = :::::::: B.entryTIME ) :::::::: :::::::: :::::::: :::::::: Select HD.CaseNumberID, M.SN,Ctc.ContactName,Co.CompanyName, :::::::: Addr.LocationName,ZipList.State, :::::::: HelpDeskCallDetails.CallNotes AS [Call Notes], :::::::: HelpDeskCallDetails.entryTIME :::::::: FROM dbo.tbl_HelpDesk HD WITH(NOLOCK) INNER JOIN :::::::: dbo.tbl_Machine M WITH(NOLOCK) ON HD.MachineID = M.MachineID :::::::: :::::::: LEFT OUTER JOIN :::::::: (SELECT * FROM #MaxStatus WITH(NOLOCK) ) AS MaxStatus :::::::: ON HD.HelpDeskID = MaxStatus.HelpDeskID :::::::: :::::::: INNER JOIN :::::::: (SELECT * FROM #HelpDeskCallDetails WITH(NOLOCK) ) AS :::::::: HelpDeskCallDetails :::::::: ON HD.HelpDeskID = HelpDeskCallDetails.HelpDeskID :::::::: :::::::: LEFT OUTER JOIN dbo.tbl_ContactAddress AS CtcAddr :::::::: WITH(NOLOCK) :::::::: ON HelpDeskCallDetails.ContactAddrID = CtcAddr.ContactAddrID :::::::: LEFT OUTER JOIN dbo.tbl_Contacts AS Ctc WITH(NOLOCK) ON :::::::: CtcAddr.ContactID :::::::: = Ctc.ContactID :::::::: LEFT OUTER JOIN dbo.tbl_Address As Addr WITH(NOLOCK) ON :::::::: CtcAddr.AddrID = Addr.AddrID :::::::: LEFT OUTER JOIN dbo.tbl_Company AS Co WITH(NOLOCK) ON :::::::: Addr.CompanyID = Co.CompanyID :::::::: LEFT OUTER JOIN dbo.tbl_AddrZipList AS ZipList WITH(NOLOCK) :::::::: ON Addr.ZipID :::::::: = ZipList.ZipID :::::::: :::::::: --THIS LINE BELOW IS WHAT CHANGES from >= to <, both run in QA, :::::::: but only the :::::::: OLD (<) runs in Access :::::::: :::::::: Where HelpDeskCallDetails.entryTIME >= @SetDateTime AND :::::::: HelpDeskCallDetails.entryUSER = @entryUser :::::::: :::::::: ORDER BY HelpDeskCallDetails.entryTIME ASC :::::::: :::::::: :::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::::: object_id(N'tempdb..#MaxStatus')) BEGIN :::::::: DROP TABLE #MaxStatus :::::::: END :::::::: IF EXISTS (select * from tempdb.dbo.sysobjects where id = :::::::: object_id(N'tempdb..#HelpDeskCallDetails')) BEGIN :::::::: DROP TABLE #HelpDeskCallDetails :::::::: END :::::::: :::::::: SET NOCOUNT OFF :::::::: :::::::: :::::::: -Francisco :::::::: http://rcm.netfirms.com ::: ::: ::: _______________________________________________ ::: dba-SQLServer mailing list ::: dba-SQLServer at databaseadvisors.com ::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver ::: http://www.databaseadvisors.com ::: :: :: _________________________________________________________________ :: The new MSN 8: smart spam protection and 2 months FREE* :: http://join.msn.com/?page=features/junkmail :: :: _______________________________________________ :: 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 knicholson at gpsx.net Tue Jul 29 16:59:27 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Tue, 29 Jul 2003 16:59:27 -0500 Subject: [dba-SQLServer]A2K-SQL Stored Procedures Message-ID: Is it possible to build a front-end in A2K to execute stored procedures in SQL version 7? I need to allow the user to enter in a parameter that is in the stored procedure, if it is possible to create a parameter in SQL that is determined by a combo box in Access. ???? Thanks. From stuart at lexacorp.com.pg Tue Jul 29 19:22:48 2003 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 30 Jul 2003 10:22:48 +1000 Subject: [dba-SQLServer]A2K-SQL Stored Procedures In-Reply-To: Message-ID: <3F279C78.29204.634936@localhost> On 29 Jul 2003 at 16:59, Nicholson, Karen wrote: > Is it possible to build a front-end in A2K to execute stored procedures in > SQL version 7? Yes, I do it all the time. I need to allow the user to enter in a parameter that is in > the stored procedure, if it is possible to create a parameter in SQL that is > determined by a combo box in Access. ???? Thanks. > _______________________________________________ If sprocMyProcedure expects a single defined parameter, one way is to use something like: Function GetData() Dim conMyConnection as New Connection Dim rs as New Recordset conMyConnection = ".......... etc rs.open "sprocMyProcedure " & cboMyCombo, conMyConnection ..... -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. From tuxedo_man at hotmail.com Tue Jul 29 21:07:14 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 30 Jul 2003 02:07:14 +0000 Subject: [dba-SQLServer]Proper case? Message-ID: Is there a "proper case" function within SQL Server? I know that there is UPPER and LOWER, but what will help me convert the following: "the quick brown fox jumped. it is over for the lazy dog." to "The quick brown fox jumped. It is over for the lazy dog." Thanks in advance, Billy _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From tuxedo_man at hotmail.com Tue Jul 29 21:07:14 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 30 Jul 2003 02:07:14 +0000 Subject: [dba-SQLServer]Proper case? Message-ID: Is there a "proper case" function within SQL Server? I know that there is UPPER and LOWER, but what will help me convert the following: "the quick brown fox jumped. it is over for the lazy dog." to "The quick brown fox jumped. It is over for the lazy dog." Thanks in advance, Billy _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From stuart at lexacorp.com.pg Tue Jul 29 22:05:34 2003 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 30 Jul 2003 13:05:34 +1000 Subject: [dba-SQLServer]Proper case? In-Reply-To: Message-ID: <3F27C29E.16659.F84E71@localhost> On 30 Jul 2003 at 2:07, Billy Pang wrote: > Is there a "proper case" function within SQL Server? I know that there is > UPPER and LOWER, but what will help me convert the following: > > "the quick brown fox jumped. it is over for the lazy dog." > > to > > "The quick brown fox jumped. It is over for the lazy dog." > That's not "proper case", that's "sentence case" Proper case would be "The Quick Brown Fox Jumped. It Is Over For The Lazy Dog." But the answer in either case is No, you'd have to roll your own function. -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. From knicholson at gpsx.net Wed Jul 30 07:41:38 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 30 Jul 2003 07:41:38 -0500 Subject: [dba-SQLServer]Proper case? Message-ID: INITCAP(string) = first letter of each word capitalized, respectively -----Original Message----- From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] Sent: Tuesday, July 29, 2003 11:06 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Proper case? On 30 Jul 2003 at 2:07, Billy Pang wrote: > Is there a "proper case" function within SQL Server? I know that there is > UPPER and LOWER, but what will help me convert the following: > > "the quick brown fox jumped. it is over for the lazy dog." > > to > > "The quick brown fox jumped. It is over for the lazy dog." > That's not "proper case", that's "sentence case" Proper case would be "The Quick Brown Fox Jumped. It Is Over For The Lazy Dog." But the answer in either case is No, you'd have to roll your own function. -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From knicholson at gpsx.net Wed Jul 30 07:44:23 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 30 Jul 2003 07:44:23 -0500 Subject: [dba-SQLServer]Proper case? Message-ID: Or: create FUNCTION firstLetterUpperCase (@item varchar(100)) RETURNS varchar(100) AS BEGIN Declare @str varchar(100), @idx int, @strLength int set @idx = charindex (' ', @Item, 1) if (@item is null) or len (@item) = 0 return @item set @strLength = len (@item) set @str = lower (@Item) set @str = upper (substring (@str, 1, 1)) + substring (@str, 2, @strLength -1) while @idx > 0 begin set @str = substring (@str, 1, @idx ) + upper (substring (@str, @idx+1, 1)) + substring (@str, @idx + 2, @strLength - (@idx + 1)) set @idx = charindex (' ', @item, @idx + 2) end return @str END -----Original Message----- From: Billy Pang [mailto:tuxedo_man at hotmail.com] Sent: Tuesday, July 29, 2003 10:07 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Proper case? Is there a "proper case" function within SQL Server? I know that there is UPPER and LOWER, but what will help me convert the following: "the quick brown fox jumped. it is over for the lazy dog." to "The quick brown fox jumped. It is over for the lazy dog." Thanks in advance, Billy _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From paul.hartland at fsmail.net Wed Jul 30 06:43:01 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Wed, 30 Jul 2003 11:43:01 +0000 Subject: [dba-SQLServer]Proper case? Message-ID: <20030730114301.VGIF18722.fep06-svc.ttys.com@localhost> Why do you need this to be carried out in SQL Server is there a particular reason for this....If I need anything like this I write my own functions in either Access or Visual Basic (if and when I need to) Paul Hartland From: "Nicholson, Karen" Date: Wed 30/Jul/2003 12:41 GMT To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Proper case? INITCAP(string) = first letter of each word capitalized, respectively -----Original Message----- From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] Sent: Tuesday, July 29, 2003 11:06 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Proper case? On 30 Jul 2003 at 2:07, Billy Pang wrote: > Is there a "proper case" function within SQL Server? I know that there is > UPPER and LOWER, but what will help me convert the following: > > "the quick brown fox jumped. it is over for the lazy dog." > > to > > "The quick brown fox jumped. It is over for the lazy dog." > That's not "proper case", that's "sentence case" Proper case would be "The Quick Brown Fox Jumped. It Is Over For The Lazy Dog." But the answer in either case is No, you'd have to roll your own function. -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. _______________________________________________ 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 __________________________________________________________________________ Join Freeserve http://www.freeserve.com/time/ Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. From knicholson at gpsx.net Wed Jul 30 07:53:14 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 30 Jul 2003 07:53:14 -0500 Subject: [dba-SQLServer]Proper case? Message-ID: Or how about this one - this seems to take into account the punctuation mark. create FUNCTION ReturnCasedString (@Instr varchar(8000)) RETURNS varchar(8000) AS BEGIN If @Instr is Null or Len(@instr)=0 or @instr=space(len(@instr) Return @Instr Declare @Workstr varchar(8000) Declare @Punct varchar(20) Declare @PunctLen int Declare @StrPos int Declare @PunctPos int Declare @PunctChar char(1) Set @Punct=''' ,([{<' Set @punctLen=len(@punct) Set @WorkStr=LOWER(@Instr) Set @PunctPos=1 While @PunctPos <= @PunctLen Begin Set @punctChar=substring(@punct, at punctPos,1) set @StrPos = charindex (@punctChar, @WorkStr, 1) if @StrPos>0 Begin While @strpos > 0 begin Set @charpos = @strpos + 1 If @charpos <= @punctlen begin Set @substring(@workstr,charpos),1) = UPPER(@substring(@workstr,charpos),1)) end Set Strpos=charindex(@punctchar, at workstr, at charpos) end end Set @punctPos=@PunctPos+1 End return @Workstr END -----Original Message----- From: Billy Pang [mailto:tuxedo_man at hotmail.com] Sent: Tuesday, July 29, 2003 10:07 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Proper case? Is there a "proper case" function within SQL Server? I know that there is UPPER and LOWER, but what will help me convert the following: "the quick brown fox jumped. it is over for the lazy dog." to "The quick brown fox jumped. It is over for the lazy dog." Thanks in advance, Billy _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Jul 30 07:28:18 2003 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 30 Jul 2003 22:28:18 +1000 Subject: [dba-SQLServer]Proper case? In-Reply-To: Message-ID: <3F284682.20475.13D4D11@localhost> On 30 Jul 2003 at 7:41, Nicholson, Karen wrote: > INITCAP(string) = first letter of each word capitalized, respectively > > Is that in SQL Server 2000? It's not in SQL Server 7, but I haven't done anything with 2000. -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. From stuart at lexacorp.com.pg Wed Jul 30 07:31:33 2003 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 30 Jul 2003 22:31:33 +1000 Subject: [dba-SQLServer] number manipulation In-Reply-To: <000301c1de0a$02465ed0$0a64a8c0@athelon> References: <000001c1de07$789a9ae0$01000001@am2> Message-ID: <3F284745.11624.140465B@localhost> On 7 Apr 2002 at 14:57, Peter Kaufman wrote: > Hi Alan, > > I don?t want an implicit conversion to string. Will right() work on a > numeric value? > > Do you know the MS SQL equivalent to Access?s int() function? > myVariable - FLOOR(myVariable) -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. From sgeller at cce.umn.edu Wed Jul 30 07:57:39 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Wed, 30 Jul 2003 07:57:39 -0500 Subject: [dba-SQLServer]A2K-SQL Stored Procedures Message-ID: Karen, A few ways to do this depending on what you want to do with the sproc when it gets the parameter. Does it just do something on it's own or does it return a recordset and if so what do you want to do with the recordset? --Susan -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Tuesday, July 29, 2003 4:59 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]A2K-SQL Stored Procedures Is it possible to build a front-end in A2K to execute stored procedures in SQL version 7? I need to allow the user to enter in a parameter that is in the stored procedure, if it is possible to create a parameter in SQL that is determined by a combo box in Access. ???? Thanks. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From knicholson at gpsx.net Wed Jul 30 09:10:12 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 30 Jul 2003 09:10:12 -0500 Subject: [dba-SQLServer]A2K-SQL Stored Procedures Message-ID: What we are doing is switching systems that record incoming signals from alarms from the B32 environment to a new receiver. We will be doing testing in batches with the phone company, taking blocks of our customers by CS_no (which is the little box that hangs on your wall for our security systems). The phone company will call, we will change the "special" field for the specified block of customers to the modified "newspecial" field. I have another routine to reverse if all goes wrong, but this is the stored procedure, with the place that needs to be changed clearly marked. I would like my user to be able to run this from Access specifying his block as needed so I don't have to sit with him at 2:00 in the morning just to change a piece of code. Here is the sproc: CREATE procedure gps_SpecialSystem as SET CONCAT_NULL_YIELDS_NULL OFF truncate table gps_specialsystemdata insert gps_specialsystemdata( system_no, cs_no, special, newspecial, length) SELECT system_no, cs_no, special, special+'RSI' , len(special) as length FROM system WHERE ( /********************************************************************/ /***THIS IS THE CS NUMBER GROUPING TO CHANGE***/ (cs_no LIKE '21%') /********************************************************************/ and (len(special) in (1,2,3) or special is null)) update gps_specialsystemdata set exception=1 where special <> 'SUB' update system set system.special=gps_specialsystemdata.newspecial FROM gps_SpecialSystemData where gps_SpecialSystemData.system_no = system.system_no AND gps_SpecialSystemData.cs_no = system.cs_no -----Original Message----- From: Susan Geller [mailto:sgeller at cce.umn.edu] Sent: Wednesday, July 30, 2003 8:58 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]A2K-SQL Stored Procedures Karen, A few ways to do this depending on what you want to do with the sproc when it gets the parameter. Does it just do something on it's own or does it return a recordset and if so what do you want to do with the recordset? --Susan -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Tuesday, July 29, 2003 4:59 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]A2K-SQL Stored Procedures Is it possible to build a front-end in A2K to execute stored procedures in SQL version 7? I need to allow the user to enter in a parameter that is in the stored procedure, if it is possible to create a parameter in SQL that is determined by a combo box in Access. ???? Thanks. _______________________________________________ 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 tuxedo_man at hotmail.com Wed Jul 30 11:16:36 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 30 Jul 2003 16:16:36 +0000 Subject: [dba-SQLServer]Proper case? Message-ID: I think Initcap is used with PLSQL/Oracle. >From: "Nicholson, Karen" >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Proper case? >Date: Wed, 30 Jul 2003 07:41:38 -0500 > > INITCAP(string) = first letter of each word capitalized, respectively > > >-----Original Message----- >From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] >Sent: Tuesday, July 29, 2003 11:06 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer]Proper case? > > >On 30 Jul 2003 at 2:07, Billy Pang wrote: > > > Is there a "proper case" function within SQL Server? I know that there >is > > > UPPER and LOWER, but what will help me convert the following: > > > > "the quick brown fox jumped. it is over for the lazy dog." > > > > to > > > > "The quick brown fox jumped. It is over for the lazy dog." > > >That's not "proper case", that's "sentence case" > >Proper case would be >"The Quick Brown Fox Jumped. It Is Over For The Lazy Dog." > >But the answer in either case is No, you'd have to roll your own >function. > > > >-- >Lexacorp Ltd >http://www.lexacorp.com.pg >Information Technology Consultancy, Software Development,System >Support. > > > >_______________________________________________ >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 > _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From tuxedo_man at hotmail.com Wed Jul 30 11:18:23 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 30 Jul 2003 16:18:23 +0000 Subject: [dba-SQLServer]Proper case? Message-ID: Thanks Karen for the case functions. The firstLetterUpperCase returned Proper case, which was what I asked for. Billy >From: "Nicholson, Karen" >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Proper case? >Date: Wed, 30 Jul 2003 07:44:23 -0500 > >Or: > >create FUNCTION firstLetterUpperCase (@item varchar(100)) >RETURNS varchar(100) AS >BEGIN > >Declare @str varchar(100), > @idx int, > @strLength int > >set @idx = charindex (' ', @Item, 1) > >if (@item is null) or len (@item) = 0 > return @item > > >set @strLength = len (@item) > >set @str = lower (@Item) >set @str = upper (substring (@str, 1, 1)) + substring (@str, 2, @strLength >-1) > >while @idx > 0 >begin > set @str = substring (@str, 1, @idx ) + upper (substring (@str, >@idx+1, >1)) + substring (@str, @idx + 2, @strLength - (@idx + 1)) > set @idx = charindex (' ', @item, @idx + 2) >end > >return @str > >END > > > >-----Original Message----- >From: Billy Pang [mailto:tuxedo_man at hotmail.com] >Sent: Tuesday, July 29, 2003 10:07 PM >To: dba-SQLServer at databaseadvisors.com >Subject: [dba-SQLServer]Proper case? > > >Is there a "proper case" function within SQL Server? I know that there is >UPPER and LOWER, but what will help me convert the following: > >"the quick brown fox jumped. it is over for the lazy dog." > >to > >"The quick brown fox jumped. It is over for the lazy dog." > >Thanks in advance, >Billy > >_________________________________________________________________ >MSN 8 with e-mail virus protection service: 2 months FREE* >http://join.msn.com/?page=features/virus > >_______________________________________________ >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 > _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From my.lists at verizon.net Wed Jul 30 11:25:34 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 30 Jul 2003 09:25:34 -0700 Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't References: <001901c35613$6a4db230$66330cd8@hargrove.internal> Message-ID: <002101c356b7$3451b600$b615010a@FHTAPIA> Thanks Doris :) -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 1:53 PM [GMT-8], Mike and Doris Manning wrote: : If you set the default to 0, it will always return all the records. : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Francisco H Tapia : Sent: Tuesday, July 29, 2003 2:55 PM : To: dba-sqlserver at databaseadvisors.com : Cc: SQL Server 2k List : Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't : : : My co-worker found an option in Access for the amount of records to : limit the return to, in Access it is defaulted to 10k, for my home : version it is set to this limit as well as here at work, but at home : the results are as expected, at work I had to modify this result to > : 10,000 records, I chose as a test 100,000,000 which yields the : correct results. : From knicholson at gpsx.net Wed Jul 30 12:27:17 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 30 Jul 2003 12:27:17 -0500 Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't Message-ID: Oh my, that is intuitive! -----Original Message----- From: Francisco H Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, July 30, 2003 12:26 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Re: Sproc runs and then it doesn't Thanks Doris :) -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 1:53 PM [GMT-8], Mike and Doris Manning wrote: : If you set the default to 0, it will always return all the records. : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Francisco H Tapia : Sent: Tuesday, July 29, 2003 2:55 PM : To: dba-sqlserver at databaseadvisors.com : Cc: SQL Server 2k List : Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't : : : My co-worker found an option in Access for the amount of records to : limit the return to, in Access it is defaulted to 10k, for my home : version it is set to this limit as well as here at work, but at home : the results are as expected, at work I had to modify this result to > : 10,000 records, I chose as a test 100,000,000 which yields the : correct results. : _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From tuxedo_man at hotmail.com Wed Jul 30 11:25:08 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 30 Jul 2003 16:25:08 +0000 Subject: [dba-SQLServer]Proper case? Message-ID: I use SQL Analyzer more than I use Access when I pull data out of SQL Server. >From: >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: RE: [dba-SQLServer]Proper case? >Date: Wed, 30 Jul 2003 11:43:01 +0000 > >Why do you need this to be carried out in SQL Server is there a particular >reason for this....If I need anything like this I write my own functions in >either Access or Visual Basic (if and when I need to) > >Paul Hartland > > >From: "Nicholson, Karen" >Date: Wed 30/Jul/2003 12:41 GMT >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Proper case? > > INITCAP(string) = first letter of each word capitalized, respectively > > >-----Original Message----- >From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] >Sent: Tuesday, July 29, 2003 11:06 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer]Proper case? > > >On 30 Jul 2003 at 2:07, Billy Pang wrote: > > > Is there a "proper case" function within SQL Server? I know that there >is > > > UPPER and LOWER, but what will help me convert the following: > > > > "the quick brown fox jumped. it is over for the lazy dog." > > > > to > > > > "The quick brown fox jumped. It is over for the lazy dog." > > >That's not "proper case", that's "sentence case" > >Proper case would be >"The Quick Brown Fox Jumped. It Is Over For The Lazy Dog." > >But the answer in either case is No, you'd have to roll your own >function. > > > >-- >Lexacorp Ltd >http://www.lexacorp.com.pg >Information Technology Consultancy, Software Development,System >Support. > > > >_______________________________________________ >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 > > >__________________________________________________________________________ >Join Freeserve http://www.freeserve.com/time/ > >Winner of the 2003 Internet Service Providers' Association awards for Best >Unmetered ISP and Best Consumer Application. > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From knicholson at gpsx.net Wed Jul 30 12:31:21 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 30 Jul 2003 12:31:21 -0500 Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't Message-ID: Do you mean on the options tab in Microsoft Access, if you set the "dont display lists where more than this number of records read" to 0, it takes off the limit? -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Wednesday, July 30, 2003 1:27 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Re: Sproc runs and then it doesn't Oh my, that is intuitive! -----Original Message----- From: Francisco H Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, July 30, 2003 12:26 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Re: Sproc runs and then it doesn't Thanks Doris :) -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 1:53 PM [GMT-8], Mike and Doris Manning wrote: : If you set the default to 0, it will always return all the records. : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Francisco H Tapia : Sent: Tuesday, July 29, 2003 2:55 PM : To: dba-sqlserver at databaseadvisors.com : Cc: SQL Server 2k List : Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't : : : My co-worker found an option in Access for the amount of records to : limit the return to, in Access it is defaulted to 10k, for my home : version it is set to this limit as well as here at work, but at home : the results are as expected, at work I had to modify this result to > : 10,000 records, I chose as a test 100,000,000 which yields the : correct results. : _______________________________________________ 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 tuxedo_man at hotmail.com Wed Jul 30 11:25:08 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 30 Jul 2003 16:25:08 +0000 Subject: [dba-SQLServer]Proper case? Message-ID: I use SQL Analyzer more than I use Access when I pull data out of SQL Server. >From: >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: RE: [dba-SQLServer]Proper case? >Date: Wed, 30 Jul 2003 11:43:01 +0000 > >Why do you need this to be carried out in SQL Server is there a particular >reason for this....If I need anything like this I write my own functions in >either Access or Visual Basic (if and when I need to) > >Paul Hartland > > >From: "Nicholson, Karen" >Date: Wed 30/Jul/2003 12:41 GMT >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Proper case? > > INITCAP(string) = first letter of each word capitalized, respectively > > >-----Original Message----- >From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] >Sent: Tuesday, July 29, 2003 11:06 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer]Proper case? > > >On 30 Jul 2003 at 2:07, Billy Pang wrote: > > > Is there a "proper case" function within SQL Server? I know that there >is > > > UPPER and LOWER, but what will help me convert the following: > > > > "the quick brown fox jumped. it is over for the lazy dog." > > > > to > > > > "The quick brown fox jumped. It is over for the lazy dog." > > >That's not "proper case", that's "sentence case" > >Proper case would be >"The Quick Brown Fox Jumped. It Is Over For The Lazy Dog." > >But the answer in either case is No, you'd have to roll your own >function. > > > >-- >Lexacorp Ltd >http://www.lexacorp.com.pg >Information Technology Consultancy, Software Development,System >Support. > > > >_______________________________________________ >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 > > >__________________________________________________________________________ >Join Freeserve http://www.freeserve.com/time/ > >Winner of the 2003 Internet Service Providers' Association awards for Best >Unmetered ISP and Best Consumer Application. > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From my.lists at verizon.net Wed Jul 30 11:38:14 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 30 Jul 2003 09:38:14 -0700 Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't References: Message-ID: <003901c356b8$f9388d30$b615010a@FHTAPIA> In the Options > Advance Tab you have a Row Limit for the Client-server settings (Default Max Rows) The code way to get to that is to set it as Application.SetOption "Row Limit", 0 I had to go to the MSDN.microsoft.com site to find that answer as the "named options" list is wrong in the Access Help, not a little wrong, all the way wrong :) Whoo hoo, way to keep us guessing Uncle Bill... ;o) -Francisco http://rcm.netfirms.com On Wednesday, July 30, 2003 10:31 AM [GMT-8], Nicholson, Karen wrote: : Do you mean on the options tab in Microsoft Access, if you set the : "dont display lists where more than this number of records read" to : 0, it takes off the limit? : : -----Original Message----- : From: Nicholson, Karen [mailto:knicholson at gpsx.net] : Sent: Wednesday, July 30, 2003 1:27 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Re: Sproc runs and then it doesn't : : : Oh my, that is intuitive! : : -----Original Message----- : From: Francisco H Tapia [mailto:my.lists at verizon.net] : Sent: Wednesday, July 30, 2003 12:26 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Re: Sproc runs and then it doesn't : : : Thanks Doris :) : : -Francisco : http://rcm.netfirms.com : : On Tuesday, July 29, 2003 1:53 PM [GMT-8], : Mike and Doris Manning wrote: : :: If you set the default to 0, it will always return all the records. :: :: Doris Manning :: Database Administrator :: Hargrove Inc. :: www.hargroveinc.com :: :: :: -----Original Message----- :: From: dba-sqlserver-bounces at databaseadvisors.com :: [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of :: Francisco H Tapia :: Sent: Tuesday, July 29, 2003 2:55 PM :: To: dba-sqlserver at databaseadvisors.com :: Cc: SQL Server 2k List :: Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't :: :: :: My co-worker found an option in Access for the amount of records to :: limit the return to, in Access it is defaulted to 10k, for my home :: version it is set to this limit as well as here at work, but at home :: the results are as expected, at work I had to modify this result to > :: 10,000 records, I chose as a test 100,000,000 which yields the :: correct results. :: : : : : _______________________________________________ : 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 mikedorism at ntelos.net Wed Jul 30 12:19:45 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Wed, 30 Jul 2003 13:19:45 -0400 Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't In-Reply-To: Message-ID: <000001c356be$c9e5ee50$6e380cd8@hargrove.internal> Yes. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Nicholson, Karen Sent: Wednesday, July 30, 2003 1:31 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Re: Sproc runs and then it doesn't Do you mean on the options tab in Microsoft Access, if you set the "dont display lists where more than this number of records read" to 0, it takes off the limit? -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Wednesday, July 30, 2003 1:27 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Re: Sproc runs and then it doesn't Oh my, that is intuitive! -----Original Message----- From: Francisco H Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, July 30, 2003 12:26 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Re: Sproc runs and then it doesn't Thanks Doris :) -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 1:53 PM [GMT-8], Mike and Doris Manning wrote: : If you set the default to 0, it will always return all the records. : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Francisco H Tapia : Sent: Tuesday, July 29, 2003 2:55 PM : To: dba-sqlserver at databaseadvisors.com : Cc: SQL Server 2k List : Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't : : : My co-worker found an option in Access for the amount of records to : limit the return to, in Access it is defaulted to 10k, for my home : version it is set to this limit as well as here at work, but at home : the results are as expected, at work I had to modify this result to > : 10,000 records, I chose as a test 100,000,000 which yields the : correct results. : _______________________________________________ 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 knicholson at gpsx.net Wed Jul 30 13:25:34 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 30 Jul 2003 13:25:34 -0500 Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't Message-ID: No code needed. Just set to zero. How wonderful. -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Wednesday, July 30, 2003 1:20 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Re: Sproc runs and then it doesn't Yes. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Nicholson, Karen Sent: Wednesday, July 30, 2003 1:31 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Re: Sproc runs and then it doesn't Do you mean on the options tab in Microsoft Access, if you set the "dont display lists where more than this number of records read" to 0, it takes off the limit? -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Wednesday, July 30, 2003 1:27 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Re: Sproc runs and then it doesn't Oh my, that is intuitive! -----Original Message----- From: Francisco H Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, July 30, 2003 12:26 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Re: Sproc runs and then it doesn't Thanks Doris :) -Francisco http://rcm.netfirms.com On Tuesday, July 29, 2003 1:53 PM [GMT-8], Mike and Doris Manning wrote: : If you set the default to 0, it will always return all the records. : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Francisco H Tapia : Sent: Tuesday, July 29, 2003 2:55 PM : To: dba-sqlserver at databaseadvisors.com : Cc: SQL Server 2k List : Subject: [dba-SQLServer]Re: Sproc runs and then it doesn't : : : My co-worker found an option in Access for the amount of records to : limit the return to, in Access it is defaulted to 10k, for my home : version it is set to this limit as well as here at work, but at home : the results are as expected, at work I had to modify this result to > : 10,000 records, I chose as a test 100,000,000 which yields the : correct results. : _______________________________________________ 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 sgeller at cce.umn.edu Wed Jul 30 12:44:37 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Wed, 30 Jul 2003 12:44:37 -0500 Subject: [dba-SQLServer]A2K-SQL Stored Procedures Message-ID: Karen, The short answer is that yes you can do this through Access. You need to execute the sproc from Access passing the parameter. Here's sample code: 'Create command object and assign a valid connection to the Command. Dim CmdCreate As ADODB.Command Set CmdCreate = New ADODB.Command Set CmdCreate.ActiveConnection = CurrentProject.Connection CmdCreate.CommandType = adCmdStoredProc 'Assign properities of the command object. CmdCreate.CommandText = "p_AddProgramRecord" --put the name of your sproc here CmdCreate.Parameters.Item("@AcadPlan").Value = cboAcadPlan.Column(0) -- put the paramter here and what to pass to it from your form ' Execute stored procedure CmdCreate.Execute 'Clean up Set CmdCreate = Nothing You'll have to change your sproc so that it accepts an input parmater. The thing I'm not sure about is if you can keep your sproc as is with just replacing the '21%' with the input paramter @myParameter. I think with the like syntax you are going to have to build the whole sql as a string and execute the string at the end. That would be much less efficient in terms of sprocs. --Susan -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Wednesday, July 30, 2003 9:10 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]A2K-SQL Stored Procedures What we are doing is switching systems that record incoming signals from alarms from the B32 environment to a new receiver. We will be doing testing in batches with the phone company, taking blocks of our customers by CS_no (which is the little box that hangs on your wall for our security systems). The phone company will call, we will change the "special" field for the specified block of customers to the modified "newspecial" field. I have another routine to reverse if all goes wrong, but this is the stored procedure, with the place that needs to be changed clearly marked. I would like my user to be able to run this from Access specifying his block as needed so I don't have to sit with him at 2:00 in the morning just to change a piece of code. Here is the sproc: CREATE procedure gps_SpecialSystem as SET CONCAT_NULL_YIELDS_NULL OFF truncate table gps_specialsystemdata insert gps_specialsystemdata( system_no, cs_no, special, newspecial, length) SELECT system_no, cs_no, special, special+'RSI' , len(special) as length FROM system WHERE ( /********************************************************************/ /***THIS IS THE CS NUMBER GROUPING TO CHANGE***/ (cs_no LIKE '21%') /********************************************************************/ and (len(special) in (1,2,3) or special is null)) update gps_specialsystemdata set exception=1 where special <> 'SUB' update system set system.special=gps_specialsystemdata.newspecial FROM gps_SpecialSystemData where gps_SpecialSystemData.system_no = system.system_no AND gps_SpecialSystemData.cs_no = system.cs_no -----Original Message----- From: Susan Geller [mailto:sgeller at cce.umn.edu] Sent: Wednesday, July 30, 2003 8:58 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]A2K-SQL Stored Procedures Karen, A few ways to do this depending on what you want to do with the sproc when it gets the parameter. Does it just do something on it's own or does it return a recordset and if so what do you want to do with the recordset? --Susan -----Original Message----- From: Nicholson, Karen [mailto:knicholson at gpsx.net] Sent: Tuesday, July 29, 2003 4:59 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]A2K-SQL Stored Procedures Is it possible to build a front-end in A2K to execute stored procedures in SQL version 7? I need to allow the user to enter in a parameter that is in the stored procedure, if it is possible to create a parameter in SQL that is determined by a combo box in Access. ???? Thanks. _______________________________________________ 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 martyconnelly at shaw.ca Thu Jul 31 14:59:34 2003 From: martyconnelly at shaw.ca (MartyConnelly) Date: Thu, 31 Jul 2003 12:59:34 -0700 Subject: [dba-VB] [dba-SQLServer] [AccessD] ADO Control With Stored Procedure as Recordset References: <20030728091159.SGIT12389.fep02-svc.ttys.com@localhost> Message-ID: <3F297526.2020006@shaw.ca> This might work Assuming you have an ADO Data control called Ado1 - you can put up two input boxes and get the params you want - set the CommandType and RecordSource properties of the ADO Data control in code by which you pass the parameters to the SQL stored procedure. Make sure that you put some dummy parameters in for the RecordSource property in design mode which you can null out in code before setting the RecordSource property again. Dim intCustomers As Integer Dim lngPeriod As Long intCustomers = InputBox("Customer :", "Enter a Value") lngPeriod = InputBox("Date YYYYMMDD:", "Enter Date") strRecordSource = "MyProcData;1(" & intCustomers & "," & lngPeriod & ")" 'watch wrap and spaces Ado1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DatabaseName;Data Source=YourMachineName" Ado1.ConnectionTimeout = 30 Ado1.CommandType = adCmdStoredProc Ado1.RecordSource = "" Ado1.RecordSource = strRecordSource Ado1.Refresh paul.hartland at fsmail.net wrote: >To all, > >I have a SQL Server 7.0 BE, with a Visual Basic 6 FE. In SQl Server 7.0 I have a stored procedure which requires two parameters (Payroll, JobDate) and this returns all the jobs that a person is programmed to do. On my VB6 FE I have a form with a DataGrid and an ADO Control, with the Datagrid pointing to the ADO Control for it's datasource. When the form opens I want to pass the payroll and jobdate to the SQL Server stored procedure and return the results to the ADO Control which will then be displayed in the DataGrid. > >Is there anyone out there that can tell me how to do this, or has some sample code that I could look at to show me exactly how this can be acheived. > >Thanks in advance. > >Paul Hartland > >__________________________________________________________________________ >Join Freeserve http://www.freeserve.com/time/ > >Winner of the 2003 Internet Service Providers' Association awards for Best Unmetered ISP and Best Consumer Application. > > >_______________________________________________ >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: 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-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com > > > >