From MarkBoyd at McBeeAssociates.com Tue Apr 1 11:36:17 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Tue, 1 Apr 2003 12:36:17 -0500 Subject: [dba-SQLServer]Update table in other db Message-ID: <42DE35C7D61279419C166543CD42F405EDBE@mail2k.mcbassoc.com> I am trying to create a sproc that appends records from TableA to TableB. TableA is located on ServerA, and TableB is located on ServerB. How do I specify the location of ServerB in the following statement? "INSERT INTO TableB SELECT * FROM TableA" TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From my.lists at verizon.net Tue Apr 1 11:42:26 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 1 Apr 2003 09:42:26 -0800 Subject: [dba-SQLServer]Update table in other db References: <42DE35C7D61279419C166543CD42F405EDBE@mail2k.mcbassoc.com> Message-ID: <006d01c2f876$0fd398b0$b615010a@FHTAPIA> INSERT INTO ServerB.DatabaseName.dbo.TableB SELECT * FROM TableA note that you have to add a linked server to ServerA see BOL about Linked Servers. -Francisco http://rcm.netfirms.com On Tuesday, April 01, 2003 9:36 AM [GMT-8], Mark Boyd wrote: : I am trying to create a sproc that appends records from TableA to : TableB. : : TableA is located on ServerA, and TableB is located on ServerB. : : How do I specify the location of ServerB in the following statement? : : "INSERT INTO TableB SELECT * FROM TableA" : : : : TIA, : : Mark Boyd : : Sr. Systems Analyst : : McBee Associates, Inc. : : : : : : : :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com From JRojas at tnco-inc.com Tue Apr 1 12:18:55 2003 From: JRojas at tnco-inc.com (Joe Rojas) Date: Tue, 1 Apr 2003 13:18:55 -0500 Subject: [dba-SQLServer]Enterprise Manager (SS7) and MSDE 2000 Message-ID: <806536912C472E4A9D6515DF2E57261E0C595A@mercury.tnco-inc.com> Hi All, I have both MSDE 2000 and Enterprise Manager (SQL Server 7) installed on my PC. I have the EM install for remote administration of our SQL7 Server. I was able to register the MSDE 2000 with the EM and am able to view the DB. I was just wondering if anyone knew of any problems that may occur with using SS7's EM with MSDE 2K? I know this is a pretty vague question... I guess I am really looking for someone to say, "Ya, I am doing the same thing and everything is working well." Thanks, Joe Rojas jrojas at tnco-inc.com 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: From my.lists at verizon.net Tue Apr 1 13:00:02 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 1 Apr 2003 11:00:02 -0800 Subject: [dba-SQLServer]Enterprise Manager (SS7) and MSDE 2000 References: <806536912C472E4A9D6515DF2E57261E0C595A@mercury.tnco-inc.com> Message-ID: <00a301c2f880$e717e380$b615010a@FHTAPIA> Everything should work well. I am using EM that came w/ 2000 to manage a SS7 database and have not had any scripting errors from it. So I doubt you will see any problems. The major drawback for you is that you won't be able to tap into any of the newer stuff they added for 2000. -Francisco http://rcm.netfirms.com On Tuesday, April 01, 2003 10:18 AM [GMT-8], Joe Rojas wrote: :: Hi All, :: :: I have both MSDE 2000 and Enterprise Manager (SQL Server 7) :: installed on my PC. I have the EM install for remote administration :: of our SQL7 Server. I was able to register the MSDE 2000 with the EM :: and am able to view the DB. I was just wondering if anyone knew of :: any problems that may occur with using SS7's EM with MSDE 2K? :: :: I know this is a pretty vague question... I guess I am really :: looking for someone to say, "Ya, I am doing the same thing and :: everything is working well." :: :: Thanks, :: :: Joe Rojas :: jrojas at tnco-inc.com :: :: :: :: :: :: 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 Robert.Djabarov at usaa.com Tue Apr 1 13:07:24 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 1 Apr 2003 13:07:24 -0600 Subject: [dba-SQLServer]Update table in other db Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF08@ex02.eagle.usaa.com> You can also use OPENROWSET Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at mcbeeassociates.com] Sent: Tuesday, April 01, 2003 11:36 AM To: SQLServerList Subject: [dba-SQLServer]Update table in other db I am trying to create a sproc that appends records from TableA to TableB. TableA is located on ServerA, and TableB is located on ServerB. How do I specify the location of ServerB in the following statement? "INSERT INTO TableB SELECT * FROM TableA" TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Robert.Djabarov at usaa.com Tue Apr 1 13:07:24 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 1 Apr 2003 13:07:24 -0600 Subject: [dba-SQLServer]Update table in other db Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF08@ex02.eagle.usaa.com> You can also use OPENROWSET Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at mcbeeassociates.com] Sent: Tuesday, April 01, 2003 11:36 AM To: SQLServerList Subject: [dba-SQLServer]Update table in other db I am trying to create a sproc that appends records from TableA to TableB. TableA is located on ServerA, and TableB is located on ServerB. How do I specify the location of ServerB in the following statement? "INSERT INTO TableB SELECT * FROM TableA" TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _______________________________________________ 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 Apr 1 13:12:22 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 1 Apr 2003 13:12:22 -0600 Subject: [dba-SQLServer]Update table in other db Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF0A@ex02.eagle.usaa.com> ...but you need to create your sp on the side where INSERT occurs in order to use OPENROWSET. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Djabarov, Robert Sent: Tuesday, April 01, 2003 1:07 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Update table in other db You can also use OPENROWSET Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at mcbeeassociates.com] Sent: Tuesday, April 01, 2003 11:36 AM To: SQLServerList Subject: [dba-SQLServer]Update table in other db I am trying to create a sproc that appends records from TableA to TableB. TableA is located on ServerA, and TableB is located on ServerB. How do I specify the location of ServerB in the following statement? "INSERT INTO TableB SELECT * FROM TableA" TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Robert.Djabarov at usaa.com Tue Apr 1 13:12:22 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 1 Apr 2003 13:12:22 -0600 Subject: [dba-SQLServer]Update table in other db Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF0A@ex02.eagle.usaa.com> ...but you need to create your sp on the side where INSERT occurs in order to use OPENROWSET. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Djabarov, Robert Sent: Tuesday, April 01, 2003 1:07 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Update table in other db You can also use OPENROWSET Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at mcbeeassociates.com] Sent: Tuesday, April 01, 2003 11:36 AM To: SQLServerList Subject: [dba-SQLServer]Update table in other db I am trying to create a sproc that appends records from TableA to TableB. TableA is located on ServerA, and TableB is located on ServerB. How do I specify the location of ServerB in the following statement? "INSERT INTO TableB SELECT * FROM TableA" TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _______________________________________________ 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 Apr 1 14:36:10 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Tue, 1 Apr 2003 15:36:10 -0500 Subject: [dba-SQLServer]Update table in other db Message-ID: <42DE35C7D61279419C166543CD42F405CB23@mail2k.mcbassoc.com> Thanks for the reply, Robert. I've actually decided to avoid using a sproc for this part of my project. I can manually import the data into the SQL Server without a problem. Thanks again, Mark -----Original Message----- From: Djabarov, Robert [mailto:Robert.Djabarov at usaa.com] Sent: Tuesday, April 01, 2003 2:12 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Update table in other db ...but you need to create your sp on the side where INSERT occurs in order to use OPENROWSET. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Djabarov, Robert Sent: Tuesday, April 01, 2003 1:07 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Update table in other db You can also use OPENROWSET Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at mcbeeassociates.com] Sent: Tuesday, April 01, 2003 11:36 AM To: SQLServerList Subject: [dba-SQLServer]Update table in other db I am trying to create a sproc that appends records from TableA to TableB. TableA is located on ServerA, and TableB is located on ServerB. How do I specify the location of ServerB in the following statement? "INSERT INTO TableB SELECT * FROM TableA" TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From MarkBoyd at McBeeAssociates.com Tue Apr 1 14:41:38 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Tue, 1 Apr 2003 15:41:38 -0500 Subject: [dba-SQLServer]Execute sproc with SQL7 Message-ID: <42DE35C7D61279419C166543CD42F405EDBF@mail2k.mcbassoc.com> This is probably a simple question. Sorry for the ignorance. I usually use SQL2k's Query Analyzer to run sprocs. I can select the sproc from the Object Browser, right-click to Open, then click Execute. However, I can't find the Object Browser in SQL7. Therefore, I can't find another way to execute a sproc without creating an Access module and using DoCmd. Is there an easier way to execute sprocs with SQL7? TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From my.lists at verizon.net Tue Apr 1 14:47:18 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 1 Apr 2003 12:47:18 -0800 Subject: [dba-SQLServer]Execute sproc with SQL7 References: <42DE35C7D61279419C166543CD42F405EDBF@mail2k.mcbassoc.com> Message-ID: <006b01c2f88f$e3123bf0$b615010a@FHTAPIA> Use YourDbName exec dbo.YourSprocName (in a new window) -Francisco http://rcm.netfirms.com On Tuesday, April 01, 2003 12:41 PM [GMT-8], Mark Boyd wrote: : This is probably a simple question. Sorry for the ignorance. : : I usually use SQL2k's Query Analyzer to run sprocs. I can select the : sproc from the Object Browser, right-click to Open, then click : Execute. : : However, I can't find the Object Browser in SQL7. Therefore, I can't : find another way to execute a sproc without creating an Access module : and using DoCmd. : : Is there an easier way to execute sprocs with SQL7? : : : : TIA, : : Mark Boyd : : Sr. Systems Analyst : : McBee Associates, Inc. : : : : : : : :: _______________________________________________ :: 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 Apr 1 14:53:28 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Tue, 1 Apr 2003 15:53:28 -0500 Subject: [dba-SQLServer]Execute sproc with SQL7 Message-ID: <42DE35C7D61279419C166543CD42F405CB27@mail2k.mcbassoc.com> Franciso - Perfect! Thanks a lot. Mark -----Original Message----- From: Francisco H Tapia [mailto:my.lists at verizon.net] Sent: Tuesday, April 01, 2003 3:47 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Execute sproc with SQL7 Use YourDbName exec dbo.YourSprocName (in a new window) -Francisco http://rcm.netfirms.com On Tuesday, April 01, 2003 12:41 PM [GMT-8], Mark Boyd wrote: : This is probably a simple question. Sorry for the ignorance. : : I usually use SQL2k's Query Analyzer to run sprocs. I can select the : sproc from the Object Browser, right-click to Open, then click : Execute. : : However, I can't find the Object Browser in SQL7. Therefore, I can't : find another way to execute a sproc without creating an Access module : and using DoCmd. : : Is there an easier way to execute sprocs with SQL7? : : : : TIA, : : Mark Boyd : : Sr. Systems Analyst : : McBee Associates, Inc. : : : : : : : :: _______________________________________________ :: 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 MPorter at acsalaska.com Wed Apr 2 12:05:02 2003 From: MPorter at acsalaska.com (Porter, Mark) Date: Wed, 2 Apr 2003 09:05:02 -0900 Subject: [dba-SQLServer]Tracking events Message-ID: DB=SQL Server 7 We've had a bit of a disaster here, and would like to know its cause. Our production system (SIEBEL) went down late last night and, after investigating the tables, we found that a few of the critical tables had been recreated (via the Create Date) late in the evening. They were empty. I'm a developer, not an Admin, so I don't know how to track who did what and when. Is there any way to access the SQL Server log files to determine how the drop and recreate happened? Thanks, Mark 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 accessd at shaw.ca Wed Apr 2 12:56:22 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Wed, 02 Apr 2003 10:56:22 -0800 Subject: [dba-SQLServer]Tracking events In-Reply-To: Message-ID: Hi Mark: What patch version of SQL 7 do you have? Some of the older versions can be hacked through port address 1433 or 1434, according to some literature on the web. (The actual URL escapes me but there is veiled references to it on the MS site and a good explanation on patches and patching SQL7) The most likely explanation for such a targeted deletion would be that of some clumsy or vindictive local employee, who ran a process either, at the office or remotely. Check your login logs for times. Have there been any employee recently laid off who still has login privileges or a back-door access? Check all you SP for use and/or creation...It might give a hint as to when the deletion process was ran. Check the alerts for any ongoing processes that might, for example, rerun the same process every month or at the end of each backup. You have a good backup? HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Porter, Mark Sent: Wednesday, April 02, 2003 10:05 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer]Tracking events DB=SQL Server 7 We've had a bit of a disaster here, and would like to know its cause. Our production system (SIEBEL) went down late last night and, after investigating the tables, we found that a few of the critical tables had been recreated (via the Create Date) late in the evening. They were empty. I'm a developer, not an Admin, so I don't know how to track who did what and when. Is there any way to access the SQL Server log files to determine how the drop and recreate happened? Thanks, Mark 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. _______________________________________________ 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 Wed Apr 2 13:06:26 2003 From: MPorter at acsalaska.com (Porter, Mark) Date: Wed, 2 Apr 2003 10:06:26 -0900 Subject: [dba-SQLServer]Tracking events Message-ID: Good food for thought Fortunately the backup ran just 2 hours before the table deletion. The admins are restoring now. They are going to check the network login logs directly afterwards. Luckily this was pretty late in the evening so determining logins will be pretty easy. All we really have to go on is empty tables with new creation dates, we're assuming they were dropped and recreated. The structure was identical, so we're not ruling out the possibility of an application error or a process failure causing it. No employee churn in quite a while, we're not considering intentional sabotage as a factor. No SP_s in the system which specifically do this type of action. More than likely it was an accident of some kind, we would like to track it down to its point of origin and make sure it doesn't happen again. We are in the middle of a few large data conversion projects. Any other ideas other than a 3rd party SQL Log explorer to find out who did what SQL statements and when? Mark -----Original Message----- From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] Sent: Wednesday, April 02, 2003 9:56 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Tracking events Hi Mark: What patch version of SQL 7 do you have? Some of the older versions can be hacked through port address 1433 or 1434, according to some literature on the web. (The actual URL escapes me but there is veiled references to it on the MS site and a good explanation on patches and patching SQL7) The most likely explanation for such a targeted deletion would be that of some clumsy or vindictive local employee, who ran a process either, at the office or remotely. Check your login logs for times. Have there been any employee recently laid off who still has login privileges or a back-door access? Check all you SP for use and/or creation...It might give a hint as to when the deletion process was ran. Check the alerts for any ongoing processes that might, for example, rerun the same process every month or at the end of each backup. You have a good backup? HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Porter, Mark Sent: Wednesday, April 02, 2003 10:05 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer]Tracking events DB=SQL Server 7 We've had a bit of a disaster here, and would like to know its cause. Our production system (SIEBEL) went down late last night and, after investigating the tables, we found that a few of the critical tables had been recreated (via the Create Date) late in the evening. They were empty. I'm a developer, not an Admin, so I don't know how to track who did what and when. Is there any way to access the SQL Server log files to determine how the drop and recreate happened? Thanks, Mark 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. _______________________________________________ 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 davide at dalyn.co.nz Thu Apr 3 16:15:18 2003 From: davide at dalyn.co.nz (David Emerson) Date: Fri, 04 Apr 2003 10:15:18 +1200 Subject: [dba-SQLServer]Connection String Message-ID: <5.2.0.9.0.20030404101253.00b1bea8@mail.dalyn.co.nz> AXP ADP/SQL2000. I can get the current Connection string by using CurrentProject.Connection.ConnectionString. I want to be able to check the current user (User ID = xxx) and run code based on who it is. Is there a simple function to find out the User or do I have to do string manipulation on the ConnectionString? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From my.lists at verizon.net Thu Apr 3 16:31:07 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 3 Apr 2003 14:31:07 -0800 Subject: [dba-SQLServer]Connection String References: <5.2.0.9.0.20030404101253.00b1bea8@mail.dalyn.co.nz> Message-ID: <00b901c2fa30$b855f350$b615010a@FHTAPIA> If you are using windows authentication then you can just use this. otherwise if you are using sql authentication you'll need to parse the string. 'Use the following to get UserName Private Declare Function apiGetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Function fOSUserName() As String ' Returns the network login name Dim lngLen As Long, lngx As Long Dim strUserName As String strUserName = String$(254, 0) lngLen = 255 lngx = apiGetUserName(strUserName, lngLen) If lngx <> 0 Then fOSUserName = Left$(strUserName, lngLen - 1) Else fOSUserName = "" End If End Function -Francisco http://rcm.netfirms.com On Thursday, April 03, 2003 2:15 PM [GMT-8], David Emerson wrote: : AXP ADP/SQL2000. : : I can get the current Connection string by using : CurrentProject.Connection.ConnectionString. : : I want to be able to check the current user (User ID = xxx) and run : code based on who it is. Is there a simple function to find out the : User or do I have to do string manipulation on the ConnectionString? : : 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 Thu Apr 3 18:14:05 2003 From: davide at dalyn.co.nz (David Emerson) Date: Fri, 04 Apr 2003 12:14:05 +1200 Subject: [dba-SQLServer]Connection String In-Reply-To: <00b901c2fa30$b855f350$b615010a@FHTAPIA> References: <5.2.0.9.0.20030404101253.00b1bea8@mail.dalyn.co.nz> Message-ID: <5.2.0.9.0.20030404121158.00b1bea8@mail.dalyn.co.nz> Thanks Francisco. Another thing I found out today was that if you divide an integer by an integer SQL will round the result to an integer. Using the ROUND() function doesn't help if you want decimal places. My solution was to CAST one of the number as a float. Another of Microsoft's features? David At 3/04/2003, you wrote: >If you are using windows authentication then you can just use this. >otherwise if you are using sql authentication you'll need to parse the >string. > >'Use the following to get UserName >Private Declare Function apiGetUserName Lib "advapi32.dll" Alias >"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long > >Function fOSUserName() As String >' Returns the network login name >Dim lngLen As Long, lngx As Long >Dim strUserName As String > strUserName = String$(254, 0) > lngLen = 255 > lngx = apiGetUserName(strUserName, lngLen) > If lngx <> 0 Then > fOSUserName = Left$(strUserName, lngLen - 1) > Else > fOSUserName = "" > End If >End Function > >-Francisco >http://rcm.netfirms.com > >On Thursday, April 03, 2003 2:15 PM [GMT-8], >David Emerson wrote: > >: AXP ADP/SQL2000. >: >: I can get the current Connection string by using >: CurrentProject.Connection.ConnectionString. >: >: I want to be able to check the current user (User ID = xxx) and run >: code based on who it is. Is there a simple function to find out the >: User or do I have to do string manipulation on the ConnectionString? >: >: 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 davide at dalyn.co.nz Thu Apr 3 18:15:57 2003 From: davide at dalyn.co.nz (David Emerson) Date: Fri, 04 Apr 2003 12:15:57 +1200 Subject: [dba-SQLServer]Exporting SPROC with Parameters to Excel Message-ID: <5.2.0.9.0.20030404121411.00b53f20@mail.dalyn.co.nz> I am able to use the following line to export the result of a sproc to excel - DoCmd.OutputTo acOutputStoredProcedure, "spBookingExport", acFormatXLS, strFullName However, can I do it if the sproc has parameters and I don't want the user to have to enter in the values as they are already on the form that calls the sproc? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From my.lists at verizon.net Thu Apr 3 18:22:52 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 3 Apr 2003 16:22:52 -0800 Subject: [dba-SQLServer]Connection String References: <5.2.0.9.0.20030404101253.00b1bea8@mail.dalyn.co.nz> <5.2.0.9.0.20030404121158.00b1bea8@mail.dalyn.co.nz> Message-ID: <00c301c2fa40$54e463a0$b615010a@FHTAPIA> It's doing what you ask it which is take an integer datatype and do some processing, it never re-set's it datatype unless you do.... so modifying the datatype to float is a good place to start.. -Francisco http://rcm.netfirms.com On Thursday, April 03, 2003 4:14 PM [GMT-8], David Emerson wrote: : Thanks Francisco. : : Another thing I found out today was that if you divide an integer by : an integer SQL will round the result to an integer. Using the ROUND() : function doesn't help if you want decimal places. My solution was to : CAST one of the number as a float. Another of Microsoft's features? : : David : : At 3/04/2003, you wrote: :: If you are using windows authentication then you can just use this. :: otherwise if you are using sql authentication you'll need to parse :: the string. :: :: 'Use the following to get UserName :: Private Declare Function apiGetUserName Lib "advapi32.dll" Alias :: "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long :: :: Function fOSUserName() As String :: ' Returns the network login name :: Dim lngLen As Long, lngx As Long :: Dim strUserName As String :: strUserName = String$(254, 0) :: lngLen = 255 :: lngx = apiGetUserName(strUserName, lngLen) :: If lngx <> 0 Then :: fOSUserName = Left$(strUserName, lngLen - 1) :: Else :: fOSUserName = "" :: End If :: End Function :: :: -Francisco :: http://rcm.netfirms.com :: :: On Thursday, April 03, 2003 2:15 PM [GMT-8], :: David Emerson wrote: :: ::: AXP ADP/SQL2000. ::: ::: I can get the current Connection string by using ::: CurrentProject.Connection.ConnectionString. ::: ::: I want to be able to check the current user (User ID = xxx) and run ::: code based on who it is. Is there a simple function to find out the ::: User or do I have to do string manipulation on the ConnectionString? ::: ::: 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 my.lists at verizon.net Thu Apr 3 18:24:52 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 3 Apr 2003 16:24:52 -0800 Subject: [dba-SQLServer]Exporting SPROC with Parameters to Excel References: <5.2.0.9.0.20030404121411.00b53f20@mail.dalyn.co.nz> Message-ID: <00cd01c2fa40$9cd63490$b615010a@FHTAPIA> I don't use that feature, but perhaps this might help, I've found that the "EXEC stpMystoredProcedure @Param1 = " & iMyparam1 & ", @Param2 = '" & strParam2 & "'" works well when applying it to listboxes, combo, forms.. you name it ... I wonder if it would work this way for you as well... -Francisco http://rcm.netfirms.com On Thursday, April 03, 2003 4:15 PM [GMT-8], David Emerson wrote: : I am able to use the following line to export the result of a sproc : to excel - : : DoCmd.OutputTo acOutputStoredProcedure, "spBookingExport", : acFormatXLS, strFullName : : However, can I do it if the sproc has parameters and I don't want the : user : to have to enter in the values as they are already on the form that : calls : the sproc? : : 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 Thu Apr 3 18:53:51 2003 From: davide at dalyn.co.nz (David Emerson) Date: Fri, 04 Apr 2003 12:53:51 +1200 Subject: [dba-SQLServer]Exporting SPROC with Parameters to Excel In-Reply-To: <00cd01c2fa40$9cd63490$b615010a@FHTAPIA> References: <5.2.0.9.0.20030404121411.00b53f20@mail.dalyn.co.nz> Message-ID: <5.2.0.9.0.20030404124435.00b51750@mail.dalyn.co.nz> Good thinking. We are getting closer. Now I have - strSprocName = "EXEC spBookingExport @txtMDQSeasonAdj=0, @txtMDQDivider=20" DoCmd.OutputTo acOutputStoredProcedure, strSprocName, acFormatXLS, strFullName An error 119 appears saying that I must pass parameter number 2 and subsequest parameters as "name = value". If I just have one parameter thus - strSprocName = "EXEC spBookingExport @txtMDQSeasonAdj=0" DoCmd.OutputTo acOutputStoredProcedure, strSprocName, acFormatXLS, strFullName it works ok. My pick is that the DoCmd is taking the comma in the EXEC statement as the comma for its own parameters. Putting a single quote around the whole EXEC call doesn't work either (invalid object name). At 3/04/2003, you wrote: >I don't use that feature, but perhaps this might help, I've found that the >"EXEC stpMystoredProcedure @Param1 = " & iMyparam1 & ", @Param2 = '" & >strParam2 & "'" works well when applying it to listboxes, combo, forms.. you >name it ... I wonder if it would work this way for you as well... > > >-Francisco >http://rcm.netfirms.com > >On Thursday, April 03, 2003 4:15 PM [GMT-8], >David Emerson wrote: > >: I am able to use the following line to export the result of a sproc >: to excel - >: >: DoCmd.OutputTo acOutputStoredProcedure, "spBookingExport", >: acFormatXLS, strFullName >: >: However, can I do it if the sproc has parameters and I don't want the >: user >: to have to enter in the values as they are already on the form that >: calls >: the sproc? >: >: 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 Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From davide at dalyn.co.nz Thu Apr 3 21:22:23 2003 From: davide at dalyn.co.nz (David Emerson) Date: Fri, 04 Apr 2003 15:22:23 +1200 Subject: [dba-SQLServer]Exporting SPROC with Parameters to Excel Message-ID: <5.2.0.9.0.20030404152040.00b56b00@mail.dalyn.co.nz> Solved! The problem seemed to be with specifically listing the parameters - This didn't work - strSprocName = "EXEC spBookingExport @txtMDQSeasonAdj='0', @txtMDQDivider='20'" This did - strSprocName = "EXEC spBookingExport '0', '20'" Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From CWortz at tea.state.tx.us Fri Apr 4 07:30:14 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Fri, 4 Apr 2003 07:30:14 -0600 Subject: [dba-SQLServer]Connection String Message-ID: David, Sorry, but I must correct you. Integer arithmetic ALWAYS truncates! It has been so since the first binary computer. To round you must, repeat MUST, use floating-point numbers. 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: David Emerson [mailto:davide at dalyn.co.nz] Sent: Thursday 2003 Apr 03 18:14 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Connection String Thanks Francisco. Another thing I found out today was that if you divide an integer by an integer SQL will round the result to an integer. Using the ROUND() function doesn't help if you want decimal places. My solution was to CAST one of the number as a float. Another of Microsoft's features? David From my.lists at verizon.net Fri Apr 4 09:54:33 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Fri, 4 Apr 2003 07:54:33 -0800 Subject: [dba-SQLServer]Re: [AccessD] indexes in ADP References: <02e801c2fa46$b4bc4fd0$c8e6ffcc@SusanOne> Message-ID: <000f01c2fac2$7cbc7480$b615010a@FHTAPIA> ADP's are nothing more than FE hooks to a Sql Server. Indexes are a database function and therefor available through the sql server engine. To use Non/Clustered indexes you will have to specify them when in the table design view. If a table has a clustered index, and you access the db via an ADP that ADP makes calls to a sproc/view and IT (the sproc/view) uses these in the optimizer to access your data. Adp's do nothing more than connect and request the data. -Francisco http://rcm.netfirms.com On Thursday, April 03, 2003 5:07 PM [GMT-8], Susan Harkins wrote: : What kind of indexes does an ADP use -- clustered or non-clustered? : I'm guessing clustered. : : Susan H. : From davide at dalyn.co.nz Fri Apr 4 15:37:59 2003 From: davide at dalyn.co.nz (David Emerson) Date: Sat, 05 Apr 2003 09:37:59 +1200 Subject: [dba-SQLServer]Connection String In-Reply-To: Message-ID: <5.2.0.9.0.20030405093725.00b55988@mail.dalyn.co.nz> Happy to be corrected :) David At 4/04/2003, you wrote: >David, > >Sorry, but I must correct you. Integer arithmetic ALWAYS truncates! It >has been so since the first binary computer. To round you must, repeat >MUST, use floating-point numbers. > >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: David Emerson [mailto:davide at dalyn.co.nz] >Sent: Thursday 2003 Apr 03 18:14 >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer]Connection String > > >Thanks Francisco. > >Another thing I found out today was that if you divide an integer by an >integer SQL will round the result to an integer. Using the ROUND() >function doesn't help if you want decimal places. My solution was to >CAST >one of the number as a float. Another of Microsoft's features? > >David >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com From mmaddison at optusnet.com.au Fri Apr 4 17:50:57 2003 From: mmaddison at optusnet.com.au (Michael Maddison) Date: Sat, 5 Apr 2003 09:50:57 +1000 Subject: [dba-SQLServer]Re: [AccessD] indexes in ADP In-Reply-To: <000f01c2fac2$7cbc7480$b615010a@FHTAPIA> Message-ID: Also you can have only 1 clustered index per table. By default when creating a PK (Identity) in EM it will create a clustered index. I assume the same for an ADP, I don't have SQL installed at home so I can't check... cheers Michael M ADP's are nothing more than FE hooks to a Sql Server. Indexes are a database function and therefor available through the sql server engine. To use Non/Clustered indexes you will have to specify them when in the table design view. If a table has a clustered index, and you access the db via an ADP that ADP makes calls to a sproc/view and IT (the sproc/view) uses these in the optimizer to access your data. Adp's do nothing more than connect and request the data. -Francisco http://rcm.netfirms.com On Thursday, April 03, 2003 5:07 PM [GMT-8], Susan Harkins wrote: : What kind of indexes does an ADP use -- clustered or non-clustered? : I'm guessing clustered. : : Susan H. : _______________________________________________ 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 Mon Apr 7 20:21:45 2003 From: davide at dalyn.co.nz (David Emerson) Date: Tue, 08 Apr 2003 13:21:45 +1200 Subject: [dba-SQLServer]SQL exporting to EXCEL Message-ID: <5.2.0.9.0.20030408131458.02335e60@mail.dalyn.co.nz> AXP ADP/SQL2K I have a sproc that returns a recordset I want to export to excel. When I use the following code Excel wants to name the sheet the value of strSprocName. This causes problems because the call to the sproc is not a valid sheet name (this is because of the second parameter - sprocs with only 1 parameter work ok). The spreadsheet creates ok but when I open it in Excel and error appears saying that the sheet has been recovered and renamed. I would like to be able to create the sheet without the error. strSprocName = "EXEC spBookingExport 0, '20' DoCmd.OutputTo acOutputStoredProcedure, strSprocName, acFormatXLS, C:\Temp\test.xls Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From my.lists at verizon.net Tue Apr 8 16:56:39 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 8 Apr 2003 14:56:39 -0700 Subject: [dba-SQLServer]Re: [AccessD] Simple stored proc problem (I hope) References: <000101c2fe12$3e3ae9f0$0100a8c0@netboxxp> Message-ID: <002001c2fe19$bc7029a0$b615010a@FHTAPIA> Mark, as this is getting more SQL Server related than simply Access ADP's I'm also posting to the dba-SqlServer list (to subscribe follow this link: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver) Now on to the problem... How are you passing the parameters over to SQL server? could you post that info? also, do you have QA (Query Analyzer) if so I would suggest trying out what is happening there... I was going to ask why is the psnID declared as varchar, but you did mentioned you were testing so I am assuming that your planning on using alphanumeric psnID's. in QA you would execute the following Select * FROM tbl_psn Where psnID = '11' what are your results? -Francisco http://rcm.netfirms.com On Tuesday, April 08, 2003 2:03 PM [GMT-8], Mark Hayes wrote: : Just had another go and it?s the same for characters... If I enter : "AAA" then recod "A" gets updated... : : If I do the same update from code using a simple update sql string : and a command object then its ok. : : ???? : : Mark : : -----Original Message----- : From: accessd-bounces at databaseadvisors.com : [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark Hayes : Sent: 08 April 2003 21:47 : To: accessd at databaseadvisors.com : Subject: [AccessD] Simple stored proc problem (I hope) : : : Hello again... : : I am using XP data project and have a problem with a stored proc. : : I am attempting to update a person record by passing a psnID and a new : name (just playing) : : The problem is that although I may pass the psnID as "11" the record : with the ID "1" is changed. If I am trying to update the psnID "55" : then "5" gets updated. : : The sproc is v.simple and I really can't see whats going wrong : : UPDATE tbl_psn : SET person_name=@person_name_2 : WHERE (psnID=@psnID_1) : : The psnID field is nvarchar 10 : : This XP stuffs getting confusing :o( : : Any help much appreciated : : Mark : From my.lists at verizon.net Tue Apr 8 17:49:14 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 8 Apr 2003 15:49:14 -0700 Subject: [dba-SQLServer]Re: [AccessD] Simple stored proc problem (I hope) References: <000001c2fe1f$23336fd0$0100a8c0@netboxxp> Message-ID: <003801c2fe21$14631990$b615010a@FHTAPIA> One notable diffrence is that your @psnID_1 does not have a value for the amount of text you need declared try modifying it to include up to 10 characters for example: ALTER PROCEDURE dbo.update_tbl_psn_1(@psnID_1 [nvarchar] (10), @person_name_2 [nvarchar](100)) AS UPDATE dbo.tbl_psn SET person_name = @person_name_2 WHERE (psnID = @psnID_1) GO -Francisco http://rcm.netfirms.com On Tuesday, April 08, 2003 3:35 PM [GMT-8], Mark Hayes wrote: : Thanks Francisco : : The stored proc is.... : : CREATE PROCEDURE dbo.update_tbl_psn_1(@psnID_1 [nvarchar], : @person_name_2 [nvarchar](100)) : AS UPDATE dbo.tbl_psn : SET person_name = @person_name_2 : WHERE (psnID = @psnID_1) : GO : : in query analyser if I execute : : SELECT * FROM tbl_psn WHERE psnID='555' : : I get the record for the person whose ID is "555" : : however, still in QA, if I execute the SP like this : : exec update_tbl_psn_1 '555','Updated Name' : : then its the record with an ID of "5" thats updated. I have tried this : from QA and Access and get the same result. : : If I execute the SP from access by just double clicking on it, I get : prompted for the parameters (psnID and person_name), if I enter "555" : as the psnID record "5" gets updated. : : I have even had the same result working with a separate sql server : installation and a different data set / table. This is really : confusing me as I have written SP's before (a couple of years) ago : that work just fine. : : Really scratching my head on this one : : Cheers : : Mark : : -----Original Message----- : From: accessd-bounces at databaseadvisors.com : [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Francisco H : Tapia : Sent: 08 April 2003 22:57 : To: accessd at databaseadvisors.com; dba-SQLServer at databaseadvisors.com : Subject: [dba-SQLServer]Re: [AccessD] Simple stored proc problem (I : hope) : : : Mark, : as this is getting more SQL Server related than simply Access ADP's : I'm also posting to the dba-SqlServer list (to subscribe follow this : link: : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver) : : Now on to the problem... How are you passing the parameters over to : SQL server? could you post that info? also, do you have QA (Query : Analyzer) if so I would suggest trying out what is happening there... : I was going to ask why is the psnID declared as varchar, but you did : mentioned you were testing so I am assuming that your planning on : using alphanumeric psnID's. : : in QA you would execute the following : Select * FROM tbl_psn Where psnID = '11' : : what are your results? : : : -Francisco : http://rcm.netfirms.com : : On Tuesday, April 08, 2003 2:03 PM [GMT-8], : Mark Hayes wrote: : :: Just had another go and it?s the same for characters... If I enter :: "AAA" then recod "A" gets updated... :: :: If I do the same update from code using a simple update sql string :: and a command object then its ok. :: :: ???? :: :: Mark :: :: -----Original Message----- :: From: accessd-bounces at databaseadvisors.com :: [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark Hayes :: Sent: 08 April 2003 21:47 :: To: accessd at databaseadvisors.com :: Subject: [AccessD] Simple stored proc problem (I hope) :: :: :: Hello again... :: :: I am using XP data project and have a problem with a stored proc. :: :: I am attempting to update a person record by passing a psnID and a :: new name (just playing) :: :: The problem is that although I may pass the psnID as "11" the record :: with the ID "1" is changed. If I am trying to update the psnID "55" :: then "5" gets updated. :: :: The sproc is v.simple and I really can't see whats going wrong :: :: UPDATE tbl_psn :: SET person_name=@person_name_2 :: WHERE (psnID=@psnID_1) :: :: The psnID field is nvarchar 10 :: :: This XP stuffs getting confusing :o( :: :: Any help much appreciated :: :: Mark :: : : : _______________________________________________ : 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 : : --- : Incoming mail is certified Virus Free. : Checked by AVG anti-virus system (http://www.grisoft.com). : Version: 6.0.470 / Virus Database: 268 - Release Date: 08/04/2003 : : : --- : Outgoing mail is certified Virus Free. : Checked by AVG anti-virus system (http://www.grisoft.com). : Version: 6.0.470 / Virus Database: 268 - Release Date: 08/04/2003 : : : _______________________________________________ : AccessD mailing list : AccessD at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/accessd : Website: http://www.databaseadvisors.com From tomadatn at bellsouth.net Fri Apr 11 08:01:18 2003 From: tomadatn at bellsouth.net (Tom Adams) Date: Fri, 11 Apr 2003 08:01:18 -0500 Subject: [dba-SQLServer]Corrupt views ... (Crossposted at AccessD) References: <000001c2fe1f$23336fd0$0100a8c0@netboxxp> <003801c2fe21$14631990$b615010a@FHTAPIA> Message-ID: <000e01c3002a$723331d0$6400000a@dogbert2k> I've posted a couple of items asking if anyone has had any problems with Sql 7 and corrupt views. So far no one else seems to have found this bug/feature. Plowing ahead with this first in the universe coverage (you heard it here first folks!), I thought I'd bring you up to date. At first I thought it might be caused by Access 2000 ADP. I used both that and the Enterprise manager to make changes in views. I then decided to eliminate the Access question by never changing a view with Access, just using it to review data (Being able to sort is absolutely essential in my opinion. Although the view can not be sorted, you can move columns around and then wipe as many as you wish and hit the A-Z button. Wonderful really.). I can now report that I am still hitting corrupt views. However they're a little different now. Now I open them (it's mainly one complicated view now) in Enterprise Manager and the Sql view looks corrupt. It cuts off before the From and following parts. However it runs ok (Previously the view looked ok but showed bad data. Any change at that point would correct it - eg. take out a field and put it back in.) Note that I can still generate Sql scripts from the database window and the scripts are just fine. Now when I delete the Sql statements that show in the EM, and paste the old complete code back in, it looks ok in design, and will run ok with the !(Bang). But when I save it and reopen in Design it looks corrupt again. I will test deleting the View, closing the EM, the reopening and recreating with Sql Server Query Analyzer. One poster recommended that. Sql Server is running on an NT 4 server with the latest NT service pack installed. It jammed up about a week ago and the Administrator brought the server all the way down and back up then did some Admin clean up stuff. I'm working on a database maintained by Epicor (formerly platinum) with about 1,000 tables. Note: I usually combine all the fields and apply universal criteria in a "Base" query, then use it in other specilized queries. When the Base query corrupted (Sql looked good, data looked like poo-poo, I found I had to revise the other queries using it to fix the problem all down the line. Now that the corruption has changed (data looks good, Sql looks like poo-poo) I find I don't have to fix the downline views. Note2: A few tables have too many indexes to link to from an Access Mdb. I found that I can make a view, showing all fields with the table name & "_vw" and get by the index problem. Note3: I've really gotten to like the ADP. It's much more flexible, faster and easier to use for a variety of development tasks. However I also use an Mdb from time to time. Eg. I created a view and wanted to show the records where field 1 didn't equal field 2. I couldn't seem to do it in a view directly so I just exported the view to excel, imported the excel file into an Mdb, and added the criteria and had the answer in about a minute. I might learn how to do that later in an Adp but got the job done quickly by using an Mdb. If anyone has any comments or experience with this I'd appreciate hearing from them. Tom (Viva la Access!!! Long live Jet!!!!) Adams From mbyrd at TWIA.ORG Fri Apr 11 08:03:13 2003 From: mbyrd at TWIA.ORG (Mike Byrd) Date: Fri, 11 Apr 2003 08:03:13 -0500 Subject: [dba-SQLServer]Corrupt views ... (Crossposted at AccessD) Message-ID: <990B6E5F5173444CBD884E164F1333EC5757B3@bearcat.twia.org> I've had problems when I have a view dependent on another view and the dependent view changes. This then corrupts the first view. I've fixed it by dropping and recreating the first view. Otherwise I (we) have noticed no problems with views in SQL 7 Cheers, Mike Byrd > -----Original Message----- > From: Tom Adams [mailto:tomadatn at bellsouth.net] > Sent: Friday, April 11, 2003 8:01 AM > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer]Corrupt views ... (Crossposted at AccessD) > > > I've posted a couple of items asking if anyone has had any > problems with Sql 7 and corrupt views. > > So far no one else seems to have found this bug/feature. > Plowing ahead with this first in the universe coverage (you > heard it here > first folks!), I thought I'd bring you up to date. > > At first I thought it might be caused by Access 2000 ADP. I > used both that and the Enterprise manager to make changes in views. I > then decided to eliminate the Access question by never > changing a view with Access, just using it to review data > (Being able to sort > is absolutely essential in my opinion. Although the view can > not be sorted, you can move columns around and then wipe as many as > you wish and hit the A-Z button. Wonderful really.). > > I can now report that I am still hitting corrupt views. > However they're a little different now. Now I open them > (it's mainly one > complicated view now) in Enterprise Manager and the Sql view > looks corrupt. It cuts off before the From and following parts. > However it runs ok (Previously the view looked ok but showed > bad data. Any change at that point would correct it - eg. take out a > field and put it back in.) > > Note that I can still generate Sql scripts from the database > window and the scripts are just fine. > > Now when I delete the Sql statements that show in the EM, and > paste the old complete code back in, it looks ok in design, and will > run ok with the !(Bang). But when I save it and reopen in > Design it looks corrupt again. > > I will test deleting the View, closing the EM, the reopening > and recreating with Sql Server Query Analyzer. One poster recommended > that. > > Sql Server is running on an NT 4 server with the latest NT > service pack installed. It jammed up about a week ago and the > Administrator brought the server all the way down and back up > then did some Admin clean up stuff. I'm working on a database > maintained by Epicor (formerly platinum) with about 1,000 tables. > > Note: I usually combine all the fields and apply universal > criteria in a "Base" query, then use it in other specilized queries. > When the Base query corrupted (Sql looked good, data looked > like poo-poo, I found I had to revise the other queries using > it to fix > the problem all down the line. Now that the corruption has > changed (data looks good, Sql looks like poo-poo) I find I > don't have to > fix the downline views. > > Note2: A few tables have too many indexes to link to from an > Access Mdb. I found that I can make a view, showing all fields with > the table name & "_vw" and get by the index problem. > > Note3: I've really gotten to like the ADP. It's much more > flexible, faster and easier to use for a variety of development tasks. > However I also use an Mdb from time to time. Eg. I created > a view and wanted to show the records where field 1 didn't equal field > 2. I couldn't seem to do it in a view directly so I just > exported the view to excel, imported the excel file into an > Mdb, and added > the criteria and had the answer in about a minute. I might > learn how to do that later in an Adp but got the job done quickly by > using an Mdb. > > > If anyone has any comments or experience with this I'd > appreciate hearing from them. > > Tom (Viva la Access!!! Long live Jet!!!!) Adams > > > _______________________________________________ > 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 Fri Apr 11 11:14:33 2003 From: artful at rogers.com (Arthur Fuller) Date: Fri, 11 Apr 2003 12:14:33 -0400 Subject: [dba-SQLServer]Corrupt views ... (Crossposted at AccessD) In-Reply-To: <000e01c3002a$723331d0$6400000a@dogbert2k> Message-ID: <000101c30045$707a42f0$8e01a8c0@Rock> Do any of your views use "SELECT *"? I can't prove it but I suspect that SQL does some undercover optimizations on such statements, and when a column is inserted after the fact there are occasional problems. I have mixed results on this, which is why I say I can't prove it, but I never use "SELECT *" anymore; I always click every single column that I need and go from there, and this seems to make the problems go away. A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Tom Adams Sent: April 11, 2003 9:01 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Corrupt views ... (Crossposted at AccessD) I've posted a couple of items asking if anyone has had any problems with Sql 7 and corrupt views. So far no one else seems to have found this bug/feature. Plowing ahead with this first in the universe coverage (you heard it here first folks!), I thought I'd bring you up to date. At first I thought it might be caused by Access 2000 ADP. I used both that and the Enterprise manager to make changes in views. I then decided to eliminate the Access question by never changing a view with Access, just using it to review data (Being able to sort is absolutely essential in my opinion. Although the view can not be sorted, you can move columns around and then wipe as many as you wish and hit the A-Z button. Wonderful really.). I can now report that I am still hitting corrupt views. However they're a little different now. Now I open them (it's mainly one complicated view now) in Enterprise Manager and the Sql view looks corrupt. It cuts off before the From and following parts. However it runs ok (Previously the view looked ok but showed bad data. Any change at that point would correct it - eg. take out a field and put it back in.) Note that I can still generate Sql scripts from the database window and the scripts are just fine. Now when I delete the Sql statements that show in the EM, and paste the old complete code back in, it looks ok in design, and will run ok with the !(Bang). But when I save it and reopen in Design it looks corrupt again. I will test deleting the View, closing the EM, the reopening and recreating with Sql Server Query Analyzer. One poster recommended that. Sql Server is running on an NT 4 server with the latest NT service pack installed. It jammed up about a week ago and the Administrator brought the server all the way down and back up then did some Admin clean up stuff. I'm working on a database maintained by Epicor (formerly platinum) with about 1,000 tables. Note: I usually combine all the fields and apply universal criteria in a "Base" query, then use it in other specilized queries. When the Base query corrupted (Sql looked good, data looked like poo-poo, I found I had to revise the other queries using it to fix the problem all down the line. Now that the corruption has changed (data looks good, Sql looks like poo-poo) I find I don't have to fix the downline views. Note2: A few tables have too many indexes to link to from an Access Mdb. I found that I can make a view, showing all fields with the table name & "_vw" and get by the index problem. Note3: I've really gotten to like the ADP. It's much more flexible, faster and easier to use for a variety of development tasks. However I also use an Mdb from time to time. Eg. I created a view and wanted to show the records where field 1 didn't equal field 2. I couldn't seem to do it in a view directly so I just exported the view to excel, imported the excel file into an Mdb, and added the criteria and had the answer in about a minute. I might learn how to do that later in an Adp but got the job done quickly by using an Mdb. If anyone has any comments or experience with this I'd appreciate hearing from them. Tom (Viva la Access!!! Long live Jet!!!!) Adams _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From CWortz at tea.state.tx.us Fri Apr 11 11:23:20 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Fri, 11 Apr 2003 11:23:20 -0500 Subject: [dba-SQLServer]Corrupt views ... (Crossposted at AccessD) Message-ID: Arthur, As I understand it, you are correct. Your TSQL is compiled and optimized so if you add a column at the end it is not seen by the compiled code. And if you add a column into the middle, it breaks the code. To be safe, always recompile after making any changes to TSQL statements. 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: Arthur Fuller [mailto:artful at rogers.com] Sent: Friday 2003 Apr 11 11:15 To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Corrupt views ... (Crossposted at AccessD) Do any of your views use "SELECT *"? I can't prove it but I suspect that SQL does some undercover optimizations on such statements, and when a column is inserted after the fact there are occasional problems. I have mixed results on this, which is why I say I can't prove it, but I never use "SELECT *" anymore; I always click every single column that I need and go from there, and this seems to make the problems go away. A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Tom Adams Sent: April 11, 2003 9:01 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Corrupt views ... (Crossposted at AccessD) I've posted a couple of items asking if anyone has had any problems with Sql 7 and corrupt views. So far no one else seems to have found this bug/feature. Plowing ahead with this first in the universe coverage (you heard it here first folks!), I thought I'd bring you up to date. At first I thought it might be caused by Access 2000 ADP. I used both that and the Enterprise manager to make changes in views. I then decided to eliminate the Access question by never changing a view with Access, just using it to review data (Being able to sort is absolutely essential in my opinion. Although the view can not be sorted, you can move columns around and then wipe as many as you wish and hit the A-Z button. Wonderful really.). I can now report that I am still hitting corrupt views. However they're a little different now. Now I open them (it's mainly one complicated view now) in Enterprise Manager and the Sql view looks corrupt. It cuts off before the From and following parts. However it runs ok (Previously the view looked ok but showed bad data. Any change at that point would correct it - eg. take out a field and put it back in.) Note that I can still generate Sql scripts from the database window and the scripts are just fine. Now when I delete the Sql statements that show in the EM, and paste the old complete code back in, it looks ok in design, and will run ok with the !(Bang). But when I save it and reopen in Design it looks corrupt again. I will test deleting the View, closing the EM, the reopening and recreating with Sql Server Query Analyzer. One poster recommended that. Sql Server is running on an NT 4 server with the latest NT service pack installed. It jammed up about a week ago and the Administrator brought the server all the way down and back up then did some Admin clean up stuff. I'm working on a database maintained by Epicor (formerly platinum) with about 1,000 tables. Note: I usually combine all the fields and apply universal criteria in a "Base" query, then use it in other specilized queries. When the Base query corrupted (Sql looked good, data looked like poo-poo, I found I had to revise the other queries using it to fix the problem all down the line. Now that the corruption has changed (data looks good, Sql looks like poo-poo) I find I don't have to fix the downline views. Note2: A few tables have too many indexes to link to from an Access Mdb. I found that I can make a view, showing all fields with the table name & "_vw" and get by the index problem. Note3: I've really gotten to like the ADP. It's much more flexible, faster and easier to use for a variety of development tasks. However I also use an Mdb from time to time. Eg. I created a view and wanted to show the records where field 1 didn't equal field 2. I couldn't seem to do it in a view directly so I just exported the view to excel, imported the excel file into an Mdb, and added the criteria and had the answer in about a minute. I might learn how to do that later in an Adp but got the job done quickly by using an Mdb. If anyone has any comments or experience with this I'd appreciate hearing from them. Tom (Viva la Access!!! Long live Jet!!!!) Adams From mmmtbig at bellsouth.net Fri Apr 11 11:44:34 2003 From: mmmtbig at bellsouth.net (Myke Myers) Date: Fri, 11 Apr 2003 12:44:34 -0400 Subject: [dba-SQLServer]Access ADP Error Message-ID: <002e01c30049$a1e33320$6501a8c0@tbig3> I upsized an application from an Access FE / BE to an Access ADP FE / Sql Server 2000 BE. A memo field for Notes became a 'ntext' field in Sql Server. A user is getting a message 'The text is too long to be edited' when she clicks into the Notes field in several records -- records with a lot of data stored in the Notes field. My understanding is that the Sql Server 'ntext' field is limited only by the storage of the server, so I'm guessing that the problem is with the Access Adp FE. Does an Access Adp textbox have a limit on the amount of data it can hold? All suggestions welcome. TIA, Myke -------------- next part -------------- An HTML attachment was scrubbed... URL: From CWortz at tea.state.tx.us Fri Apr 11 12:02:47 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Fri, 11 Apr 2003 12:02:47 -0500 Subject: [dba-SQLServer]Access ADP Error Message-ID: Myke, You may want to look at the user's memo fields and see if you can do some normalization on them. I had a user that was putting a lot of data into memo fields. But once I analyzed the data I saw that over 90% of them represented only about twelve different values. I added a new status field for those 12 values and left the memo field for the others. User liked the decimating of the amount of typing required to fill out the form. 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: Myke Myers [mailto:mmmtbig at bellsouth.net] Sent: Friday 2003 Apr 11 11:45 To: accessd at databaseadvisors.com; dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Access ADP Error I upsized an application from an Access FE / BE to an Access ADP FE / Sql Server 2000 BE. A memo field for Notes became a 'ntext' field in Sql Server. A user is getting a message 'The text is too long to be edited' when she clicks into the Notes field in several records -- records with a lot of data stored in the Notes field. My understanding is that the Sql Server 'ntext' field is limited only by the storage of the server, so I'm guessing that the problem is with the Access Adp FE. Does an Access Adp textbox have a limit on the amount of data it can hold? All suggestions welcome. TIA, Myke From CWortz at tea.state.tx.us Fri Apr 11 12:02:47 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Fri, 11 Apr 2003 12:02:47 -0500 Subject: [dba-SQLServer]Access ADP Error Message-ID: Myke, You may want to look at the user's memo fields and see if you can do some normalization on them. I had a user that was putting a lot of data into memo fields. But once I analyzed the data I saw that over 90% of them represented only about twelve different values. I added a new status field for those 12 values and left the memo field for the others. User liked the decimating of the amount of typing required to fill out the form. 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: Myke Myers [mailto:mmmtbig at bellsouth.net] Sent: Friday 2003 Apr 11 11:45 To: accessd at databaseadvisors.com; dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Access ADP Error I upsized an application from an Access FE / BE to an Access ADP FE / Sql Server 2000 BE. A memo field for Notes became a 'ntext' field in Sql Server. A user is getting a message 'The text is too long to be edited' when she clicks into the Notes field in several records -- records with a lot of data stored in the Notes field. My understanding is that the Sql Server 'ntext' field is limited only by the storage of the server, so I'm guessing that the problem is with the Access Adp FE. Does an Access Adp textbox have a limit on the amount of data it can hold? All suggestions welcome. TIA, Myke _______________________________________________ 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 Fri Apr 11 12:33:03 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Fri, 11 Apr 2003 10:33:03 -0700 Subject: [dba-SQLServer]Access ADP Error References: <657FB70438B7D311AF320090279C180103C5E4FF@EXCHMAIL> Message-ID: <009001c30050$687c5bf0$b615010a@FHTAPIA> I've ran into wierd problems using bound forms in ADP's and n/text datatypes. There is one where when you retreive the record it only displays the first 255 characters and then the remaining data in the textbox is a re-wrap around from the original 255 characters in that field. My workaround was to use nvarchar's up to 4k charcters. Supposedly in Access 2000 you need SR1/a to fixt the problem but that proved unfruitful, and I wasn't about to load SR2... -Francisco http://rcm.netfirms.com On Friday, April 11, 2003 9:44 AM [GMT-8], Myke Myers wrote: : I upsized an application from an Access FE / BE to an Access ADP FE / : Sql Server 2000 BE. : : A memo field for Notes became a 'ntext' field in Sql Server. : : A user is getting a message 'The text is too long to be edited' when : she clicks into the Notes field in several records -- records with a : lot of data stored in the Notes field. My understanding is that the : Sql Server 'ntext' field is limited only by the storage of the : server, so I'm guessing that the problem is with the Access Adp FE. : : Does an Access Adp textbox have a limit on the amount of data it can : hold? : : All suggestions welcome. : : TIA, : Myke From my.lists at verizon.net Fri Apr 11 14:11:12 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Fri, 11 Apr 2003 12:11:12 -0700 Subject: [dba-SQLServer]Re: Sql Server Stored Procedure Questions ... References: <4AAC675EBAF3D411BCA200508BCFAA8E02F2149A@NATEXCH1> <078a01c30059$3d72d110$6400000a@dogbert2k> Message-ID: <00e701c3005e$1e89d0a0$b615010a@FHTAPIA> as this is more of a sql question, I've forwared to the dba-sqlserver list... First, I encourage you to go to microsoft's sql site and download the latest Books on line commonly known as BOL. 2nd, to declare a variable in sql server, you use the keyword "Declare" such as DECLARE varMyVariable AS VARCHAR(10) in Sql 7 you add values to the varchar by using the keyword SELECT, but in 2000 you can use the keyword SET. to step through a returned recordset from a sproc (SP) you would use a cursor, tho I will warn you that they can take a lot of time and are usually not as efficient as other means (ie, memory, cleanup, etc) , think #Temp Tables if you really need to step through things, you'll find that things can be done sooooo much faster this way... any other questions reguarding SP's feel free to post to the dba-SqlServer list :D -Francisco http://rcm.netfirms.com On Friday, April 11, 2003 11:36 AM [GMT-8], Tom Adams wrote: : I've got a few very basic questions for Sql 7 stored procedures. : I've gone through all my saved AccessD's twice and can't figure it : out. I've left my main reference books at home and have 3 more : coming as we type. : : 1. How to declare variables in SP. I con't want to return them, : just use them further into the SP. : 2. How to gen a recordset or SP equvalent and step through it. : : Thanks - Tom : : _______________________________________________ : AccessD mailing list : AccessD at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/accessd : Website: http://www.databaseadvisors.com From mark at sphere.uk.net Sun Apr 13 15:59:36 2003 From: mark at sphere.uk.net (Mark Walker) Date: Mon, 14 Apr 2003 08:59:36 +1200 Subject: [dba-SQLServer]Re: Sql Server Stored Procedure Questions ... In-Reply-To: <00e701c3005e$1e89d0a0$b615010a@FHTAPIA> Message-ID: Except the variable needs to start with the '@' symbol like DECLARE @varMyVariable AS VARCHAR(10) :) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Francisco H Tapia Sent: Saturday, 12 April 2003 7:11 a.m. To: accessd at databaseadvisors.com; dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Re: Sql Server Stored Procedure Questions ... as this is more of a sql question, I've forwared to the dba-sqlserver list... First, I encourage you to go to microsoft's sql site and download the latest Books on line commonly known as BOL. 2nd, to declare a variable in sql server, you use the keyword "Declare" such as DECLARE varMyVariable AS VARCHAR(10) in Sql 7 you add values to the varchar by using the keyword SELECT, but in 2000 you can use the keyword SET. to step through a returned recordset from a sproc (SP) you would use a cursor, tho I will warn you that they can take a lot of time and are usually not as efficient as other means (ie, memory, cleanup, etc) , think #Temp Tables if you really need to step through things, you'll find that things can be done sooooo much faster this way... any other questions reguarding SP's feel free to post to the dba-SqlServer list :D -Francisco http://rcm.netfirms.com On Friday, April 11, 2003 11:36 AM [GMT-8], Tom Adams wrote: : I've got a few very basic questions for Sql 7 stored procedures. : I've gone through all my saved AccessD's twice and can't figure it : out. I've left my main reference books at home and have 3 more : coming as we type. : : 1. How to declare variables in SP. I con't want to return them, : just use them further into the SP. : 2. How to gen a recordset or SP equvalent and step through it. : : Thanks - Tom From harkins at iglou.com Mon Apr 14 17:07:18 2003 From: harkins at iglou.com (Susan Harkins) Date: Mon, 14 Apr 2003 18:07:18 -0400 Subject: [dba-SQLServer]index limits Message-ID: <001001c302db$0aba70f0$d1e6ffcc@SusanOne> I know SQL Server limits a table to one clustered index -- how about nonclustered? Access' limit is 32 -- does SQL Server have a limit on nonclustered indexes in one table? Thanks! Susan H. From my.lists at verizon.net Mon Apr 14 18:20:58 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 14 Apr 2003 16:20:58 -0700 Subject: [dba-SQLServer]index limits References: <001001c302db$0aba70f0$d1e6ffcc@SusanOne> Message-ID: <00c101c302dc$82093cd0$b615010a@FHTAPIA> Susan, >From BOL, Why Not use that vitamin A if you're gonna eat all those carrots Rabbit :D Keyword Create Index.... NONCLUSTERED Creates an object that specifies the logical ordering of a table. With a nonclustered index, the physical order of the rows is independent of their indexed order. The leaf level of a nonclustered index contains index rows. Each index row contains the nonclustered key value and one or more row locators that point to the row that contains the value. If the table does not have a clustered index, the row locator is the row's disk address. If the table does have a clustered index, the row locator is the clustered index key for the row. Each table can have as many as 249 nonclustered indexes (regardless of how they are created: implicitly with PRIMARY KEY and UNIQUE constraints, or explicitly with CREATE INDEX). Each index can provide access to the data in a different sort order. For indexed views, nonclustered indexes can be created only on a view with a clustered index already defined. Thus, the row locator of a nonclustered index on an indexed view is always the clustered key of the row. -Francisco http://rcm.netfirms.com On Monday, April 14, 2003 3:07 PM [GMT-8], Susan Harkins wrote: : I know SQL Server limits a table to one clustered index -- how about : nonclustered? Access' limit is 32 -- does SQL Server have a limit on : nonclustered indexes in one table? Thanks! : : Susan H. From harkins at iglou.com Mon Apr 14 18:22:30 2003 From: harkins at iglou.com (Susan Harkins) Date: Mon, 14 Apr 2003 19:22:30 -0400 Subject: [dba-SQLServer]index limits References: <001001c302db$0aba70f0$d1e6ffcc@SusanOne> <00c101c302dc$82093cd0$b615010a@FHTAPIA> Message-ID: <007801c302dd$0a48ff90$d1e6ffcc@SusanOne> Wow... thanks Franciso -- 249? I'm wondering if this holds for an Access project -- I mean the tables are SQL Server, right? Rabbit wants to know if rootbeer has vitamin A? :) Susan H. > Each table can have as many as 249 nonclustered indexes (regardless of how > they are created: implicitly with PRIMARY KEY and UNIQUE constraints, or > explicitly with CREATE INDEX). Each index can provide access to the data in > a different sort order. From my.lists at verizon.net Mon Apr 14 18:32:07 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 14 Apr 2003 16:32:07 -0700 Subject: [dba-SQLServer]index limits References: <001001c302db$0aba70f0$d1e6ffcc@SusanOne><00c101c302dc$82093cd0$b615010a@FHTAPIA> <007801c302dd$0a48ff90$d1e6ffcc@SusanOne> Message-ID: <00dc01c302de$1074c830$b615010a@FHTAPIA> Susan, in good humor, :), You remember that book you co-authored right, SQL: >From Access to Sql Server?, Access Data Projects are nothing more than Code, and Gui that hook into Sql Server, all the tables, views, sprocs (stored procedures) are held in a Sql Server Engine (be it Sql 7/2000/MSDE 1/2). And you can tell Rabit that caffenie is a good replacement for Vitamin A ;o) (just brute force!!! :D) just remember this, just because a little is good, does not mean that a WHOLE LOT is going to be better, if you find yourself needing 249 indexes in a table, perhaps it's time to look at normalizing your whole DB :) -Francisco http://rcm.netfirms.com On Monday, April 14, 2003 4:22 PM [GMT-8], Susan Harkins wrote: : Wow... thanks Franciso -- 249? I'm wondering if this holds for an : Access project -- I mean the tables are SQL Server, right? Rabbit : wants to know if rootbeer has vitamin A? :) : : Susan H. : : :: Each table can have as many as 249 nonclustered indexes (regardless :: of how they are created: implicitly with PRIMARY KEY and UNIQUE :: constraints, or explicitly with CREATE INDEX). Each index can :: provide access to the data in a different sort order. : : : From harkins at iglou.com Mon Apr 14 18:38:26 2003 From: harkins at iglou.com (Susan Harkins) Date: Mon, 14 Apr 2003 19:38:26 -0400 Subject: [dba-SQLServer]index limits References: <001001c302db$0aba70f0$d1e6ffcc@SusanOne><00c101c302dc$82093cd0$b615010a@FHTAPIA><007801c302dd$0a48ff90$d1e6ffcc@SusanOne> <00dc01c302de$1074c830$b615010a@FHTAPIA> Message-ID: <008c01c302de$f4434370$d1e6ffcc@SusanOne> > in good humor, :), You remember that book you co-authored right, SQL: > >From Access to Sql Server?, Access Data Projects are nothing more than Code, > and Gui that hook into Sql Server, all the tables, views, sprocs (stored > procedures) are held in a Sql Server Engine (be it Sql 7/2000/MSDE 1/2). > And you can tell Rabit that caffenie is a good replacement for Vitamin A ;o) > (just brute force!!! :D) =========I know, but sure as I don't check... you know how that goes. :) Besides, Martin's the SQL Server expert, although I've learned (memorized) a lot. :) Please don't give caffeine to the rabbit... it makes her twitch. :) > > just remember this, just because a little is good, does not mean that a > WHOLE LOT is going to be better, if you find yourself needing 249 indexes in > a table, perhaps it's time to look at normalizing your whole DB :) =========Nah, I'm just looking at rules -- would never, ever work on something so complex it would require that kind of maintenance -- I'd give up my job first -- I don't want to work THAT hard! ;) Susan H. From stuart at lexacorp.com.pg Mon Apr 14 19:00:42 2003 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 15 Apr 2003 10:00:42 +1000 Subject: [dba-SQLServer]index limits In-Reply-To: <007801c302dd$0a48ff90$d1e6ffcc@SusanOne> Message-ID: <3E9BD84A.27067.6511E2@localhost> On 14 Apr 2003 at 19:22, Susan Harkins wrote: > Wow... thanks Franciso -- 249? I'm wondering if this holds for an > Access project -- I mean the tables are SQL Server, right? All the project does is ask SQL Server for the data. It's SQL that uses the indexes to feed it back to the project - It's the same number of Indexes whether you are using a Project or any other sort of front end regardless of what the foront end is built in. >Rabbit > wants to know if rootbeer has vitamin A? :) > Normal rootbeer - not generally But here's a rootbeer that does: Ginseng rootbeer http://www.annoyances.com/rb/blue_sky.shtml -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. From szeller at cce.umn.edu Tue Apr 15 14:05:48 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Tue, 15 Apr 2003 14:05:48 -0500 Subject: [dba-SQLServer]Compiling my adp Message-ID: Access XP, ADP. When I am in a code window, the title bar says "Microsoft Visual Basic - My File Name - My Form/Report Name". But, when I go to Tools menu, the first item listed is "Compile adp1". In all other files, it says "Compile MyFileName". Should I be concerned about this? If so, what should I do about it? --Susan Susan B. Zeller 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 mikedorism at ntelos.net Tue Apr 15 14:30:40 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Tue, 15 Apr 2003 15:30:40 -0400 Subject: [dba-SQLServer]Compiling my adp In-Reply-To: Message-ID: <007401c30385$83950120$9c360cd8@hargrove.internal> You don't need to be concerned about it. What has happened is that the project properties of the database container has changed but the project properties of the code container has not. If you would like to change it to match, go into "Tools \ adp1 Properties" and change the Project name. 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 Susan Zeller Sent: Tuesday, April 15, 2003 3:06 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Compiling my adp Access XP, ADP. When I am in a code window, the title bar says "Microsoft Visual Basic - My File Name - My Form/Report Name". But, when I go to Tools menu, the first item listed is "Compile adp1". In all other files, it says "Compile MyFileName". Should I be concerned about this? If so, what should I do about it? --Susan Susan B. Zeller 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 szeller at cce.umn.edu Tue Apr 15 15:48:54 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Tue, 15 Apr 2003 15:48:54 -0500 Subject: [dba-SQLServer]Compiling my adp Message-ID: Great. One less thing to worry about! --Susan -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Tuesday, April 15, 2003 2:31 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Compiling my adp You don't need to be concerned about it. What has happened is that the project properties of the database container has changed but the project properties of the code container has not. If you would like to change it to match, go into "Tools \ adp1 Properties" and change the Project name. 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 Susan Zeller Sent: Tuesday, April 15, 2003 3:06 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Compiling my adp Access XP, ADP. When I am in a code window, the title bar says "Microsoft Visual Basic - My File Name - My Form/Report Name". But, when I go to Tools menu, the first item listed is "Compile adp1". In all other files, it says "Compile MyFileName". Should I be concerned about this? If so, what should I do about it? --Susan Susan B. Zeller 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 michael.broesdorf at web.de Wed Apr 16 09:47:42 2003 From: michael.broesdorf at web.de (=?US-ASCII?Q?Michael_Brosdorf?=) Date: Wed, 16 Apr 2003 16:47:42 +0200 Subject: [dba-SQLServer]SP question In-Reply-To: Message-ID: Dear group, is it possible to use the result set of a stored procedure in the where clause of another SQL-Statement? Something like: Select * from MyTable where My_ID in (spMySP) (This does not work...) The SP returns a couple of ID's (only one column) TIA, Michael From todd_5036 at msn.com Wed Apr 16 10:07:28 2003 From: todd_5036 at msn.com (Todd Buttrey) Date: Wed, 16 Apr 2003 10:07:28 -0500 Subject: [dba-SQLServer]SP question Message-ID: What does the return from spMySP look like? ----Original Message Follows---- From: Michael Brosdorf Reply-To: dba-sqlserver at databaseadvisors.com To: Subject: [dba-SQLServer]SP question Date: Wed, 16 Apr 2003 16:47:42 +0200 Dear group, is it possible to use the result set of a stored procedure in the where clause of another SQL-Statement? Something like: Select * from MyTable where My_ID in (spMySP) (This does not work...) The SP returns a couple of ID's (only one column) TIA, Michael _______________________________________________ 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 szeller at cce.umn.edu Wed Apr 16 10:07:46 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Wed, 16 Apr 2003 10:07:46 -0500 Subject: [dba-SQLServer]SP question Message-ID: I'm pretty sure you can't do this with a sproc. A user defined function would work great, however. --Susan -----Original Message----- From: Michael Brosdorf [mailto:michael.broesdorf at web.de] Sent: Wednesday, April 16, 2003 9:48 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]SP question Dear group, is it possible to use the result set of a stored procedure in the where clause of another SQL-Statement? Something like: Select * from MyTable where My_ID in (spMySP) (This does not work...) The SP returns a couple of ID's (only one column) TIA, Michael _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From michael.broesdorf at web.de Wed Apr 16 10:21:12 2003 From: michael.broesdorf at web.de (=?iso-8859-1?Q?Michael_Br=F6sdorf?=) Date: Wed, 16 Apr 2003 17:21:12 +0200 Subject: AW: [dba-SQLServer]SP question In-Reply-To: Message-ID: If the sproc is called using the query analyzer, it returns a single column containing a number of rows. Michael -----Urspr?ngliche Nachricht----- Von: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Todd Buttrey Gesendet: Mittwoch, 16. April 2003 17:07 An: dba-sqlserver at databaseadvisors.com Betreff: Re: [dba-SQLServer]SP question What does the return from spMySP look like? ----Original Message Follows---- From: Michael Brosdorf Reply-To: dba-sqlserver at databaseadvisors.com To: Subject: [dba-SQLServer]SP question Date: Wed, 16 Apr 2003 16:47:42 +0200 Dear group, is it possible to use the result set of a stored procedure in the where clause of another SQL-Statement? Something like: Select * from MyTable where My_ID in (spMySP) (This does not work...) The SP returns a couple of ID's (only one column) TIA, Michael _______________________________________________ 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 Robert.Djabarov at usaa.com Wed Apr 16 10:35:53 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 16 Apr 2003 10:35:53 -0500 Subject: [dba-SQLServer]SP question Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF5D@ex02.eagle.usaa.com> Try to avoid using IN. Better replace it with EXISTS. As per "sproc"... Suzan nailed it with her suggestion about using UDF instead. It would look like: Select * from MyTable mt where exists (select * from dbo.fn_myfunction() fn where mt.KeyField = fn.KeyField) Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Michael Br?sdorf [mailto:michael.broesdorf at web.de] Sent: Wednesday, April 16, 2003 10:21 AM To: dba-sqlserver at databaseadvisors.com Subject: AW: [dba-SQLServer]SP question If the sproc is called using the query analyzer, it returns a single column containing a number of rows. Michael -----Urspr?ngliche Nachricht----- Von: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Todd Buttrey Gesendet: Mittwoch, 16. April 2003 17:07 An: dba-sqlserver at databaseadvisors.com Betreff: Re: [dba-SQLServer]SP question What does the return from spMySP look like? ----Original Message Follows---- From: Michael Brosdorf Reply-To: dba-sqlserver at databaseadvisors.com To: Subject: [dba-SQLServer]SP question Date: Wed, 16 Apr 2003 16:47:42 +0200 Dear group, is it possible to use the result set of a stored procedure in the where clause of another SQL-Statement? Something like: Select * from MyTable where My_ID in (spMySP) (This does not work...) The SP returns a couple of ID's (only one column) TIA, Michael _______________________________________________ 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 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From michael.broesdorf at web.de Wed Apr 16 10:46:57 2003 From: michael.broesdorf at web.de (=?iso-8859-1?Q?Michael_Br=F6sdorf?=) Date: Wed, 16 Apr 2003 17:46:57 +0200 Subject: AW: [dba-SQLServer]SP question In-Reply-To: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF5D@ex02.eagle.usaa.com> Message-ID: Thanks for the information. What are the pros and cons of using EXISTS instead of IN? Michael -----Urspr?ngliche Nachricht----- Von: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Djabarov, Robert Gesendet: Mittwoch, 16. April 2003 17:36 An: dba-sqlserver at databaseadvisors.com Betreff: RE: [dba-SQLServer]SP question Try to avoid using IN. Better replace it with EXISTS. As per "sproc"... Suzan nailed it with her suggestion about using UDF instead. It would look like: Select * from MyTable mt where exists (select * from dbo.fn_myfunction() fn where mt.KeyField = fn.KeyField) Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Michael Br?sdorf [mailto:michael.broesdorf at web.de] Sent: Wednesday, April 16, 2003 10:21 AM To: dba-sqlserver at databaseadvisors.com Subject: AW: [dba-SQLServer]SP question If the sproc is called using the query analyzer, it returns a single column containing a number of rows. Michael -----Urspr?ngliche Nachricht----- Von: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Todd Buttrey Gesendet: Mittwoch, 16. April 2003 17:07 An: dba-sqlserver at databaseadvisors.com Betreff: Re: [dba-SQLServer]SP question What does the return from spMySP look like? ----Original Message Follows---- From: Michael Brosdorf Reply-To: dba-sqlserver at databaseadvisors.com To: Subject: [dba-SQLServer]SP question Date: Wed, 16 Apr 2003 16:47:42 +0200 Dear group, is it possible to use the result set of a stored procedure in the where clause of another SQL-Statement? Something like: Select * from MyTable where My_ID in (spMySP) (This does not work...) The SP returns a couple of ID's (only one column) TIA, Michael _______________________________________________ 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 _______________________________________________ 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 Apr 16 12:32:51 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 16 Apr 2003 12:32:51 -0500 Subject: [dba-SQLServer]SP question Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF5F@ex02.eagle.usaa.com> IN causes a table scan and very rarely engages indexes. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Michael Br?sdorf [mailto:michael.broesdorf at web.de] Sent: Wednesday, April 16, 2003 10:47 AM To: dba-sqlserver at databaseadvisors.com Subject: AW: [dba-SQLServer]SP question Thanks for the information. What are the pros and cons of using EXISTS instead of IN? Michael -----Urspr?ngliche Nachricht----- Von: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Djabarov, Robert Gesendet: Mittwoch, 16. April 2003 17:36 An: dba-sqlserver at databaseadvisors.com Betreff: RE: [dba-SQLServer]SP question Try to avoid using IN. Better replace it with EXISTS. As per "sproc"... Suzan nailed it with her suggestion about using UDF instead. It would look like: Select * from MyTable mt where exists (select * from dbo.fn_myfunction() fn where mt.KeyField = fn.KeyField) Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Michael Br?sdorf [mailto:michael.broesdorf at web.de] Sent: Wednesday, April 16, 2003 10:21 AM To: dba-sqlserver at databaseadvisors.com Subject: AW: [dba-SQLServer]SP question If the sproc is called using the query analyzer, it returns a single column containing a number of rows. Michael -----Urspr?ngliche Nachricht----- Von: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Todd Buttrey Gesendet: Mittwoch, 16. April 2003 17:07 An: dba-sqlserver at databaseadvisors.com Betreff: Re: [dba-SQLServer]SP question What does the return from spMySP look like? ----Original Message Follows---- From: Michael Brosdorf Reply-To: dba-sqlserver at databaseadvisors.com To: Subject: [dba-SQLServer]SP question Date: Wed, 16 Apr 2003 16:47:42 +0200 Dear group, is it possible to use the result set of a stored procedure in the where clause of another SQL-Statement? Something like: Select * from MyTable where My_ID in (spMySP) (This does not work...) The SP returns a couple of ID's (only one column) TIA, Michael _______________________________________________ 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 _______________________________________________ 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 artful at rogers.com Wed Apr 16 13:01:35 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 16 Apr 2003 14:01:35 -0400 Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF5F@ex02.eagle.usaa.com> Message-ID: <036a01c30442$384e8b10$8e01a8c0@Rock> To begin, I know next to nothing about network administration, so my questions may be quite foolish. So be it! I'm doing some work for a client, working from home on an Access ADP and hitting the back end (sql 2000) using an IP address, a uid and a pswd. I was given these three items by the network guy at the client's. I fired up the ADP, chose /File/Connection and filled in the data -- and that was that! Total time invested 1 minute, and it works. I can hit the db using EM or Access. I can create sprocs etc. from either. No muss, no fuss, no Terminal Services or Citrix, nothing but an IP a uid and a pswd. What needs to be done to make this happen? I don't don't see a Windows login or anything when I make the connection -- just the standard SQL login. Does their router simply listen for hits on that IP and forward them to SQL for authentication, without doing any Windows-level user checks? Did the network guy create a Windows user for me and that's how I get in? The reason I ask is that I have another client that uses TS to connect remote users to the db, and I no longer see the point in this, given the ease with which I connected to client 1's db. Neither client uses integrated security. Both insist on you typing a pswd before you can hit the db. I want to duplicate client 1's setup on client 2's system. In client 2's case, sql security is all done by means of roles. I am the only member of the role that has access to the raw data; various other roles grant increasing access, from read-only on up. I would love to eliminate TS from client 2's setup and make it just like client 1's. What steps are required? Client 2 details: win2k all around, sql2k on the db server; sql logins for the employees and two other external associates, plus me with admin rights at both the win and sql level. TIA, A. From my.lists at verizon.net Wed Apr 16 13:29:35 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 16 Apr 2003 11:29:35 -0700 Subject: [dba-SQLServer]IP Connection to SQL References: <036a01c30442$384e8b10$8e01a8c0@Rock> Message-ID: <000801c30446$228e0360$b615010a@FHTAPIA> : I fired up the ADP, chose /File/Connection and filled in : the data -- and that was that! Total time invested 1 minute, and it : works. I can hit the db using EM or Access. I can create sprocs etc. : from either. No muss, no fuss, no Terminal Services or Citrix, : nothing but an IP a uid and a pswd. : : What needs to be done to make this happen? : Does their router simply listen for hits on that : IP and forward them to SQL for authentication, without doing any : Windows-level user checks? Did the network guy create a Windows user : for me and that's how I get in? Yes, this is exactly what happens, w/ Sql Server authentication you don't need a domain, just the IP/Port and uid/pwd for the server. Routers/Firewalls have the port opened in this case 1433. What is dangerous about this situation is that port 1433 is a common known port which hackers and script kiddies can use to infiltrate said network. : The reason I ask is that I have another client that uses TS to connect : remote users to the db, and I no longer see the point in this, given : the ease with which I connected to client 1's db. obviously as with any situation it depends... Given that you are using TS you are probably hitting some sort of encryption server that enables the display to be forwarded to you via a VPN of some sort. What this does is provide the recordsets to the local machine on the server (at the client err customer site) if the connection is 10mbs or 100mbs its faster than any internet WAN connection, thus response time can be FASTER... when connecting over the Internet as in the case with customer #1, you are pushing said recordsets over the internet unencrypted and for the whole world to privy. : I would love to eliminate TS from client 2's setup and make it just : like client 1's. What steps are required? I understand your enthusiasm but I regrettably must say that usually the job of data getting in/out is normally the local admin's responsibility and I can't truly argue w/ the TS scenario... -Francisco http://rcm.netfirms.com On Wednesday, April 16, 2003 11:01 AM [GMT-8], Arthur Fuller wrote: From Robert.Djabarov at usaa.com Wed Apr 16 13:51:35 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 16 Apr 2003 13:51:35 -0500 Subject: [dba-SQLServer]IP Connection to SQL Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC01@ex02.eagle.usaa.com> As an alternative to both scenarios (having SQL wide open on 1's client and running TS on 2's client), I would recommend a VPN channel that you would connect to via your normal internet connection. After it's setup, make a shortcut and double-click...That's it! After that you can use your client 1's-like approach, - IP + UID + PWD. Doing so will eliminate the need for TS, and at the same time will not expose your client's databases like in client 1's case. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Wednesday, April 16, 2003 1:02 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]IP Connection to SQL To begin, I know next to nothing about network administration, so my questions may be quite foolish. So be it! I'm doing some work for a client, working from home on an Access ADP and hitting the back end (sql 2000) using an IP address, a uid and a pswd. I was given these three items by the network guy at the client's. I fired up the ADP, chose /File/Connection and filled in the data -- and that was that! Total time invested 1 minute, and it works. I can hit the db using EM or Access. I can create sprocs etc. from either. No muss, no fuss, no Terminal Services or Citrix, nothing but an IP a uid and a pswd. What needs to be done to make this happen? I don't don't see a Windows login or anything when I make the connection -- just the standard SQL login. Does their router simply listen for hits on that IP and forward them to SQL for authentication, without doing any Windows-level user checks? Did the network guy create a Windows user for me and that's how I get in? The reason I ask is that I have another client that uses TS to connect remote users to the db, and I no longer see the point in this, given the ease with which I connected to client 1's db. Neither client uses integrated security. Both insist on you typing a pswd before you can hit the db. I want to duplicate client 1's setup on client 2's system. In client 2's case, sql security is all done by means of roles. I am the only member of the role that has access to the raw data; various other roles grant increasing access, from read-only on up. I would love to eliminate TS from client 2's setup and make it just like client 1's. What steps are required? Client 2 details: win2k all around, sql2k on the db server; sql logins for the employees and two other external associates, plus me with admin rights at both the win and sql level. TIA, A. _______________________________________________ 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 Apr 16 14:00:44 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 16 Apr 2003 15:00:44 -0400 Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: <000801c30446$228e0360$b615010a@FHTAPIA> Message-ID: <037101c3044a$7bc98040$8e01a8c0@Rock> >> Yes, this is exactly what happens, w/ Sql Server authentication you don't need a domain, just the IP/Port and uid/pwd for the server. Routers/Firewalls have the port opened in this case 1433. What is dangerous about this situation is that port 1433 is a common known port which hackers and script kiddies can use to infiltrate said network. What if I use a different port number? Even if I don't, will it matter? In client 1's case, I can see the whole SQL database, but only because I have privileges. I can't see any other machines, or any drives on the server, or anything but the database itself. And I can only get into that with appropriate uid and pswd. So where's the threat? Automated manufacture of logins+pswds? Again, since I know nothing about this level of technology, this might be a really stupid question, but so be it :-) Imagine if you will 3 roles: webUser, Data-Entry and Manager. All that is already set up in SQL. Suppose we tell the router to listen on some different port. I think there are port-sniffers or whatever they're called, but still, if the router simply forwards the incoming traffic to SQL and the traffic fails SQL authentication, where's the risk? A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: April 16, 2003 2:30 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]IP Connection to SQL Yes, this is exactly what happens, w/ Sql Server authentication you don't need a domain, just the IP/Port and uid/pwd for the server. Routers/Firewalls have the port opened in this case 1433. What is dangerous about this situation is that port 1433 is a common known port which hackers and script kiddies can use to infiltrate said network. -Francisco http://rcm.netfirms.com From artful at rogers.com Wed Apr 16 14:03:40 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 16 Apr 2003 15:03:40 -0400 Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC01@ex02.eagle.usaa.com> Message-ID: <037701c3044a$e470baf0$8e01a8c0@Rock> What's involved in your scenario? Purchase of a third-party VPN? Is there enough in win2k to do it? What's the performance hit for a VPN? In what way is client 1's SQL server wide open? Without a uid+pswd you can't get in. I sense that I'm missing something really basic here, but the only way to learn is to ask stupiid questions :-) A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Djabarov, Robert Sent: April 16, 2003 2:52 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]IP Connection to SQL As an alternative to both scenarios (having SQL wide open on 1's client and running TS on 2's client), I would recommend a VPN channel that you would connect to via your normal internet connection. After it's setup, make a shortcut and double-click...That's it! After that you can use your client 1's-like approach, - IP + UID + PWD. Doing so will eliminate the need for TS, and at the same time will not expose your client's databases like in client 1's case. From hagdb at hotmail.com Wed Apr 16 14:21:01 2003 From: hagdb at hotmail.com (howard gramer) Date: Wed, 16 Apr 2003 19:21:01 +0000 Subject: [dba-SQLServer]IP Connection to SQL Message-ID: VPN technology is built into "Windows 2K Server" and "Windows 2K Advanced Server" Automated UN/PW generation is called "Dictionary Attack". More common than you may know! howard gr?mer New York City Telco Data hagdb at hotmail.com Tel: 516-390-5748 >From: "Arthur Fuller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: RE: [dba-SQLServer]IP Connection to SQL >Date: Wed, 16 Apr 2003 15:03:40 -0400 > >What's involved in your scenario? Purchase of a third-party VPN? Is there >enough in win2k to do it? What's the performance hit for a VPN? In what way >is client 1's SQL server wide open? Without a uid+pswd you can't get in. > >I sense that I'm missing something really basic here, but the only way to >learn is to ask stupiid questions :-) > >A. > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Djabarov, >Robert >Sent: April 16, 2003 2:52 PM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]IP Connection to SQL > > >As an alternative to both scenarios (having SQL wide open on 1's client and >running TS on 2's client), I would recommend a VPN channel that you would >connect to via your normal internet connection. After it's setup, make a >shortcut and double-click...That's it! After that you can use your client >1's-like approach, - IP + UID + PWD. Doing so will eliminate the need for >TS, and at the same time will not expose your client's databases like in >client 1's case. > > >_______________________________________________ >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 Wed Apr 16 15:36:45 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 16 Apr 2003 13:36:45 -0700 Subject: [dba-SQLServer]IP Connection to SQL References: <037101c3044a$7bc98040$8e01a8c0@Rock> Message-ID: <004101c30457$e5cfe9e0$b615010a@FHTAPIA> Arthur, the only stupid q's are the ones not asked ;o) Using a diffrent port number helps prevent some of your most common attacks on your server, yes there are port sniffer programs out there designed to exploit the weaknesses in a firewall... After a hacker or script kiddie figures out your port all they have to test access for is the SA account since that is the common uid in all Sql Servers... in fact there are already exploits that are published as .exe packages out there... VPN'ing your connection would be the method to go in order to secure your connection, w/ or w/o TS. The only thing I can think of in favor of TS is that the data is carried between 10-100mbs (depending on your customer's network) over to the TS screen vs, any T1 connection to your machine over the internet, and w/ VPN you have some overhead on the line. -Francisco http://rcm.netfirms.com On Wednesday, April 16, 2003 12:00 PM [GMT-8], Arthur Fuller wrote: ::: Yes, this is exactly what happens, w/ Sql Server authentication you ::: don't : need a domain, just the IP/Port and uid/pwd for the server. : Routers/Firewalls have the port opened in this case 1433. What is : dangerous about this situation is that port 1433 is a common known : port which hackers and script kiddies can use to infiltrate said : network. : : What if I use a different port number? : : Even if I don't, will it matter? In client 1's case, I can see the : whole SQL database, but only because I have privileges. I can't see : any other machines, or any drives on the server, or anything but the : database itself. And I can only get into that with appropriate uid : and pswd. So where's the threat? Automated manufacture of : logins+pswds? : : Again, since I know nothing about this level of technology, this : might be a really stupid question, but so be it :-) : : Imagine if you will 3 roles: webUser, Data-Entry and Manager. All : that is already set up in SQL. Suppose we tell the router to listen : on some different port. I think there are port-sniffers or whatever : they're called, but still, if the router simply forwards the incoming : traffic to SQL and the traffic fails SQL authentication, where's the : risk? : : A. : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Francisco H Tapia : Sent: April 16, 2003 2:30 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]IP Connection to SQL : : : Yes, this is exactly what happens, w/ Sql Server authentication you : don't need a domain, just the IP/Port and uid/pwd for the server. : Routers/Firewalls have the port opened in this case 1433. What is : dangerous about this situation is that port 1433 is a common known : port which hackers and script kiddies can use to infiltrate said : network. : : -Francisco : http://rcm.netfirms.com From Robert.Djabarov at usaa.com Wed Apr 16 15:39:44 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 16 Apr 2003 15:39:44 -0500 Subject: [dba-SQLServer]IP Connection to SQL Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF61@ex02.eagle.usaa.com> I think Howard just beat me to it. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Wednesday, April 16, 2003 2:04 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]IP Connection to SQL What's involved in your scenario? Purchase of a third-party VPN? Is there enough in win2k to do it? What's the performance hit for a VPN? In what way is client 1's SQL server wide open? Without a uid+pswd you can't get in. I sense that I'm missing something really basic here, but the only way to learn is to ask stupiid questions :-) A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Djabarov, Robert Sent: April 16, 2003 2:52 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]IP Connection to SQL As an alternative to both scenarios (having SQL wide open on 1's client and running TS on 2's client), I would recommend a VPN channel that you would connect to via your normal internet connection. After it's setup, make a shortcut and double-click...That's it! After that you can use your client 1's-like approach, - IP + UID + PWD. Doing so will eliminate the need for TS, and at the same time will not expose your client's databases like in client 1's case. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From accessd at shaw.ca Wed Apr 16 15:42:23 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Wed, 16 Apr 2003 13:42:23 -0700 Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: <037101c3044a$7bc98040$8e01a8c0@Rock> Message-ID: Hi Arthur: The port 1433 is only dangerous if you have not upgraded the appropriate SQL patch. No port number is not vulnerable because most intruders simple scan all ports when attempting to gain access. It is not worth trying to change the port value as the port number might be used by some other product, like a game. Also all the clients would have to setup individually as they will automatically be expecting to access the SQL server through that 1433 port number. I personally would not waste my time with changing port numbers, for security but I would turn off the SQL login, 'sa' and setup strong Server side NT authentication. My thoughts Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Arthur Fuller Sent: Wednesday, April 16, 2003 12:01 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]IP Connection to SQL >> Yes, this is exactly what happens, w/ Sql Server authentication you don't need a domain, just the IP/Port and uid/pwd for the server. Routers/Firewalls have the port opened in this case 1433. What is dangerous about this situation is that port 1433 is a common known port which hackers and script kiddies can use to infiltrate said network. What if I use a different port number? Even if I don't, will it matter? In client 1's case, I can see the whole SQL database, but only because I have privileges. I can't see any other machines, or any drives on the server, or anything but the database itself. And I can only get into that with appropriate uid and pswd. So where's the threat? Automated manufacture of logins+pswds? Again, since I know nothing about this level of technology, this might be a really stupid question, but so be it :-) Imagine if you will 3 roles: webUser, Data-Entry and Manager. All that is already set up in SQL. Suppose we tell the router to listen on some different port. I think there are port-sniffers or whatever they're called, but still, if the router simply forwards the incoming traffic to SQL and the traffic fails SQL authentication, where's the risk? A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: April 16, 2003 2:30 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]IP Connection to SQL Yes, this is exactly what happens, w/ Sql Server authentication you don't need a domain, just the IP/Port and uid/pwd for the server. Routers/Firewalls have the port opened in this case 1433. What is dangerous about this situation is that port 1433 is a common known port which hackers and script kiddies can use to infiltrate said network. -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 my.lists at verizon.net Wed Apr 16 16:56:12 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 16 Apr 2003 14:56:12 -0700 Subject: [dba-SQLServer]IP Connection to SQL References: Message-ID: <007d01c30462$ff233770$b615010a@FHTAPIA> this is one area where you can disagree all you like but it is a common practice by most Sql Server dba's (just check out sqlservercentral.com or sswug.org). Changing the port that Sql Server listens on (1433) to anything else, helps avoid your most common attacks by "drive by hackers" if you will. Plus Arthur mentioned that this was for a customer of his, so it's doubtful that a game port would be acceptable in that environment. -Francisco http://rcm.netfirms.com On Wednesday, April 16, 2003 1:42 PM [GMT-8], Jim Lawrence (AccessD) wrote: : Hi Arthur: : : The port 1433 is only dangerous if you have not upgraded the : appropriate SQL patch. No port number is not vulnerable because most : intruders simple scan all ports when attempting to gain access. It is : not worth trying to change the port value as the port number might be : used by some other product, like a game. Also all the clients would : have to setup individually as they will automatically be expecting to : access the SQL server through that 1433 port number. : : I personally would not waste my time with changing port numbers, for : security but I would turn off the SQL login, 'sa' and setup strong : Server side NT authentication. : : My thoughts : Jim : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Arthur : Fuller : Sent: Wednesday, April 16, 2003 12:01 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]IP Connection to SQL : : ::: Yes, this is exactly what happens, w/ Sql Server authentication you ::: don't : need a domain, just the IP/Port and uid/pwd for the server. : Routers/Firewalls have the port opened in this case 1433. What is : dangerous about this situation is that port 1433 is a common known : port which hackers and script kiddies can use to infiltrate said : network. : : What if I use a different port number? : : Even if I don't, will it matter? In client 1's case, I can see the : whole SQL database, but only because I have privileges. I can't see : any other machines, or any drives on the server, or anything but the : database itself. And I can only get into that with appropriate uid : and pswd. So where's the threat? Automated manufacture of : logins+pswds? : : Again, since I know nothing about this level of technology, this : might be a really stupid question, but so be it :-) : : Imagine if you will 3 roles: webUser, Data-Entry and Manager. All : that is already set up in SQL. Suppose we tell the router to listen : on some different port. I think there are port-sniffers or whatever : they're called, but still, if the router simply forwards the incoming : traffic to SQL and the traffic fails SQL authentication, where's the : risk? : : A. : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Francisco H Tapia : Sent: April 16, 2003 2:30 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]IP Connection to SQL : : : Yes, this is exactly what happens, w/ Sql Server authentication you : don't need a domain, just the IP/Port and uid/pwd for the server. : Routers/Firewalls have the port opened in this case 1433. What is : dangerous about this situation is that port 1433 is a common known : port which hackers and script kiddies can use to infiltrate said : network. : : -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 : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From harkins at iglou.com Wed Apr 16 18:44:46 2003 From: harkins at iglou.com (Susan Harkins) Date: Wed, 16 Apr 2003 19:44:46 -0400 Subject: [dba-SQLServer]security and SQL Server Desktop (MSDE) Message-ID: <002c01c30472$482234d0$c8e6ffcc@SusanOne> Anyone out there an expert on apply security via the OSQL command line or pass-through queries -- or any other methods? Susan H. From mmmtbig at bellsouth.net Wed Apr 16 19:23:07 2003 From: mmmtbig at bellsouth.net (Myke Myers) Date: Wed, 16 Apr 2003 20:23:07 -0400 Subject: [dba-SQLServer]FW: Very Useful SQL Tool Message-ID: <003401c30477$8504f5e0$6501a8c0@tbig3> -----Original Message----- From: .Avery Blog [mailto:no address] Posted At: Wednesday, April 16, 2003 3:06 PM Posted To: News Gator Subject: Very Useful SQL Tool http://dotnetweblogs.com/JAvery/posts/5738.aspx With the project I am working I have to maintain a development SQL database, production SQL database, and the scripts to build the database. Of course whenever a change is made to the development server the change has to be made to the scripts and the production server. I was testing the application today on the production server and noticed some inconsistencies in the database that were causing problems with the production application, and I started looking for a way to do some sort of compare between the two servers. The alternative would have been even more testing or manually digging through both databases looking for changes. A friend of mine pointed me to a utility called AdeptSQL Diff. I downloaded the demo version and gave it a shot. After entering both of the databases it showed me the differences between the two, including table differences, stored procedures, and more. It then gave me the option to script the changes from one database to another one item at a time, how cool is that? Needless to say it helped me find and fix the lingering inconsistencies quickly and easily. If you have to maintain multiple databases then this tool is a must. - James -------------- next part -------------- An HTML attachment was scrubbed... URL: From artful at rogers.com Thu Apr 17 08:19:34 2003 From: artful at rogers.com (Arthur Fuller) Date: Thu, 17 Apr 2003 09:19:34 -0400 Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: Message-ID: <040e01c304e3$fd50e3d0$8e01a8c0@Rock> Is the built-in vpn strong enough? How hard is it to set up? Does it have to know the IP of all external users, or will it let in unknown web users (using the limited permissions of that role)? A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of howard gramer Sent: April 16, 2003 3:21 PM To: dba-sqlserver at databaseadvisors.com; artful at rogers.com Subject: RE: [dba-SQLServer]IP Connection to SQL VPN technology is built into "Windows 2K Server" and "Windows 2K Advanced Server" Automated UN/PW generation is called "Dictionary Attack". More common than you may know! From artful at rogers.com Thu Apr 17 08:24:03 2003 From: artful at rogers.com (Arthur Fuller) Date: Thu, 17 Apr 2003 09:24:03 -0400 Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: <004101c30457$e5cfe9e0$b615010a@FHTAPIA> Message-ID: <040f01c304e4$9da97950$8e01a8c0@Rock> Thanks for your patience :-) I believe that client 2 has a firewall set up on a box running freeBSD. I don't know if there is also a VPN. I have no idea how to set one up. They do have win2k server; that's what the sql box is running on. A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: April 16, 2003 4:37 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]IP Connection to SQL Arthur, the only stupid q's are the ones not asked ;o) Using a diffrent port number helps prevent some of your most common attacks on your server, yes there are port sniffer programs out there designed to exploit the weaknesses in a firewall... After a hacker or script kiddie figures out your port all they have to test access for is the SA account since that is the common uid in all Sql Servers... in fact there are already exploits that are published as .exe packages out there... VPN'ing your connection would be the method to go in order to secure your connection, w/ or w/o TS. The only thing I can think of in favor of TS is that the data is carried between 10-100mbs (depending on your customer's network) over to the TS screen vs, any T1 connection to your machine over the internet, and w/ VPN you have some overhead on the line. -Francisco http://rcm.netfirms.com From artful at rogers.com Thu Apr 17 08:43:31 2003 From: artful at rogers.com (Arthur Fuller) Date: Thu, 17 Apr 2003 09:43:31 -0400 Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: Message-ID: <041201c304e7$55909100$8e01a8c0@Rock> That sounds excellent. We're already most of the way there -- sa is already turned off and the client has rules about passwords (no words as such, must mix alpha and non-alpha, >= 10 chars. So, to recap (sanity check)... Tell the firewall to let traffic on 1433 in; tell the router where to direct the traffic to, and let sql security take it from there. Did I leave any steps out? I think I'll cruise MSDN and see what I can learn about setting up the built-in vpn stuff. A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence (AccessD) Sent: April 16, 2003 4:42 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]IP Connection to SQL Hi Arthur: The port 1433 is only dangerous if you have not upgraded the appropriate SQL patch. No port number is not vulnerable because most intruders simple scan all ports when attempting to gain access. It is not worth trying to change the port value as the port number might be used by some other product, like a game. Also all the clients would have to setup individually as they will automatically be expecting to access the SQL server through that 1433 port number. I personally would not waste my time with changing port numbers, for security but I would turn off the SQL login, 'sa' and setup strong Server side NT authentication. My thoughts Jim From artful at rogers.com Thu Apr 17 08:50:59 2003 From: artful at rogers.com (Arthur Fuller) Date: Thu, 17 Apr 2003 09:50:59 -0400 Subject: [dba-SQLServer]security and SQL Server Desktop (MSDE) In-Reply-To: <002c01c30472$482234d0$c8e6ffcc@SusanOne> Message-ID: <041b01c304e8$60edb220$8e01a8c0@Rock> I wouldn't call myself an expert on it, but I'd suggest that you run QA and open the object browser and look at the Common Objects/Security Functions node. You'll see that there are functions to determine if a user is a member of a group, a role and so on. You can add users using the sp_adduser stored procedure. For details run QA, select the Master database and run sp_help sp_adduser in the query window. I'm a big fan of roles. I build them up additively. Public gets little or no access to anything. Data-Entry gets the right to add, update and delete some tables using sprocs and views (no direct access). Management gets access to other sprocs and views that are the datasource for various reports. Developer gets lots more power :-) I can bring the company to its knees if I want, oooohhhh ha ha ha ha ha (evil grin).... A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: April 16, 2003 7:45 PM To: SQLList Subject: [dba-SQLServer]security and SQL Server Desktop (MSDE) Anyone out there an expert on apply security via the OSQL command line or pass-through queries -- or any other methods? Susan H. From hagdb at hotmail.com Thu Apr 17 09:25:22 2003 From: hagdb at hotmail.com (howard gramer) Date: Thu, 17 Apr 2003 14:25:22 +0000 Subject: [dba-SQLServer]IP Connection to SQL Message-ID: Well... Earlier in the week there was a link in a newsletter talking about setting up VPN with Windows Server..darn if I don't recall which one and of course I deleted and it's a gonner! So searching Techrepublic.com "vpn setup windows server" I find this: http://forums.zdnet.com/group/zd.Highspeed.Internet/cnet/cnetnt.tpt/@thread at 2394@F at 1@D-,D at ALL/@article at mark@2394?ROS=1&OC=75 which has a link to this: http://www.wown.com/ where I then went to the "Index" link and found this goldmine of How To, Explanation, and beautiful images regarding *VPN*: http://www.wown.com/j_helmig/vpn.htm Let us know if you find any clear "Setup VPN for Windows Server" type links. howard gr?mer New York City Telco Data hagdb at hotmail.com Tel: 516-390-5748 >From: "Arthur Fuller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: RE: [dba-SQLServer]IP Connection to SQL >Date: Thu, 17 Apr 2003 09:43:31 -0400 > >That sounds excellent. We're already most of the way there -- sa is already >turned off and the client has rules about passwords (no words as such, must >mix alpha and non-alpha, >= 10 chars. > >So, to recap (sanity check)... Tell the firewall to let traffic on 1433 in; >tell the router where to direct the traffic to, and let sql security take >it >from there. Did I leave any steps out? > >I think I'll cruise MSDN and see what I can learn about setting up the >built-in vpn stuff. > >A. > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim >Lawrence (AccessD) >Sent: April 16, 2003 4:42 PM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]IP Connection to SQL _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail From my.lists at verizon.net Thu Apr 17 12:32:29 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 17 Apr 2003 10:32:29 -0700 Subject: [dba-SQLServer]how to update via an ADP... Message-ID: <002501c30507$522d5b40$b615010a@FHTAPIA> Please observer the following two sprocs, in the sproc #1, I have all the data I need but via the ADP (in a subform) this recordset is not updateable... but sproc #2 IS updatable but does not resolve some of the contact names... now, I've set the unique table property to tbl_ccNotes, and that works fine for sproc 2 which is updatable, but sproc #1 is not.... the question is, how can I get sproc #1 to be an updatable recordset? CREATE Procedure stp_ListNotes (@ccID as int) AS SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime], AllUsers.UserType FROM [dbo].[tbl_ccNotes] A INNER JOIN (SELECT UserID, UserName as ContactName, 1 AS UserType From dbo.tblWebUser UNION SELECT ContactID as UserID, ContactName, 0 AS UserType From dbo.tbl_Contacts ) As AllUsers ON (A.UserID = AllUsers.UserID) Where A.ccID = @ccID ORDER BY ccDateTime DESC CREATE Procedure stp_ListNotes (@ccID as int) AS SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime] FROM [dbo].[tbl_ccNotes] A LEFT OUTER JOIN tbl_Contacts As AllUsers ON (A.UserID = AllUsers.ContactID) Where A.ccID = @ccID ORDER BY ccDateTime DESC -Francisco http://rcm.netfirms.com From CWortz at tea.state.tx.us Thu Apr 17 13:13:23 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Thu, 17 Apr 2003 13:13:23 -0500 Subject: [dba-SQLServer]how to update via an ADP... Message-ID: Francisco, This may not be the problem, but it looks funny to me so I ask: If there is the same UserID in both tbl.WebUser and tbl_Contacts, which ContactName or UserType is sproc #1 to try to update if you change the value of AllUsers.ContactName or AllUsers.UserType? 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: Francisco H Tapia [mailto:my.lists at verizon.net] Sent: Thursday 2003 Apr 17 12:32 To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]how to update via an ADP... Please observer the following two sprocs, in the sproc #1, I have all the data I need but via the ADP (in a subform) this recordset is not updateable... but sproc #2 IS updatable but does not resolve some of the contact names... now, I've set the unique table property to tbl_ccNotes, and that works fine for sproc 2 which is updatable, but sproc #1 is not.... the question is, how can I get sproc #1 to be an updatable recordset? CREATE Procedure stp_ListNotes (@ccID as int) AS SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime], AllUsers.UserType FROM [dbo].[tbl_ccNotes] A INNER JOIN (SELECT UserID, UserName as ContactName, 1 AS UserType From dbo.tblWebUser UNION SELECT ContactID as UserID, ContactName, 0 AS UserType From dbo.tbl_Contacts ) As AllUsers ON (A.UserID = AllUsers.UserID) Where A.ccID = @ccID ORDER BY ccDateTime DESC CREATE Procedure stp_ListNotes (@ccID as int) AS SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime] FROM [dbo].[tbl_ccNotes] A LEFT OUTER JOIN tbl_Contacts As AllUsers ON (A.UserID = AllUsers.ContactID) Where A.ccID = @ccID ORDER BY ccDateTime DESC -Francisco http://rcm.netfirms.com From tuxedo_man at hotmail.com Thu Apr 17 13:15:33 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Thu, 17 Apr 2003 18:15:33 +0000 Subject: [dba-SQLServer]how to update via an ADP... Message-ID: Not sure if this works (because I have nothing to test it with) but for Sproc#2, include another left join to the tblWebUser table and use the contactname from tblWebUser only if the contactname is not resolved by the tbl_Contacts table. CREATE Procedure stp_ListNotes (@ccID as int) AS SELECT A.ccID, A.Notes, ISNULL(X.ContactName, Y.UserName) AS ContactName, A.ccDateTime FROM tbl_ccNotes A LEFT OUTER JOIN tbl_Contacts AS X ON (A.UserID = X.ContactID) LEFT OUTER JOIN tblWebUser AS Y ON (A.UserID = Y.UserID) WHERE A.ccID = @ccID ORDER BY ccDateTime DESC HTH Billy >From: "Francisco H Tapia" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]how to update via an ADP... >Date: Thu, 17 Apr 2003 10:32:29 -0700 > >Please observer the following two sprocs, in the sproc #1, I have all the >data I need but via the ADP (in a subform) this recordset is not >updateable... but sproc #2 IS updatable but does not resolve some of the >contact names... now, I've set the unique table property to tbl_ccNotes, >and >that works fine for sproc 2 which is updatable, but sproc #1 is not.... the >question is, how can I get sproc #1 to be an updatable recordset? > >CREATE Procedure stp_ListNotes (@ccID as int) AS > >SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime], >AllUsers.UserType >FROM [dbo].[tbl_ccNotes] A >INNER JOIN (SELECT UserID, UserName as ContactName, 1 AS UserType From >dbo.tblWebUser > UNION > SELECT ContactID as UserID, ContactName, 0 AS UserType From >dbo.tbl_Contacts > ) As AllUsers >ON (A.UserID = AllUsers.UserID) >Where A.ccID = @ccID >ORDER BY ccDateTime DESC > >CREATE Procedure stp_ListNotes (@ccID as int) AS >SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime] >FROM [dbo].[tbl_ccNotes] A >LEFT OUTER JOIN tbl_Contacts As AllUsers >ON (A.UserID = AllUsers.ContactID) >Where A.ccID = @ccID >ORDER BY ccDateTime DESC > >-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 Thu Apr 17 13:34:29 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 17 Apr 2003 11:34:29 -0700 Subject: [dba-SQLServer]how to update via an ADP... References: Message-ID: <004b01c3050f$fc1356c0$b615010a@FHTAPIA> Good question Charles, I neglected to mention that the UserID is a GUID (my bad), thus no possibility of a dup ID :) -Francisco http://rcm.netfirms.com On Thursday, April 17, 2003 11:13 AM [GMT-8], Wortz, Charles wrote: : Francisco, : : This may not be the problem, but it looks funny to me so I ask: If : there is the same UserID in both tbl.WebUser and tbl_Contacts, which : ContactName or UserType is sproc #1 to try to update if you change the : value of AllUsers.ContactName or AllUsers.UserType? : : 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: Francisco H Tapia [mailto:my.lists at verizon.net] : Sent: Thursday 2003 Apr 17 12:32 : To: dba-SQLServer at databaseadvisors.com : Subject: [dba-SQLServer]how to update via an ADP... : : : Please observer the following two sprocs, in the sproc #1, I have all : the data I need but via the ADP (in a subform) this recordset is not : updateable... but sproc #2 IS updatable but does not resolve some of : the contact names... now, I've set the unique table property to : tbl_ccNotes, and that works fine for sproc 2 which is updatable, but : sproc #1 is not.... the question is, how can I get sproc #1 to be an : updatable recordset? : : CREATE Procedure stp_ListNotes (@ccID as int) AS : : SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime], : AllUsers.UserType FROM [dbo].[tbl_ccNotes] A INNER JOIN (SELECT : UserID, UserName as ContactName, 1 AS UserType From dbo.tblWebUser : UNION : SELECT ContactID as UserID, ContactName, 0 AS UserType From : dbo.tbl_Contacts : ) As AllUsers : ON (A.UserID = AllUsers.UserID) : Where A.ccID = @ccID : ORDER BY ccDateTime DESC : : CREATE Procedure stp_ListNotes (@ccID as int) AS : SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime] : FROM [dbo].[tbl_ccNotes] A LEFT OUTER JOIN tbl_Contacts As AllUsers ON : (A.UserID = AllUsers.ContactID) Where A.ccID = @ccID ORDER BY : ccDateTime DESC : : -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 my.lists at verizon.net Thu Apr 17 13:44:13 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 17 Apr 2003 11:44:13 -0700 Subject: [dba-SQLServer]how to update via an ADP... References: Message-ID: <005101c30511$57ea4660$b615010a@FHTAPIA> EUREKA! (or however that's spelled) Thanks Billy, this worked just as you expected!!!!!!!!!!!!!!!!!!!! man this was driving me nuts and you've made my Thursday :) -Francisco http://rcm.netfirms.com On Thursday, April 17, 2003 11:15 AM [GMT-8], Billy Pang wrote: : Not sure if this works (because I have nothing to test it with) but : for Sproc#2, include another left join to the tblWebUser table and : use the contactname from tblWebUser only if the contactname is not : resolved by the tbl_Contacts table. : : CREATE Procedure stp_ListNotes (@ccID as int) AS : SELECT A.ccID, A.Notes, ISNULL(X.ContactName, Y.UserName) AS : ContactName, A.ccDateTime : FROM tbl_ccNotes A LEFT OUTER JOIN tbl_Contacts AS X ON (A.UserID = : X.ContactID) LEFT OUTER JOIN tblWebUser AS Y ON (A.UserID = Y.UserID) : WHERE A.ccID = @ccID : ORDER BY ccDateTime DESC : : HTH : Billy : : : : : : :: From: "Francisco H Tapia" :: Reply-To: dba-sqlserver at databaseadvisors.com :: To: :: Subject: [dba-SQLServer]how to update via an ADP... :: Date: Thu, 17 Apr 2003 10:32:29 -0700 :: :: Please observer the following two sprocs, in the sproc #1, I have :: all the data I need but via the ADP (in a subform) this recordset is :: not updateable... but sproc #2 IS updatable but does not resolve :: some of the contact names... now, I've set the unique table property :: to tbl_ccNotes, and :: that works fine for sproc 2 which is updatable, but sproc #1 is :: not.... the question is, how can I get sproc #1 to be an updatable :: recordset? :: :: CREATE Procedure stp_ListNotes (@ccID as int) AS :: :: SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime], :: AllUsers.UserType :: FROM [dbo].[tbl_ccNotes] A :: INNER JOIN (SELECT UserID, UserName as ContactName, 1 AS UserType :: From dbo.tblWebUser :: UNION :: SELECT ContactID as UserID, ContactName, 0 AS UserType From :: dbo.tbl_Contacts :: ) As AllUsers :: ON (A.UserID = AllUsers.UserID) :: Where A.ccID = @ccID :: ORDER BY ccDateTime DESC :: :: CREATE Procedure stp_ListNotes (@ccID as int) AS :: SELECT A.[ccID], A.[Notes], AllUsers.ContactName, A.[ccDateTime] :: FROM [dbo].[tbl_ccNotes] A :: LEFT OUTER JOIN tbl_Contacts As AllUsers :: ON (A.UserID = AllUsers.ContactID) :: Where A.ccID = @ccID :: ORDER BY ccDateTime DESC :: :: -Francisco :: http://rcm.netfirms.com From accessd at shaw.ca Thu Apr 17 16:27:53 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Thu, 17 Apr 2003 14:27:53 -0700 Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: <007d01c30462$ff233770$b615010a@FHTAPIA> Message-ID: Hi Francisco: Thanks for your input. I have heard so much discussion one way or the other that I simply do not know what to believe. My particular comments were gleamed from a conversation with a system's fellow from MS, itself. Of course, a person on contract to MS is going to support the product, but I did not feel he was not giving their product a blank-cheque, so to speak, but really felt that leaving the ports alone was correct. If you find more information to the contrarily or supporting facts, I would be great appreciative. I may be setting up another site in the near future and will need to make some important decisions. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Francisco H Tapia Sent: Wednesday, April 16, 2003 2:56 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]IP Connection to SQL this is one area where you can disagree all you like but it is a common practice by most Sql Server dba's (just check out sqlservercentral.com or sswug.org). Changing the port that Sql Server listens on (1433) to anything else, helps avoid your most common attacks by "drive by hackers" if you will. Plus Arthur mentioned that this was for a customer of his, so it's doubtful that a game port would be acceptable in that environment. -Francisco http://rcm.netfirms.com On Wednesday, April 16, 2003 1:42 PM [GMT-8], Jim Lawrence (AccessD) wrote: : Hi Arthur: : : The port 1433 is only dangerous if you have not upgraded the : appropriate SQL patch. No port number is not vulnerable because most : intruders simple scan all ports when attempting to gain access. It is : not worth trying to change the port value as the port number might be : used by some other product, like a game. Also all the clients would : have to setup individually as they will automatically be expecting to : access the SQL server through that 1433 port number. : : I personally would not waste my time with changing port numbers, for : security but I would turn off the SQL login, 'sa' and setup strong : Server side NT authentication. : : My thoughts : Jim : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Arthur : Fuller : Sent: Wednesday, April 16, 2003 12:01 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]IP Connection to SQL : : ::: Yes, this is exactly what happens, w/ Sql Server authentication you ::: don't : need a domain, just the IP/Port and uid/pwd for the server. : Routers/Firewalls have the port opened in this case 1433. What is : dangerous about this situation is that port 1433 is a common known : port which hackers and script kiddies can use to infiltrate said : network. : : What if I use a different port number? : : Even if I don't, will it matter? In client 1's case, I can see the : whole SQL database, but only because I have privileges. I can't see : any other machines, or any drives on the server, or anything but the : database itself. And I can only get into that with appropriate uid : and pswd. So where's the threat? Automated manufacture of : logins+pswds? : : Again, since I know nothing about this level of technology, this : might be a really stupid question, but so be it :-) : : Imagine if you will 3 roles: webUser, Data-Entry and Manager. All : that is already set up in SQL. Suppose we tell the router to listen : on some different port. I think there are port-sniffers or whatever : they're called, but still, if the router simply forwards the incoming : traffic to SQL and the traffic fails SQL authentication, where's the : risk? : : A. : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Francisco H Tapia : Sent: April 16, 2003 2:30 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]IP Connection to SQL : : : Yes, this is exactly what happens, w/ Sql Server authentication you : don't need a domain, just the IP/Port and uid/pwd for the server. : Routers/Firewalls have the port opened in this case 1433. What is : dangerous about this situation is that port 1433 is a common known : port which hackers and script kiddies can use to infiltrate said : network. : : -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 : : _______________________________________________ : 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 Mwp.Reid at Queens-Belfast.AC.UK Thu Apr 17 16:36:45 2003 From: Mwp.Reid at Queens-Belfast.AC.UK (Mwp.Reid at Queens-Belfast.AC.UK) Date: Thu, 17 Apr 2003 22:36:45 +0100 (BST) Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: References: Message-ID: <1050615405.3e9f1e6d1c2cd@hosea.qub.ac.uk> This my bounce from the SQL list but this is THE site to read up on this stuff http://www.sqlsecurity.com/DesktopDefault.aspx Kill the sa account and block the port. First two REAL WORLD STEPS TO TAKE. Martin Quoting "Jim Lawrence (AccessD)" : > Hi Francisco: > > Thanks for your input. I have heard so much discussion one way or the > other > that I simply do not know what to believe. My particular comments were > gleamed from a conversation with a system's fellow from MS, itself. Of > course, a person on contract to MS is going to support the product, but > I > did not feel he was not giving their product a blank-cheque, so to > speak, > but really felt that leaving the ports alone was correct. If you find > more > information to the contrarily or supporting facts, I would be great > appreciative. I may be setting up another site in the near future and > will > need to make some important decisions. > > Jim > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of > Francisco H Tapia > Sent: Wednesday, April 16, 2003 2:56 PM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer]IP Connection to SQL > > > this is one area where you can disagree all you like but it is a > common > practice by most Sql Server dba's (just check out sqlservercentral.com > or > sswug.org). Changing the port that Sql Server listens on (1433) to > anything > else, helps avoid your most common attacks by "drive by hackers" if > you > will. Plus Arthur mentioned that this was for a customer of his, so > it's > doubtful that a game port would be acceptable in that environment. > > -Francisco > http://rcm.netfirms.com > > On Wednesday, April 16, 2003 1:42 PM [GMT-8], > Jim Lawrence (AccessD) wrote: > > : Hi Arthur: > : > : The port 1433 is only dangerous if you have not upgraded the > : appropriate SQL patch. No port number is not vulnerable because most > : intruders simple scan all ports when attempting to gain access. It > is > : not worth trying to change the port value as the port number might > be > : used by some other product, like a game. Also all the clients would > : have to setup individually as they will automatically be expecting > to > : access the SQL server through that 1433 port number. > : > : I personally would not waste my time with changing port numbers, for > : security but I would turn off the SQL login, 'sa' and setup strong > : Server side NT authentication. > : > : My thoughts > : Jim > : > : -----Original Message----- > : From: dba-sqlserver-bounces at databaseadvisors.com > : [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of > Arthur > : Fuller > : Sent: Wednesday, April 16, 2003 12:01 PM > : To: dba-sqlserver at databaseadvisors.com > : Subject: RE: [dba-SQLServer]IP Connection to SQL > : > : > ::: Yes, this is exactly what happens, w/ Sql Server authentication > you > ::: don't > : need a domain, just the IP/Port and uid/pwd for the server. > : Routers/Firewalls have the port opened in this case 1433. What is > : dangerous about this situation is that port 1433 is a common known > : port which hackers and script kiddies can use to infiltrate said > : network. > : > : What if I use a different port number? > : > : Even if I don't, will it matter? In client 1's case, I can see the > : whole SQL database, but only because I have privileges. I can't see > : any other machines, or any drives on the server, or anything but the > : database itself. And I can only get into that with appropriate uid > : and pswd. So where's the threat? Automated manufacture of > : logins+pswds? > : > : Again, since I know nothing about this level of technology, this > : might be a really stupid question, but so be it :-) > : > : Imagine if you will 3 roles: webUser, Data-Entry and Manager. All > : that is already set up in SQL. Suppose we tell the router to listen > : on some different port. I think there are port-sniffers or whatever > : they're called, but still, if the router simply forwards the > incoming > : traffic to SQL and the traffic fails SQL authentication, where's the > : risk? > : > : A. > : > : -----Original Message----- > : From: dba-sqlserver-bounces at databaseadvisors.com > : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > : Francisco H Tapia > : Sent: April 16, 2003 2:30 PM > : To: dba-sqlserver at databaseadvisors.com > : Subject: Re: [dba-SQLServer]IP Connection to SQL > : > : > : Yes, this is exactly what happens, w/ Sql Server authentication you > : don't need a domain, just the IP/Port and uid/pwd for the server. > : Routers/Firewalls have the port opened in this case 1433. What is > : dangerous about this situation is that port 1433 is a common known > : port which hackers and script kiddies can use to infiltrate said > : network. > : > : -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 > : > : _______________________________________________ > : 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 Mwp.Reid at Queens-Belfast.AC.UK Thu Apr 17 16:44:57 2003 From: Mwp.Reid at Queens-Belfast.AC.UK (Mwp.Reid at Queens-Belfast.AC.UK) Date: Thu, 17 Apr 2003 22:44:57 +0100 (BST) Subject: [dba-SQLServer]Security Script In-Reply-To: <1050615405.3e9f1e6d1c2cd@hosea.qub.ac.uk> References: <1050615405.3e9f1e6d1c2cd@hosea.qub.ac.uk> Message-ID: <1050615897.3e9f20596d422@hosea.qub.ac.uk> Heres a basic security script from sqlsecurity.com May prove useful to some of you. Martin --SQL Server 2000 Lockdown Script --by Chip Andrews (www.sqlsecurity.com) --12/23/2002 -- --The purpose of this script is to provide administrators (SQL Server or otherwise) a baseline --lockdown configuration for new installations. These settings should disable potentially dangerous --functionality while leaving the server operational and still capabable of Service Pack and hotfix --installations. Feel free to provide feedback at www.sqlsecurity.com if you find any issues or --have any suggestions for improvement. -- --Project Goals: -- * Must support named instances -- * Must not break future Service Pack and hotfixes installations -- * Must strive to disable rarely used functionality but not break common applications (80-20 rule) -- * Must be easily runnable from the command prompt for mass distribution -- --Notes: -- --*You will note that no Extended Stored Procedures have been dropped in the script. This is due to several reasons: -- 1. It causes some problems with Service Packs and hotfix installations when certain functions are disabled -- 2. Blocking access to non-sysadmin users is more easily achieved by dropping execute permissions -- 3. Sysadmins can easily add them back so dropping them really serves no real purpose --*The last script item has been commented out because it effectively blocks all network access to the SQL Server -- and thus violates the 80-20 rule. Feel free to enable it for local-only SQL Server installs. -- -- SET NOCOUNT ON PRINT '*** Begin SQL Server 2000 Lockdown Script v1.0 ***' PRINT '' PRINT 'SERVER NAME : ' + @@SERVERNAME PRINT '' -- -- --Check SQL Server Service Account for LocalSystem Authority - Send warning --It should be noted that it may be possible to create a local account if LocalSystem is found --and alter the service account here in the script. However, since there are also file ACL and registry --permissions to deal with then its probably best left to the Enterprise Manager to do this. CREATE TABLE #user (value VARCHAR(50), data VARCHAR(50)) IF (charindex('\',@@SERVERNAME)=0) INSERT #user EXEC master..xp_regread 'HKEY_LOCAL_MACHINE' ,'SYSTEM\CurrentControlSet\Services\MSS QLSERVER','ObjectName' ELSE BEGIN PRINT 'Note: SQL Server was determined to be a named instance' PRINT '' DECLARE @RegistryPath varchar(200) SET @RegistryPath = 'SYSTEM\CurrentControlSet\Services\MSSQL$' + RIGHT(@@SERVERNAME,LEN(@@SERVERNAME)-CHARINDEX('\',@@SERVERNAME)) INSERT #user EXEC master..xp_regread 'HKEY_LOCAL_MACHINE' , at RegistryPath,'ObjectName' END SELECT TOP 1 DATA AS [SQL Server Service Account] FROM #USER IF (SELECT TOP 1 DATA FROM #user)='LocalSystem' PRINT '*** ALERT LOCALSYSTEM AUTHORITY BEING USED FOR SQL SERVER SERVICE ACCOUNT IS NOT RECOMMENDED. ***' DROP TABLE #user PRINT '' -- -- Confirm the latest service pack and hotfixes have been applied by selecting -- the server version and comparing it to the most current SQL Server -- version (at the time of writing that was 8.00.665 for SQL Server 2000). -- (Although we are not applying the latest patch in this script, we can still -- output a message warning the user of the script to apply the needed patches as long as you capture the output.) SELECT @@version as [SQL Server Version] IF NOT (charindex('8.00.665',@@version)>0) BEGIN print '*** WARNING - SQL Server NOT PROPERLY PATCHED! ***' END GO -- -- Enable Windows Authentication as the only login method to prevent against ?sa? -- account attacks and the weak internal SQL Server authentication model. IF (charindex('\',@@SERVERNAME)=0) EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\MSSQLServer',N'LoginMode ',N'REG_DWORD',1 ELSE BEGIN DECLARE @RegistryPath varchar(200) SET @RegistryPath = 'Software\Microsoft\Microsoft SQL Server\' + RIGHT(@@SERVERNAME,LEN(@@SERVERNAME)-CHARINDEX('\',@@SERVERNAME)) + '\MSSQLServer' EXECUTE master..xp_regwrite 'HKEY_LOCAL_MACHINE', at RegistryPath,N'LoginMode',N'REG_DWORD ',1 END GO -- -- Set strong ?sa? account password (in this case a concatenation of two -- unique identifiers). This password can easily be reset later by using a -- trusted connection while logged in as a local administrator or any user -- who is a member of the System Administrator role. DECLARE @pass char(72) SELECT @pass=convert(char(36),newid())+convert(char(36),newid()) EXECUTE master..sp_password null, at pass,'sa' GO -- -- Enable full auditing to monitor both successful and failed access to the -- SQL Server. You may want to scale this back to failed-only is log space -- is a problem. IF (charindex('\',@@SERVERNAME)=0) EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer',N'AuditLevel',N'REG_DWORD',3 ELSE BEGIN DECLARE @RegistryPath varchar(200) SET @RegistryPath = 'Software\Microsoft\Microsoft SQL Server\' + RIGHT(@@SERVERNAME,LEN(@@SERVERNAME)-CHARINDEX('\',@@SERVERNAME)) + '\MSSQLServer' EXECUTE master..xp_regwrite 'HKEY_LOCAL_MACHINE', at RegistryPath,N'AuditLevel',N'REG_DWOR D',3 END GO -- -- Disable SQLAgent, Microsoft Distributed Transaction Coordinator (MSDTC), and MSSEARCH -- since they may potentially represent unnecessary services. There are no multiple instances of these services. EXECUTE msdb..sp_set_sqlagent_properties @auto_start = 0 GO EXECUTE master..xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\Services\MSDTC', N'Start', N'REG_DWORD', 3 GO EXECUTE master..xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\Services\MSSEARCH', N'Start', N'REG_DWORD', 3 GO -- --Diable adhoc queries for each data provider since this functionality is ripe for abuse. Once again, if --your application requires this you can add the functionality back on a per provider basis. EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Providers\SQLOLEDB',N'Di sallowAdhocAccess',N'REG_DWORD',1 GO EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Providers\Microsoft.Jet. Oledb.4.0',N'DisallowAdhocAccess',N'REG_DWORD',1 GO EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Providers\MSDAORA',N'Dis allowAdhocAccess',N'REG_DWORD',1 GO EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Providers\ADSDSOObject', N'DisallowAdhocAccess',N'REG_DWORD',1 GO EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Providers\DB2OLEDB',N'Di sallowAdhocAccess',N'REG_DWORD',1 GO EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Providers\MSIDXS',N'Disa llowAdhocAccess',N'REG_DWORD',1 GO EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Providers\MSQLImpProv',N 'DisallowAdhocAccess',N'REG_DWORD',1 GO EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Providers\MSSEARCHSQL',N 'DisallowAdhocAccess',N'REG_DWORD',1 GO EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Providers\MSDASQL',N'Dis allowAdhocAccess',N'REG_DWORD',1 GO -- --Remove the pubs and northwind sample databases since they represent known targets with minimal --permissions for potential attackers. USE master DROP DATABASE northwind DROP DATABASE pubs GO -- --Tighten permissions on jobs procedures in case the SQL Agent service is ever activated to prevent low --privilege users from submitting or managing jobs. USE msdb REVOKE execute on sp_add_job to public REVOKE execute on sp_add_jobstep to public REVOKE execute on sp_add_jobserver to public REVOKE execute on sp_start_job to public GO -- --Tighten permissions on web tasks table to keep malicious users from creating or altering tasks. USE msdb REVOKE update on mswebtasks to public REVOKE insert on mswebtasks to public GO -- --Tighten permissions on DTS package connection table so that malicious users cannot affect DTS packages. USE msdb REVOKE select on RTblDBMProps to public REVOKE update on RTblDBMProps to public REVOKE insert on RTblDBMProps to public REVOKE delete on RTblDBMProps to public GO -- --Tighten permissions on extended procedures that require heavy use but should not be allowed public access. USE master REVOKE execute on sp_runwebtask to public REVOKE execute on sp_readwebtask to public REVOKE execute on sp_MSSetServerProperties to public REVOKE execute on sp_MScopyscriptfile to public REVOKE execute on sp_MSsetalertinfo to public REVOKE execute on xp_regread to public REVOKE execute on xp_instance_regread to public GO -- --Revoke guest access to msdb in order to keep any non system administrators from accessing the database without explicit permissions. USE msdb EXECUTE sp_revokedbaccess guest GO -- --Turn off allow remote access to keep other SQL Servers from connecting to this server via RPC. EXECUTE sp_configure 'remote access', '0' GO RECONFIGURE WITH OVERRIDE GO -- --Verify that the capability to allow access to system tables is disabled. EXECUTE sp_configure 'allow updates', '0' GO RECONFIGURE WITH OVERRIDE GO -- --Increase SQL Server log history threshold in order to maintain logs for a longer amount of time. IF (charindex('\',@@SERVERNAME)=0) EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\MSSQLServer',N'NumErrorL ogs',N'REG_DWORD',365 ELSE BEGIN DECLARE @RegistryPath varchar(200) SET @RegistryPath = 'Software\Microsoft\Microsoft SQL Server\' + RIGHT(@@SERVERNAME,LEN(@@SERVERNAME)-CHARINDEX('\',@@SERVERNAME)) + '\MSSQLServer' EXECUTE master..xp_regwrite 'HKEY_LOCAL_MACHINE', at RegistryPath,N'NumErrorLogs',N'REG_DW ORD',365 END GO -- --Remove any residual setup files (\sqldir\setup.iss - \winnt\setup.iss - \winnt\sqlstp.log) that may be --lingering on the file system. These scripts now include system variables thanks to Carlos Moran EXECUTE master.dbo.xp_cmdshell 'if exist %windir%\setup.iss del %Windir% \setup.iss' GO EXECUTE master.dbo.xp_cmdshell 'if exist %windir%\sqlstp.log del %Windir% \sqlstp.log' GO EXECUTE master.dbo.xp_cmdshell 'if exist "%ProgramFiles%\microsoft sql server\mssql\install\setup.iss" del "%ProgramFiles%\microsoft sql server\mssql\install\setup.iss"' GO -- --Remove any un-used network libraries. Since this is a hardened server, all netlibs can be removed until --external connectivity requirements are identified. Connections to the local server are still possible --using the Shared Memeory netlib which is always in effect by specifiying ?(local)? or (a period) as --the server name. The other netlibs can easily be restored using the Server Network Utility. --(You must stop and restart the SQL Server for this change to go into effect) --This step effectively blocks all network access to this SQL Server. Please be advised of this before --applying this step. --NOTE: This step has been removed by default. Feel free to add it when applying to local-only installations --such as MSDE applications or Visual Studio.NET/.NET SDK installs -- --EXECUTE master.dbo.xp_regwrite N'HKEY_LOCAL_MACHINE',N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\SuperSocketN etLib', N'ProtocolList',N'REG_SZ','' --GO -- -- PRINT '*** Please Stop and Start the SQL Server Service Instance in order to implement changes ***' PRINT '' PRINT '*** End SQL Server 2000 Lockdown Script ***' From artful at rogers.com Thu Apr 17 16:52:30 2003 From: artful at rogers.com (Arthur Fuller) Date: Thu, 17 Apr 2003 17:52:30 -0400 Subject: [dba-SQLServer]IP Connection to SQL In-Reply-To: <1050615405.3e9f1e6d1c2cd@hosea.qub.ac.uk> Message-ID: <048b01c3052b$a4f3f590$8e01a8c0@Rock> Kewl. Tanks foda link. A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mwp.Reid at Queens-Belfast.AC.UK Sent: April 17, 2003 5:37 PM To: dba-sqlserver at databaseadvisors.com; Jim Lawrence (AccessD) Subject: RE: [dba-SQLServer]IP Connection to SQL This my bounce from the SQL list but this is THE site to read up on this stuff http://www.sqlsecurity.com/DesktopDefault.aspx Kill the sa account and block the port. First two REAL WORLD STEPS TO TAKE. Martin From my.lists at verizon.net Thu Apr 17 18:08:10 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 17 Apr 2003 16:08:10 -0700 Subject: [dba-SQLServer] Re: [AccessD] Access 2000 - ADP - Open View very slowwwww... References: <000301c3051b$a317aec0$6400000a@dogbert2k> Message-ID: <00e101c30536$37640320$b615010a@FHTAPIA> Note: Sprocs run faster than views in SQL Server, that's because the engine keeps the compiled version in cache and gives better performance. IIRC, the views are not indexed, thus you hitting the previous views based of indexed tables you are taking a performance hits... try posting the query (view) on the sqlserver list for more analysis :) -Francisco http://rcm.netfirms.com On Thursday, April 17, 2003 12:57 PM [GMT-8], Tom Adams wrote: : Against Sql Server 7 with latest service packs running on an NT4 : machine with the latest service packs. : : I've got a view that is based on 2 other views and has a Case : statement in it. : : It runs in about 5-10 seconds in Enterprise Manager but is timing : out/hanging up in Access. : : Any ideas??? : : Thanks - Tom : : : _______________________________________________ : AccessD mailing list : AccessD at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/accessd : Website: http://www.databaseadvisors.com From mmaddison at optusnet.com.au Sat Apr 19 21:47:48 2003 From: mmaddison at optusnet.com.au (Michael Maddison) Date: Sun, 20 Apr 2003 12:47:48 +1000 Subject: [dba-SQLServer]Execution Plans? Message-ID: Hi guys, I'm looking for resources that will explain to me what I am seeing when I look at Execution plans in QA, what is good, bad or just ugly :-) cheers Michael M From artful at rogers.com Tue Apr 22 08:39:15 2003 From: artful at rogers.com (Arthur Fuller) Date: Tue, 22 Apr 2003 09:39:15 -0400 Subject: [dba-SQLServer]TableDiff Message-ID: <015901c308d4$913bcc10$8e01a8c0@Rock> Anyone got any code that will diff two similar tables? Or do I have to write it myself? :-) TIA, A. From CWortz at tea.state.tx.us Tue Apr 22 08:46:02 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Tue, 22 Apr 2003 08:46:02 -0500 Subject: [dba-SQLServer]TableDiff Message-ID: Arthur, What kind of differences are you looking for? Different column names, different column datatypes, different values in same type columns, etc.? And although this is supposed to be a SQL Server list, many of the questions are about Access or VB, so what database? Depending on your answers there may be existing tools to solve your problem. 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: Arthur Fuller [mailto:artful at rogers.com] Sent: Tuesday 2003 Apr 22 08:39 To: dba-SQLServer Subject: [dba-SQLServer]TableDiff Anyone got any code that will diff two similar tables? Or do I have to write it myself? :-) TIA, A. From artful at rogers.com Tue Apr 22 09:26:51 2003 From: artful at rogers.com (Arthur Fuller) Date: Tue, 22 Apr 2003 10:26:51 -0400 Subject: [dba-SQLServer]TableDiff In-Reply-To: Message-ID: <017a01c308db$379de2e0$8e01a8c0@Rock> Sorry, Charles. What I meant was structural differences between two SQL tables. I suppose I can write it with ADOX but I wondered if anyone had already done so. Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Wortz, Charles Sent: April 22, 2003 9:46 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]TableDiff Arthur, What kind of differences are you looking for? Different column names, different column datatypes, different values in same type columns, etc.? And although this is supposed to be a SQL Server list, many of the questions are about Access or VB, so what database? Depending on your answers there may be existing tools to solve your problem. 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 From fhtapia at hotmail.com Tue Apr 22 15:31:20 2003 From: fhtapia at hotmail.com (Francisco H Tapia) Date: Tue, 22 Apr 2003 13:31:20 -0700 Subject: [dba-SQLServer]TableDiff References: <017a01c308db$379de2e0$8e01a8c0@Rock> Message-ID: would this be helpful? http://www.adeptsql.com/ -Francisco http://rcm.netfirms.com On Tuesday, April 22, 2003 7:26 AM [GMT-8], Arthur Fuller wrote: : Sorry, Charles. What I meant was structural differences between two : SQL tables. I suppose I can write it with ADOX but I wondered if : anyone had already done so. : : Arthur : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Wortz, Charles : Sent: April 22, 2003 9:46 AM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]TableDiff : : : Arthur, : : What kind of differences are you looking for? Different column names, : different column datatypes, different values in same type columns, : etc.? And although this is supposed to be a SQL Server list, many of : the questions are about Access or VB, so what database? : : Depending on your answers there may be existing tools to solve your : problem. : : 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 : : : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From Fredrick_Antony at Dell.com Wed Apr 23 01:56:24 2003 From: Fredrick_Antony at Dell.com (Fredrick_Antony at Dell.com) Date: Wed, 23 Apr 2003 01:56:24 -0500 Subject: [dba-SQLServer]SQL Mail Message-ID: Hi ALL I have setup my SQL Mail in the server. When I do xp_sendmail from query analyser, it works and I am getting mail But If I put the same command in Job step, it doesn't work. No error message also. The job just runs and comes out. There is no job history updated Can anyone help me on this issue ? Regards Fred From andrew.haslett at ilc.gov.au Wed Apr 23 02:05:38 2003 From: andrew.haslett at ilc.gov.au (Haslett, Andrew) Date: Wed, 23 Apr 2003 16:35:38 +0930 Subject: [dba-SQLServer]SQL Mail Message-ID: Perhaps the permissions that the job is running under are not sufficient? -----Original Message----- From: Fredrick_Antony at Dell.com [mailto:Fredrick_Antony at Dell.com] Sent: Wednesday, 23 April 2003 4:26 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]SQL Mail Hi ALL I have setup my SQL Mail in the server. When I do xp_sendmail from query analyser, it works and I am getting mail But If I put the same command in Job step, it doesn't work. No error message also. The job just runs and comes out. There is no job history updated Can anyone help me on this issue ? Regards Fred _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com IMPORTANT - PLEASE READ ******************** This email and any files transmitted with it are confidential and may contain information protected by law from disclosure. If you have received this message in error, please notify the sender immediately and delete this email from your system. No warranty is given that this email or files, if attached to this email, are free from computer viruses or other defects. They are provided on the basis the user assumes all responsibility for loss, damage or consequence resulting directly or indirectly from their use, whether caused by the negligence of the sender or not. From Fredrick_Antony at Dell.com Wed Apr 23 05:04:11 2003 From: Fredrick_Antony at Dell.com (Fredrick_Antony at Dell.com) Date: Wed, 23 Apr 2003 05:04:11 -0500 Subject: [dba-SQLServer]SQL Mail Message-ID: Thanks but when I checked the permissions, the services are started with an account which has admin privilage. Fianlly I had to restart my server. It started working firn after that Regards Fred -----Original Message----- From: Haslett, Andrew [mailto:andrew.haslett at ilc.gov.au] Sent: Wednesday, April 23, 2003 12:36 PM To: 'dba-sqlserver at databaseadvisors.com' Subject: RE: [dba-SQLServer]SQL Mail Perhaps the permissions that the job is running under are not sufficient? -----Original Message----- From: Fredrick_Antony at Dell.com [mailto:Fredrick_Antony at Dell.com] Sent: Wednesday, 23 April 2003 4:26 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]SQL Mail Hi ALL I have setup my SQL Mail in the server. When I do xp_sendmail from query analyser, it works and I am getting mail But If I put the same command in Job step, it doesn't work. No error message also. The job just runs and comes out. There is no job history updated Can anyone help me on this issue ? Regards Fred _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com IMPORTANT - PLEASE READ ******************** This email and any files transmitted with it are confidential and may contain information protected by law from disclosure. If you have received this message in error, please notify the sender immediately and delete this email from your system. No warranty is given that this email or files, if attached to this email, are free from computer viruses or other defects. They are provided on the basis the user assumes all responsibility for loss, damage or consequence resulting directly or indirectly from their use, whether caused by the negligence of the sender or not. _______________________________________________ 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 Wed Apr 23 08:12:14 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Wed, 23 Apr 2003 09:12:14 -0400 Subject: [dba-SQLServer]Pass Parameters to Sproc Message-ID: I know this is probably a simple thing to do. I also know I've seen this post show up quite a few times on this list. I tried accessing the archives, but the site seems to be down. What is the proper syntax for passing 2 parameters to a stored procedure from a module? I believe I have the sproc syntax fine for receiving the parameters, but I can't seem to get the code syntax to send them. TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From harkins at iglou.com Wed Apr 23 09:03:53 2003 From: harkins at iglou.com (Susan Harkins) Date: Wed, 23 Apr 2003 10:03:53 -0400 Subject: [dba-SQLServer]Pass Parameters to Sproc References: Message-ID: <00cf01c309a3$2a6383f0$a4e6ffcc@SusanOne> EXECUTE spname parameter1, parameter2 ConnectionProject.Connection.Execute spname parameter1, parameter2 ???? Susan H. I know this is probably a simple thing to do. I also know I've seen this post show up quite a few times on this list. I tried accessing the archives, but the site seems to be down. What is the proper syntax for passing 2 parameters to a stored procedure from a module? I believe I have the sproc syntax fine for receiving the parameters, but I can't seem to get the code syntax to send them. TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. ------------------------------------------------------------------------------ _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From MarkBoyd at McBeeAssociates.com Wed Apr 23 09:47:15 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Wed, 23 Apr 2003 10:47:15 -0400 Subject: [dba-SQLServer]Pass Parameters to Sproc Message-ID: Susan - Thanks for the reply. I think I figured it out. My problem was with using the 'cmd.parameters.append...' code. I wasn't specifying the size (length) of the parameter. Although, your example seems a lot easier and straightforward. Thanks again, Mark -----Original Message----- From: Susan Harkins [mailto:harkins at iglou.com] Sent: Wednesday, April 23, 2003 10:04 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Pass Parameters to Sproc EXECUTE spname parameter1, parameter2 ConnectionProject.Connection.Execute spname parameter1, parameter2 ???? Susan H. I know this is probably a simple thing to do. I also know I've seen this post show up quite a few times on this list. I tried accessing the archives, but the site seems to be down. What is the proper syntax for passing 2 parameters to a stored procedure from a module? I believe I have the sproc syntax fine for receiving the parameters, but I can't seem to get the code syntax to send them. TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. _____ _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From MarkBoyd at McBeeAssociates.com Wed Apr 23 10:43:10 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Wed, 23 Apr 2003 11:43:10 -0400 Subject: [dba-SQLServer]Nz in a SQL Query Message-ID: Is there another way to express the Nz function in a SQL query? For example, how would I calculate the following: 'UPDATE tblTable1 SET [tblTable1].[Col1] = nz([Col2]) + nz([Col3])' TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at denverdb.com Wed Apr 23 11:19:58 2003 From: chris at denverdb.com (Chris Mackin) Date: Wed, 23 Apr 2003 10:19:58 -0600 Subject: [dba-SQLServer]Nz in a SQL Query In-Reply-To: <1051112889.2667@server86.switchfast.com> Message-ID: <1051115045.17772@server86.switchfast.com> Look into using the T-SQL IsNull function. Chris Mackin Denver Database Consulting, LLC www.denverdb.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mark Boyd Sent: Wednesday, April 23, 2003 9:43 AM To: SQLServerList Subject: [dba-SQLServer]Nz in a SQL Query Is there another way to express the Nz function in a SQL query? For example, how would I calculate the following: 'UPDATE tblTable1 SET [tblTable1].[Col1] = nz([Col2]) + nz([Col3])' TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. From accessd at shaw.ca Wed Apr 23 12:33:25 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Wed, 23 Apr 2003 10:33:25 -0700 Subject: [dba-SQLServer]EM In-Reply-To: Message-ID: Hi All: My Enterprise Manager has virtually ground to a halt. It does run but super slow. The SQL 2000 server that it is currently interfacing with appears to be running OK because I have been able to test from various applications. I have been debating whether to dump everything and re-install from scratch. Has anyone ran into something like this? Can I just install the EM? (I have ran into this some years ago with SQL 7 and its' EM. Clearing the workstation and re-installing the manager solved the problem...) MTIA Jim From my.lists at verizon.net Wed Apr 23 13:09:09 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 23 Apr 2003 11:09:09 -0700 Subject: [dba-SQLServer]EM References: Message-ID: <007401c309c3$70549550$b615010a@FHTAPIA> What else is happening on your PC?, are you running MS Outlook? I have found IT to be the main culprit behind many of my problems w/ EM and QA (not to mention a few others). Mostly when processing rules it seems to lock up a whole lot of other apps. -Francisco http://rcm.netfirms.com On Wednesday, April 23, 2003 10:33 AM [GMT-8], Jim Lawrence (AccessD) wrote: : Hi All: : : My Enterprise Manager has virtually ground to a halt. It does run but : super slow. The SQL 2000 server that it is currently interfacing with : appears to be running OK because I have been able to test from : various applications. I have been debating whether to dump everything : and re-install from scratch. : : Has anyone ran into something like this? Can I just install the EM? : (I have ran into this some years ago with SQL 7 and its' EM. Clearing : the workstation and re-installing the manager solved the problem...) : : MTIA : Jim : : _______________________________________________ : 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 Apr 23 13:30:49 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 23 Apr 2003 13:30:49 -0500 Subject: [dba-SQLServer]EM Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF70@ex02.eagle.usaa.com> I'm using 2 to 3 sessions of EM while Outlook receives email from 7 accounts with multiple hierarchical rules and don't seem to be having any problems. It was this way with SP2 and is now with SP3 MSDE. Along with those 2 apps I am also running DBArtisan, ERStudio, SQLCompare, and 3 to 4 VB projects in IDE. All this on a Compaq laptop. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Francisco H Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, April 23, 2003 1:09 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]EM What else is happening on your PC?, are you running MS Outlook? I have found IT to be the main culprit behind many of my problems w/ EM and QA (not to mention a few others). Mostly when processing rules it seems to lock up a whole lot of other apps. -Francisco http://rcm.netfirms.com On Wednesday, April 23, 2003 10:33 AM [GMT-8], Jim Lawrence (AccessD) wrote: : Hi All: : : My Enterprise Manager has virtually ground to a halt. It does run but : super slow. The SQL 2000 server that it is currently interfacing with : appears to be running OK because I have been able to test from : various applications. I have been debating whether to dump everything : and re-install from scratch. : : Has anyone ran into something like this? Can I just install the EM? : (I have ran into this some years ago with SQL 7 and its' EM. Clearing : the workstation and re-installing the manager solved the problem...) : : MTIA : Jim : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From accessd at shaw.ca Wed Apr 23 14:03:53 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Wed, 23 Apr 2003 12:03:53 -0700 Subject: [dba-SQLServer]EM In-Reply-To: <007401c309c3$70549550$b615010a@FHTAPIA> Message-ID: Hi Francisco: I am only have the basic Outlook Express, on that server and have never used it. Unfortunately, it doesn't stop there. I am also running, ColdFusion, PHP, Perl, JSP, MySQL, Oracle 9i as well as ASP. ...but everything 'was' running fine... I did install the latest security patches but the EM was already dying... Any insight would be greatly appreciated. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Francisco H Tapia Sent: Wednesday, April 23, 2003 11:09 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]EM What else is happening on your PC?, are you running MS Outlook? I have found IT to be the main culprit behind many of my problems w/ EM and QA (not to mention a few others). Mostly when processing rules it seems to lock up a whole lot of other apps. -Francisco http://rcm.netfirms.com On Wednesday, April 23, 2003 10:33 AM [GMT-8], Jim Lawrence (AccessD) wrote: : Hi All: : : My Enterprise Manager has virtually ground to a halt. It does run but : super slow. The SQL 2000 server that it is currently interfacing with : appears to be running OK because I have been able to test from : various applications. I have been debating whether to dump everything : and re-install from scratch. : : Has anyone ran into something like this? Can I just install the EM? : (I have ran into this some years ago with SQL 7 and its' EM. Clearing : the workstation and re-installing the manager solved the problem...) : : MTIA : Jim : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From MarkBoyd at McBeeAssociates.com Wed Apr 23 16:12:15 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Wed, 23 Apr 2003 17:12:15 -0400 Subject: [dba-SQLServer]Nz in a SQL Query Message-ID: Chris - Thanks for the input. This pretty much does the same thing as using Nz. Mark -----Original Message----- From: Chris Mackin [mailto:chris at denverdb.com] Sent: Wednesday, April 23, 2003 12:20 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Nz in a SQL Query Look into using the T-SQL IsNull function. Chris Mackin Denver Database Consulting, LLC www.denverdb.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mark Boyd Sent: Wednesday, April 23, 2003 9:43 AM To: SQLServerList Subject: [dba-SQLServer]Nz in a SQL Query Is there another way to express the Nz function in a SQL query? For example, how would I calculate the following: 'UPDATE tblTable1 SET [tblTable1].[Col1] = nz([Col2]) + nz([Col3])' TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. _______________________________________________ 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 Apr 23 16:35:20 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 23 Apr 2003 21:35:20 +0000 Subject: [dba-SQLServer]EM Message-ID: When you load EM, is the memory usage for mmc.exe really high? >From: "Jim Lawrence (AccessD)" >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]EM >Date: Wed, 23 Apr 2003 12:03:53 -0700 > >Hi Francisco: > >I am only have the basic Outlook Express, on that server and have never >used >it. Unfortunately, it doesn't stop there. I am also running, ColdFusion, >PHP, Perl, JSP, MySQL, Oracle 9i as well as ASP. ...but everything 'was' >running fine... I did install the latest security patches but the EM was >already dying... > >Any insight would be greatly appreciated. >Jim > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of >Francisco H Tapia >Sent: Wednesday, April 23, 2003 11:09 AM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer]EM > > >What else is happening on your PC?, are you running MS Outlook? I have >found IT to be the main culprit behind many of my problems w/ EM and QA >(not >to mention a few others). Mostly when processing rules it seems to lock up >a whole lot of other apps. > > >-Francisco >http://rcm.netfirms.com > >On Wednesday, April 23, 2003 10:33 AM [GMT-8], >Jim Lawrence (AccessD) wrote: > >: Hi All: >: >: My Enterprise Manager has virtually ground to a halt. It does run but >: super slow. The SQL 2000 server that it is currently interfacing with >: appears to be running OK because I have been able to test from >: various applications. I have been debating whether to dump everything >: and re-install from scratch. >: >: Has anyone ran into something like this? Can I just install the EM? >: (I have ran into this some years ago with SQL 7 and its' EM. Clearing >: the workstation and re-installing the manager solved the problem...) >: >: MTIA >: Jim >: >: _______________________________________________ >: dba-SQLServer mailing list >: dba-SQLServer at databaseadvisors.com >: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >: http://www.databaseadvisors.com > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From my.lists at verizon.net Wed Apr 23 17:07:09 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 23 Apr 2003 15:07:09 -0700 Subject: [dba-SQLServer]EM References: Message-ID: <009501c309e4$afb00dd0$b615010a@FHTAPIA> This one is a tough one to diagnose, because you see on a Dell 4400 w/ 512 megs of Ram (P4 1.6) the system just comes to a crawl every now and again and only really when I am running Outlook. One thing I found out early on w/ the crappy P4/Dell solutions is that you have to load the damn Intel Accelerator software in order to make the system speed up otherwise it's slower than a Celeron 600, NO JOKE, I do tax my local pc some, I usually will have Outlook Outlook Express EM * 2 QA * 3 or 4 depends Access 2000 * 2 or 3 (depends) ultraVNC Sql Server 2000 Desktop and McAfee A/V (of course)... generally that leaves me w/ an average of 200megs physical ram free. At home by contrast I can have the same number of EM/QA and Access sessions open along with a few IE browser windows open and also SqlServer 2000 desktop plus I may be encoding (compressing) a TV show while another is playing... the home processor is an AMD Athlon XP 2000+ and until recently had only 512 ddr also but now have upgraded it to 1gig ;o). My home pc does all that and still has room to encode some MP3's or anything else I want to throw at it. and I don't get the long pauses that I do here at work. the OS is the same on both systems and I am up to SP2 on both, by contrast the home pc has 3 hdd's for a total of 185gig while the work pc only has 60gig hdd... what OS are you running on your local pc (not the server) -Francisco http://rcm.netfirms.com On Wednesday, April 23, 2003 12:03 PM [GMT-8], Jim Lawrence (AccessD) wrote: : Hi Francisco: : : I am only have the basic Outlook Express, on that server and have : never used it. Unfortunately, it doesn't stop there. I am also : running, ColdFusion, PHP, Perl, JSP, MySQL, Oracle 9i as well as ASP. : ...but everything 'was' running fine... I did install the latest : security patches but the EM was already dying... : : Any insight would be greatly appreciated. : Jim : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of : Francisco H Tapia : Sent: Wednesday, April 23, 2003 11:09 AM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]EM : : : What else is happening on your PC?, are you running MS Outlook? I : have found IT to be the main culprit behind many of my problems w/ EM : and QA (not to mention a few others). Mostly when processing rules : it seems to lock up a whole lot of other apps. : : : -Francisco : http://rcm.netfirms.com : : On Wednesday, April 23, 2003 10:33 AM [GMT-8], : Jim Lawrence (AccessD) wrote: : :: Hi All: :: :: My Enterprise Manager has virtually ground to a halt. It does run but :: super slow. The SQL 2000 server that it is currently interfacing with :: appears to be running OK because I have been able to test from :: various applications. I have been debating whether to dump everything :: and re-install from scratch. :: :: Has anyone ran into something like this? Can I just install the EM? :: (I have ran into this some years ago with SQL 7 and its' EM. Clearing :: the workstation and re-installing the manager solved the problem...) :: :: MTIA :: Jim :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From accessd at shaw.ca Wed Apr 23 18:14:59 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Wed, 23 Apr 2003 16:14:59 -0700 Subject: [dba-SQLServer]EM In-Reply-To: Message-ID: Hi Billy: I do not think so. It uses about 9,670K to start but will exceed 14,000K when running some processes; with a the systems processes added together consume 3% of CPU usage. With all the applications running the system, they all only consume 300MG, about 30 percent of the system recourses. The main drives have about 50% and 15% used. I have not found a way to install EM without going through the whole SQL 2000 installation process...maybe that would work. Any help you can provide would be greatly appreciated. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Billy Pang Sent: Wednesday, April 23, 2003 2:35 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]EM When you load EM, is the memory usage for mmc.exe really high? >From: "Jim Lawrence (AccessD)" >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]EM >Date: Wed, 23 Apr 2003 12:03:53 -0700 > >Hi Francisco: > >I am only have the basic Outlook Express, on that server and have never >used >it. Unfortunately, it doesn't stop there. I am also running, ColdFusion, >PHP, Perl, JSP, MySQL, Oracle 9i as well as ASP. ...but everything 'was' >running fine... I did install the latest security patches but the EM was >already dying... > >Any insight would be greatly appreciated. >Jim > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of >Francisco H Tapia >Sent: Wednesday, April 23, 2003 11:09 AM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer]EM > > >What else is happening on your PC?, are you running MS Outlook? I have >found IT to be the main culprit behind many of my problems w/ EM and QA >(not >to mention a few others). Mostly when processing rules it seems to lock up >a whole lot of other apps. > > >-Francisco >http://rcm.netfirms.com > >On Wednesday, April 23, 2003 10:33 AM [GMT-8], >Jim Lawrence (AccessD) wrote: > >: Hi All: >: >: My Enterprise Manager has virtually ground to a halt. It does run but >: super slow. The SQL 2000 server that it is currently interfacing with >: appears to be running OK because I have been able to test from >: various applications. I have been debating whether to dump everything >: and re-install from scratch. >: >: Has anyone ran into something like this? Can I just install the EM? >: (I have ran into this some years ago with SQL 7 and its' EM. Clearing >: the workstation and re-installing the manager solved the problem...) >: >: MTIA >: Jim >: >: _______________________________________________ >: dba-SQLServer mailing list >: dba-SQLServer at databaseadvisors.com >: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >: http://www.databaseadvisors.com > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Help STOP 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 tuxedo_man at hotmail.com Wed Apr 23 19:19:11 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Thu, 24 Apr 2003 00:19:11 +0000 Subject: [dba-SQLServer]EM Message-ID: Have you tried to install just the client tools on a second machine and have it connect to the SQL Server database? Is SQL Server databse installed on the same machine as EM? do you have the same problems with QA? Do you have auditing turned on? run profiler on the SQL Server database to see if there is anything else happening in the background. Billy >From: "Jim Lawrence (AccessD)" >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]EM >Date: Wed, 23 Apr 2003 16:14:59 -0700 > >Hi Billy: > >I do not think so. It uses about 9,670K to start but will exceed 14,000K >when running some processes; with a the systems processes added together >consume 3% of CPU usage. With all the applications running the system, they >all only consume 300MG, about 30 percent of the system recourses. The main >drives have about 50% and 15% used. > >I have not found a way to install EM without going through the whole SQL >2000 installation process...maybe that would work. Any help you can provide >would be greatly appreciated. > >Jim > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Billy >Pang >Sent: Wednesday, April 23, 2003 2:35 PM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]EM > > >When you load EM, is the memory usage for mmc.exe really high? > > > > > > > >From: "Jim Lawrence (AccessD)" > >Reply-To: dba-sqlserver at databaseadvisors.com > >To: dba-sqlserver at databaseadvisors.com > >Subject: RE: [dba-SQLServer]EM > >Date: Wed, 23 Apr 2003 12:03:53 -0700 > > > >Hi Francisco: > > > >I am only have the basic Outlook Express, on that server and have never > >used > >it. Unfortunately, it doesn't stop there. I am also running, ColdFusion, > >PHP, Perl, JSP, MySQL, Oracle 9i as well as ASP. ...but everything 'was' > >running fine... I did install the latest security patches but the EM was > >already dying... > > > >Any insight would be greatly appreciated. > >Jim > > > >-----Original Message----- > >From: dba-sqlserver-bounces at databaseadvisors.com > >[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of > >Francisco H Tapia > >Sent: Wednesday, April 23, 2003 11:09 AM > >To: dba-sqlserver at databaseadvisors.com > >Subject: Re: [dba-SQLServer]EM > > > > > >What else is happening on your PC?, are you running MS Outlook? I have > >found IT to be the main culprit behind many of my problems w/ EM and QA > >(not > >to mention a few others). Mostly when processing rules it seems to lock >up > >a whole lot of other apps. > > > > > >-Francisco > >http://rcm.netfirms.com > > > >On Wednesday, April 23, 2003 10:33 AM [GMT-8], > >Jim Lawrence (AccessD) wrote: > > > >: Hi All: > >: > >: My Enterprise Manager has virtually ground to a halt. It does run but > >: super slow. The SQL 2000 server that it is currently interfacing with > >: appears to be running OK because I have been able to test from > >: various applications. I have been debating whether to dump everything > >: and re-install from scratch. > >: > >: Has anyone ran into something like this? Can I just install the EM? > >: (I have ran into this some years ago with SQL 7 and its' EM. Clearing > >: the workstation and re-installing the manager solved the problem...) > >: > >: MTIA > >: Jim > >: > >: _______________________________________________ > >: dba-SQLServer mailing list > >: dba-SQLServer at databaseadvisors.com > >: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >: http://www.databaseadvisors.com > > > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > > >_________________________________________________________________ >Help STOP 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 > >_______________________________________________ >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 ecarey at myway.com Thu Apr 24 11:26:14 2003 From: ecarey at myway.com (Elizabeth) Date: Thu, 24 Apr 2003 12:26:14 -0400 (EDT) Subject: [dba-SQLServer]SQL-DMO backup remote database Message-ID: <20030424162614.B50C339F7@xmxpita.myway.com> Hi, I just joined the list, so I apologize if this topic has been covered. I have a situation where we have some packaged-off-the-shelf software called IRIMS that is using MSDE (version 8) for the backend. There appears to be no backup capabilities written in the software, so I am writing some code to handle it ? using SQL-DMO (pretty cool stuff). We are on Windows 2000 machines, locked down for everyone to the power user level. I do not have access to Enterprise Manager, and DBAMgr (freeware) won?t install properly without administrator rights to the PC. Now my question is, has anyone been able to get around the problem of not being able to backup a remote database? My code snippet: oServer.LoginSecure = False oServer.LoginTimeout = 60 oServer.Connect "remote_server_name", "sa", "" oBackup.Database = gstrDBName oBackup.Files = "C:\Temp\" & gstrDBName & gnFileNumber & ".bak" oBackup.SQLBackup oServer This runs fine. I get no error raised. I have confirmed my connection to the database. The SQLBackup method runs without error, it just doesn?t create the backup file. If I connect to the database on the remote machine and run the backup command from the ?Tools, Database Utilities? menu in Access, Access complains that it can only backup a database running on the local machine. Any ideas? Thanks, Elizabeth Carey mailto: beth6230 at thecareys.net _______________________________________________ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com From davide at dalyn.co.nz Thu Apr 24 11:32:13 2003 From: davide at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2003 04:32:13 +1200 Subject: [dba-SQLServer]Exporting tables to text Message-ID: <5.2.0.9.0.20030425042757.00b1bfb8@mail.dalyn.co.nz> In A97 I had the following code DoCmd.TransferText acExportDelim, "DDExport", "qryAgedDebtorDDebitExp", strFullName The DDExport specification ensured that the strings didn't have quote marks around them. Now in AXP SQL2K I am needing to use - DoCmd.TransferText acExportDelim, , "ttmpAgedDebtorDDebitExp", strFullName to export a table but I have quote marks around the strings. Is there some setting so that I avoid the quote marks? The following is no good because it puts all sorts of lines in the file to imitate the boxes around the data. DoCmd.OutputTo acOutputTable, "ttmpAgedDebtorDDebitExp", acFormatTXT, strFullName Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From my.lists at verizon.net Thu Apr 24 12:05:56 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 24 Apr 2003 10:05:56 -0700 Subject: [dba-SQLServer]SQL-DMO backup remote database References: <20030424162614.B50C339F7@xmxpita.myway.com> Message-ID: <006b01c30a83$c5adc880$b615010a@FHTAPIA> Since you can connect to your db, and instead of doing some trick work with SQL-DMO, you can carry out the opperation via an ADO command instead... here is an example (also available in your BOL (books on line) keyword Backup). BACKUP [YOURDB] TO DISK = N'C:\YourPath\YourFilename.bak' WITH INIT , NOUNLOAD , NAME = N'YOUR DB BACKUPName', NOSKIP , NOFORMAT -Francisco http://rcm.netfirms.com On Thursday, April 24, 2003 9:26 AM [GMT-8], Elizabeth wrote: : Hi, : : I just joined the list, so I apologize if this topic has been covered. : : I have a situation where we have some packaged-off-the-shelf software : called IRIMS that is using MSDE (version 8) for the backend. There : appears to be no backup capabilities written in the software, so I am : writing some code to handle it - using SQL-DMO (pretty cool stuff). : We are on Windows 2000 machines, locked down for everyone to the : power user level. I do not have access to Enterprise Manager, and : DBAMgr (freeware) won't install properly without administrator rights : to the PC. : : Now my question is, has anyone been able to get around the problem of : not being able to backup a remote database? My code snippet: : : oServer.LoginSecure = False : oServer.LoginTimeout = 60 : oServer.Connect "remote_server_name", "sa", "" : oBackup.Database = gstrDBName : oBackup.Files = "C:\Temp\" & gstrDBName & gnFileNumber & ".bak" : oBackup.SQLBackup oServer : : This runs fine. I get no error raised. I have confirmed my : connection to the database. The SQLBackup method runs without error, : it just doesn't create the backup file. If I connect to the database : on the remote machine and run the backup command from the "Tools, : Database Utilities" menu in Access, Access complains that it can only : backup a database running on the local machine. : : Any ideas? : : Thanks, : : Elizabeth Carey From ecarey at myway.com Thu Apr 24 12:04:48 2003 From: ecarey at myway.com (Elizabeth) Date: Thu, 24 Apr 2003 13:04:48 -0400 (EDT) Subject: [dba-SQLServer]Exporting tables to text Message-ID: <20030424170448.99C8339FB@xmxpita.myway.com> Hi, You could manually create your export once, and when you do so, create and save an export specification (click the advanced button) with whatever settings you like. Then, in code, use that export specification to export your text file. I do not have AXP to test this on at the moment. Elizabeth DoCmd.TransferText acExportDelim, , "ttmpAgedDebtorDDebitExp", strFullName to export a table but I have quote marks around the strings. Is there some setting so that I avoid the quote marks? The following is no good because it puts all sorts of lines in the file to imitate the boxes around the data. DoCmd.OutputTo acOutputTable, "ttmpAgedDebtorDDebitExp", acFormatTXT, strFullName Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 _______________________________________________ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com From ecarey at myway.com Thu Apr 24 15:44:38 2003 From: ecarey at myway.com (Elizabeth) Date: Thu, 24 Apr 2003 16:44:38 -0400 (EDT) Subject: [dba-SQLServer]SQL-DMO backup remote database Message-ID: <20030424204438.9567839E3@xmxpita.myway.com> Hi, Thanks for the reply! I have spent the afternoon researching this and found some things that are interesting... I tried out your code: Dim con As New ADODB.Connection con.ConnectionString = "Provider=MSDataShape.1;Persist Security Info=False;Data Source=USERS_PC;User ID=sa;Initial Catalog=Incidents;Data Provider=SQLOLEDB.1" con.Open con.Execute "BACKUP DATABASE Incidents TO DISK=N'c:\Incidents.bak' WITH INIT, NOUNLOAD, " & _ "Name='Incidents', NOSKIP, NOFORMAT" And this code also seems to run, but still didn?t put the file on my hard drive?. what it did do is put it on my USER'S hard drive. I just went to her desk and found every file that I had created was on HER computer, not mine. Hmmm. Her disk is not shared, so I have no way of browsing to it to retrieve the files. The code above (and my SQL-DMO code) throws an error if you try to send to a network drive. If anyone wants my SQL-DMO code for doing the backup from a (local) database I?ll be happy to post it. Thanks! Elizabeth --- On Thu 04/24, Francisco H Tapia < my.lists at verizon.net > wrote:From: Francisco H Tapia [mailto: my.lists at verizon.net]To: dba- BACKUP [YOURDB] TO DISK = N'C:YourPathYourFilename.bak' WITH INIT , NOUNLOAD , NAME = N'YOUR DB BACKUPName', NOSKIP , NOFORMAT _______________________________________________ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com From my.lists at verizon.net Thu Apr 24 16:05:16 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Thu, 24 Apr 2003 14:05:16 -0700 Subject: [dba-SQLServer]SQL-DMO backup remote database References: <20030424204438.9567839E3@xmxpita.myway.com> Message-ID: <004101c30aa5$35211cf0$b615010a@FHTAPIA> Elizabeth, do go ahead and post the sql-dmo code, as for you current situation, The backups always occur to local drives of where SqlServer or in this instance, MSDE is installed. thus since you are connecting to a user's pc and you want to backup their db, then the backup file will then be on their machine. If you need to be able to browse to the user's pc you will need to get IS's rights where they could assign your login semi-admin rights where you could browse to their machine. If that is not permitted then perhaps opening up a folder share, they can easily do this in the login script. -Francisco http://rcm.netfirms.com On Thursday, April 24, 2003 1:44 PM [GMT-8], Elizabeth wrote: : Hi, : : Thanks for the reply! I have spent the afternoon researching this : and found some things that are interesting... : : I tried out your code: : : Dim con As New ADODB.Connection : con.ConnectionString = "Provider=MSDataShape.1;Persist Security : Info=False;Data Source=USERS_PC;User ID=sa;Initial : Catalog=Incidents;Data Provider=SQLOLEDB.1" : con.Open : con.Execute "BACKUP DATABASE Incidents TO DISK=N'c:\Incidents.bak' : WITH INIT, NOUNLOAD, " & _ "Name='Incidents', NOSKIP, NOFORMAT" : : And this code also seems to run, but still didn't put the file on my : hard drive.. what it did do is put it on my USER'S hard drive. I : just went to her desk and found every file that I had created was on : HER computer, not mine. Hmmm. Her disk is not shared, so I have no : way of browsing to it to retrieve the files. The code above (and my : SQL-DMO code) throws an error if you try to send to a network drive. : : If anyone wants my SQL-DMO code for doing the backup from a (local) : database I'll be happy to post it. : : Thanks! : Elizabeth : : : --- On Thu 04/24, Francisco H Tapia < my.lists at verizon.net > : wrote:From: Francisco H Tapia [mailto: my.lists at verizon.net]To: dba- : BACKUP [YOURDB] TO DISK = N'C:YourPathYourFilename.bak' WITH INIT , : NOUNLOAD , NAME = N'YOUR DB BACKUPName', NOSKIP , NOFORMAT : : : : _______________________________________________ : No banners. No pop-ups. No kidding. : Introducing My Way - http://www.myway.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 Thu Apr 24 16:10:02 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Thu, 24 Apr 2003 16:10:02 -0500 Subject: [dba-SQLServer]SQL-DMO backup remote database Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF78@ex02.eagle.usaa.com> Elizabeth, Your network backup attempt should work from either SQL-DMO or ADO/RDO/ODBC API code providing that the SQL Server service that runs on your users' machines is running under the domain account that has WRITE privileges on your box or is a member of Backup Operator Windows Security group. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Elizabeth [mailto:ecarey at myway.com] Sent: Thursday, April 24, 2003 3:45 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]SQL-DMO backup remote database Hi, Thanks for the reply! I have spent the afternoon researching this and found some things that are interesting... I tried out your code: Dim con As New ADODB.Connection con.ConnectionString = "Provider=MSDataShape.1;Persist Security Info=False;Data Source=USERS_PC;User ID=sa;Initial Catalog=Incidents;Data Provider=SQLOLEDB.1" con.Open con.Execute "BACKUP DATABASE Incidents TO DISK=N'c:\Incidents.bak' WITH INIT, NOUNLOAD, " & _ "Name='Incidents', NOSKIP, NOFORMAT" And this code also seems to run, but still didn't put the file on my hard drive.... what it did do is put it on my USER'S hard drive. I just went to her desk and found every file that I had created was on HER computer, not mine. Hmmm. Her disk is not shared, so I have no way of browsing to it to retrieve the files. The code above (and my SQL-DMO code) throws an error if you try to send to a network drive. If anyone wants my SQL-DMO code for doing the backup from a (local) database I'll be happy to post it. Thanks! Elizabeth --- On Thu 04/24, Francisco H Tapia < my.lists at verizon.net > wrote:From: Francisco H Tapia [mailto: my.lists at verizon.net]To: dba- BACKUP [YOURDB] TO DISK = N'C:YourPathYourFilename.bak' WITH INIT , NOUNLOAD , NAME = N'YOUR DB BACKUPName', NOSKIP , NOFORMAT _______________________________________________ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ecarey at myway.com Thu Apr 24 16:26:27 2003 From: ecarey at myway.com (Elizabeth) Date: Thu, 24 Apr 2003 17:26:27 -0400 (EDT) Subject: [dba-SQLServer]SQL-DMO backup remote database Message-ID: <20030424212627.8E92139EC@xmxpita.myway.com> We do not have backup operator rights - nor would her PC allow me to connect. I did try sending the file to a mapped drive that we both have - and also using an absolute address - those attempts gave me an error. Here's the code. I have 2 global variables declared - one to save the database name being backed up (we have several) and the other to keep track of which backup in the sequence (5) to do. This is the code that does the business... Public Sub BackupDatabase() Dim oBackup As New SQLDMO.Backup Dim oServer As New SQLDMO.SQLServer oServer.LoginSecure = False oServer.LoginTimeout = 60 oServer.Connect "(local)", "sa", "" oBackup.Database = gstrDBName oBackup.Files = "C:\Temp\" & gstrDBName & gnFileNumber & ".bak" oBackup.SQLBackup oServer Set oBackup = Nothing oServer.Disconnect Set oServer = Nothing End Sub Elizabeth _______________________________________________ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com From davide at dalyn.co.nz Thu Apr 24 17:17:09 2003 From: davide at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2003 10:17:09 +1200 Subject: [dba-SQLServer]Exporting tables to text In-Reply-To: <20030424170448.99C8339FB@xmxpita.myway.com> Message-ID: <5.2.0.9.0.20030425101559.00b1c140@mail.dalyn.co.nz> Thanks for the reply. Unfortunately I am using an adp which doesn't allow the saving of secifications. David At 24/04/2003, you wrote: >Hi, > >You could manually create your export once, and when you do so, create and >save an export specification (click the advanced button) with whatever >settings you like. Then, in code, use that export specification to export >your text file. I do not have AXP to test this on at the moment. > >Elizabeth > > > >DoCmd.TransferText acExportDelim, , "ttmpAgedDebtorDDebitExp", strFullName > >to export a table but I have quote marks around the strings. > >Is there some setting so that I avoid the quote marks? > >The following is no good because it puts all sorts of lines in the file to >imitate the boxes around the data. > >DoCmd.OutputTo acOutputTable, "ttmpAgedDebtorDDebitExp", acFormatTXT, >strFullName > > > >Regards > >David Emerson >DALYN Software Ltd >25b Cunliffe St, Johnsonville >Wellington, New Zealand >Ph/Fax (877) 456-1205 > > > >_______________________________________________ >No banners. No pop-ups. No kidding. >Introducing My Way - http://www.myway.com >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From ecarey at myway.com Fri Apr 25 09:15:37 2003 From: ecarey at myway.com (Elizabeth) Date: Fri, 25 Apr 2003 10:15:37 -0400 (EDT) Subject: [dba-SQLServer]Exporting tables to text Message-ID: <20030425141537.7749C3A01@xmxpita.myway.com> Sheesh, sorry. I hadn't actually run through it in an ADP. Well, you could always manually create your file in code. I had to do this for a file that was loaded into DB2. The load card expected some header information in the file, so it was just as easy to create the text file manually in code. The code I have has lots of extra stuff in it that you probably don't need, so I'll give you the jist of it (this is DAO, just create your recordset in ADO..): Public Sub CreateFile() Dim rst As DAO.Recordset Dim strSQL As String Dim db As DAO.Database Dim strLine As String On Error GoTo CreateFileError Set db = CurrentDb strSQL = "SELECT * from tbltmpDataForFile" Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot) Open "c:\TESTFILE.txt" For Output As #1 With rst Do While Not .EOF If (!earningscode = "602" Or !earningscode = "603") And _ Nz(!transactionamount) = 0 Then .MoveNext Else strLine = "T," strLine = strLine & "0" & !ISESyscd & "," strLine = strLine & "0" & !transactiontype & "," strLine = strLine & !earningscode & "," strLine = strLine & strAmount & "," strLine = strLine & !LivingDedCode & "," strLine = strLine & strAmount Print #1, strLine .MoveNext End If Loop End With rst.Close Set rst = Nothing Set db = Nothing Elizabeth --- On Thu 04/24, David Emerson < davide at dalyn.co.nz > wrote:From: David Emerson [mailto: davide at dalyn.co.nz]To: dba-sqlserver at databaseadvisors.comDate: Fri, 25 Apr 2003 10:17:09 +1200Subject: RE: [dba-SQLServer]Exporting tables to textThanks for the reply. Unfortunately I am using an adp which doesn't allow the saving of secifications. _______________________________________________ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com From harkins at iglou.com Fri Apr 25 09:13:42 2003 From: harkins at iglou.com (Susan Harkins) Date: Fri, 25 Apr 2003 10:13:42 -0400 Subject: [dba-SQLServer]users Message-ID: <005801c30b36$b2949f90$deecffcc@SusanOne> Can you grant permission to a single user or group to create a trigger -- I can't find any such permission. It's an odd request, I know. Susan H. From Kenneth.Stoker at pnl.gov Fri Apr 25 10:26:52 2003 From: Kenneth.Stoker at pnl.gov (Stoker, Kenneth E) Date: Fri, 25 Apr 2003 08:26:52 -0700 Subject: [dba-SQLServer]Convert int month to char month Message-ID: <249C1CB246997C48BB74963CCD361C1B69B7A2@pnlmse28.pnl.gov> Does anyone know of a way to convert the return value of month([mydate]) from an integer to its equivalent char value? 1 JAN 2 FEB 3 MAR ..... Thank you for your help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov From paul.hartland at fsmail.net Fri Apr 25 10:36:07 2003 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Fri, 25 Apr 2003 15:36:07 +0000 Subject: [dba-SQLServer]Convert int month to char month Message-ID: <20030425153607.HMCI11376.fep12-svc.ttys.com@localhost> try something like format(MyIntNumber,"MMM") that may do it..... Paul From: "Stoker, Kenneth E" Date: Fri 25/Apr/2003 15:26 GMT To: "dba-SQLServer (E-mail)" Subject: [dba-SQLServer]Convert int month to char month Does anyone know of a way to convert the return value of month([mydate]) from an integer to its equivalent char value? 1 JAN 2 FEB 3 MAR ..... Thank you for your help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov _______________________________________________ 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 mikedorism at ntelos.net Fri Apr 25 10:42:55 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Fri, 25 Apr 2003 11:42:55 -0400 Subject: [dba-SQLServer]Convert int month to char month In-Reply-To: <249C1CB246997C48BB74963CCD361C1B69B7A2@pnlmse28.pnl.gov> Message-ID: <002401c30b41$5a3d9170$24340cd8@hargrove.internal> SQL doesn't have anything built-in to do this so you will have to build your own user-defined function to handle it. 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 Stoker, Kenneth E Sent: Friday, April 25, 2003 11:27 AM To: dba-SQLServer (E-mail) Subject: [dba-SQLServer]Convert int month to char month Does anyone know of a way to convert the return value of month([mydate]) from an integer to its equivalent char value? 1 JAN 2 FEB 3 MAR ..... Thank you for your help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov _______________________________________________ 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 Fri Apr 25 10:46:04 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Fri, 25 Apr 2003 11:46:04 -0400 Subject: [dba-SQLServer]Convert int month to char month In-Reply-To: <20030425153607.HMCI11376.fep12-svc.ttys.com@localhost> Message-ID: <002a01c30b41$cb2e3a10$24340cd8@hargrove.internal> That will work if he is using Access as an FE but if he is doing this inside SQL Server itself it won't. SQL doesn't have a Format function like Access does. 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 paul.hartland at fsmail.net Sent: Friday, April 25, 2003 11:36 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Convert int month to char month try something like format(MyIntNumber,"MMM") that may do it..... Paul From: "Stoker, Kenneth E" Date: Fri 25/Apr/2003 15:26 GMT To: "dba-SQLServer (E-mail)" Subject: [dba-SQLServer]Convert int month to char month Does anyone know of a way to convert the return value of month([mydate]) from an integer to its equivalent char value? 1 JAN 2 FEB 3 MAR ..... Thank you for your help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov _______________________________________________ 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 harkins at iglou.com Fri Apr 25 10:47:49 2003 From: harkins at iglou.com (Susan Harkins) Date: Fri, 25 Apr 2003 11:47:49 -0400 Subject: [dba-SQLServer]Convert int month to char month References: <20030425153607.HMCI11376.fep12-svc.ttys.com@localhost> Message-ID: <019901c30b42$08949c50$deecffcc@SusanOne> I don't think SQL SErver has a FORMAT function. I checked some of the codes and I couldn't find one that returns the abbreviated month as text -- Susan H. > try something like > > format(MyIntNumber,"MMM") > > that may do it..... > > Paul > Does anyone know of a way to convert the return value of month([mydate]) from an integer to its equivalent char value? > > 1 JAN > 2 FEB > 3 MAR From jbarash at bellatlantic.net Fri Apr 25 11:04:12 2003 From: jbarash at bellatlantic.net (James Barash) Date: Fri, 25 Apr 2003 12:04:12 -0400 Subject: [dba-SQLServer]Convert int month to char month In-Reply-To: Message-ID: Ken, Try something like this: left(convert(datetime, mydate, 107),3) This works in SQL2000, I don't know of convert exists in SQL7. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stoker, Kenneth E Sent: Friday, April 25, 2003 11:27 AM To: dba-SQLServer (E-mail) Subject: [dba-SQLServer]Convert int month to char month Does anyone know of a way to convert the return value of month([mydate]) from an integer to its equivalent char value? 1 JAN 2 FEB 3 MAR ..... Thank you for your help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Kenneth.Stoker at pnl.gov Fri Apr 25 11:09:11 2003 From: Kenneth.Stoker at pnl.gov (Stoker, Kenneth E) Date: Fri, 25 Apr 2003 09:09:11 -0700 Subject: [dba-SQLServer]Convert int month to char month Message-ID: <249C1CB246997C48BB74963CCD361C1B69B7A4@pnlmse28.pnl.gov> AAAAHHHH, so close. The 107 format setting only returns the first 2 characters of the text month. Thank you, though. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov -----Original Message----- From: James Barash [mailto:jbarash at bellatlantic.net] Sent: Friday, April 25, 2003 9:04 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Convert int month to char month Ken, Try something like this: left(convert(datetime, mydate, 107),3) This works in SQL2000, I don't know of convert exists in SQL7. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stoker, Kenneth E Sent: Friday, April 25, 2003 11:27 AM To: dba-SQLServer (E-mail) Subject: [dba-SQLServer]Convert int month to char month Does anyone know of a way to convert the return value of month([mydate]) from an integer to its equivalent char value? 1 JAN 2 FEB 3 MAR ..... Thank you for your help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov _______________________________________________ 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 Kenneth.Stoker at pnl.gov Fri Apr 25 11:16:49 2003 From: Kenneth.Stoker at pnl.gov (Stoker, Kenneth E) Date: Fri, 25 Apr 2003 09:16:49 -0700 Subject: [dba-SQLServer]Convert int month to char month Message-ID: <249C1CB246997C48BB74963CCD361C1B07C868@pnlmse28.pnl.gov> Okay, I was afraid of that. I will try creating my first user-defined function. Any advise on these? Thank you. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Friday, April 25, 2003 8:43 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Convert int month to char month SQL doesn't have anything built-in to do this so you will have to build your own user-defined function to handle it. 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 Stoker, Kenneth E Sent: Friday, April 25, 2003 11:27 AM To: dba-SQLServer (E-mail) Subject: [dba-SQLServer]Convert int month to char month Does anyone know of a way to convert the return value of month([mydate]) from an integer to its equivalent char value? 1 JAN 2 FEB 3 MAR ..... Thank you for your help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov _______________________________________________ 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 harkins at iglou.com Fri Apr 25 11:16:54 2003 From: harkins at iglou.com (Susan Harkins) Date: Fri, 25 Apr 2003 12:16:54 -0400 Subject: [dba-SQLServer]Convert int month to char month References: Message-ID: <000c01c30b46$308a6ba0$d9e6ffcc@SusanOne> Server: Msg 241, Level 16, State 1, Line 1 Syntax error converting datetime from character string. Got an error -- what's the 107? I'm using SQL Server 2000. Susan H. > Ken, > Try something like this: > > left(convert(datetime, mydate, 107),3) > > This works in SQL2000, I don't know of convert exists in SQL7. > > James Barash > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stoker, > Kenneth E > Sent: Friday, April 25, 2003 11:27 AM > To: dba-SQLServer (E-mail) > Subject: [dba-SQLServer]Convert int month to char month > > > Does anyone know of a way to convert the return value of month([mydate]) > from an integer to its equivalent char value? > > 1 JAN > 2 FEB > 3 MAR > ..... > > Thank you for your help. > > Ken Stoker > Technology Commercialization > Information Systems Administrator > PH: (509) 375-3758 > FAX: (509) 375-6731 > E-mail: Kenneth.Stoker at pnl.gov > > > _______________________________________________ > 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 Kenneth.Stoker at pnl.gov Fri Apr 25 11:25:36 2003 From: Kenneth.Stoker at pnl.gov (Stoker, Kenneth E) Date: Fri, 25 Apr 2003 09:25:36 -0700 Subject: [dba-SQLServer]Convert int month to char month Message-ID: <249C1CB246997C48BB74963CCD361C1B69B7A6@pnlmse28.pnl.gov> These functions aren't too bad. Here is what I came up with. Most of you probably could have done this in your sleep. CREATE FUNCTION [dbo].whichMonth (@Month int) RETURNS varchar(3) AS BEGIN declare @Return varchar(3) select @return = case @Month when 1 then 'JAN' when 2 then 'FEB' when 3 then 'MAR' when 4 then 'APR' when 5 then 'MAY' when 6 then 'JUN' when 7 then 'JUL' when 8 then 'AUG' when 9 then 'SEP' when 10 then 'OCT' when 11 then 'NOV' when 12 then 'DEC' else 'Invalid' END return @return end Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov -----Original Message----- From: Stoker, Kenneth E Sent: Friday, April 25, 2003 9:17 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Convert int month to char month Okay, I was afraid of that. I will try creating my first user-defined function. Any advise on these? Thank you. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Friday, April 25, 2003 8:43 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Convert int month to char month SQL doesn't have anything built-in to do this so you will have to build your own user-defined function to handle it. 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 Stoker, Kenneth E Sent: Friday, April 25, 2003 11:27 AM To: dba-SQLServer (E-mail) Subject: [dba-SQLServer]Convert int month to char month Does anyone know of a way to convert the return value of month([mydate]) from an integer to its equivalent char value? 1 JAN 2 FEB 3 MAR ..... Thank you for your help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov _______________________________________________ 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 jbarash at bellatlantic.net Fri Apr 25 11:33:52 2003 From: jbarash at bellatlantic.net (James Barash) Date: Fri, 25 Apr 2003 12:33:52 -0400 Subject: [dba-SQLServer]Convert int month to char month In-Reply-To: Message-ID: You need to pass a datetime variable to convert. Try convert(datetime,cast('4/25/03' as datetime),107) 107 is a style that should return MMM DD YYYY HH:MM See BOL for a list of styles. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, April 25, 2003 12:17 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Convert int month to char month Server: Msg 241, Level 16, State 1, Line 1 Syntax error converting datetime from character string. Got an error -- what's the 107? I'm using SQL Server 2000. Susan H. > Ken, > Try something like this: > > left(convert(datetime, mydate, 107),3) > > This works in SQL2000, I don't know of convert exists in SQL7. > > James Barash > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > Stoker, Kenneth E > Sent: Friday, April 25, 2003 11:27 AM > To: dba-SQLServer (E-mail) > Subject: [dba-SQLServer]Convert int month to char month > > > Does anyone know of a way to convert the return value of > month([mydate]) from an integer to its equivalent char value? > > 1 JAN > 2 FEB > 3 MAR > ..... > > Thank you for your help. > > Ken Stoker > Technology Commercialization > Information Systems Administrator > PH: (509) 375-3758 > FAX: (509) 375-6731 > E-mail: Kenneth.Stoker at pnl.gov > > > _______________________________________________ > 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 Kenneth.Stoker at pnl.gov Fri Apr 25 11:50:21 2003 From: Kenneth.Stoker at pnl.gov (Stoker, Kenneth E) Date: Fri, 25 Apr 2003 09:50:21 -0700 Subject: [dba-SQLServer]Convert int month to char month Message-ID: <249C1CB246997C48BB74963CCD361C1B07C869@pnlmse28.pnl.gov> You are right, I had forgotten to change my convert variable from varchar(2) to datetime. I had: LEFT(CONVERT(varchar(2), MyDate, 107), 3)) I needed: LEFT(CONVERT(datetime, MyDate, 107), 3)) I had varchar(2) set up because I am concatenating the month with the rest of the date to get it in a specific format to feed another system. Until I found out how to get the month in a text format, I was testing with just the month function, converting the return integer to a string so that it could be concatenated with the rest of the string. So the last one listed here works. I can get rid of my function now, although it was fun to finally get into those. Have wanted to play in there but hadn't had a need yet. Thanks for all your help, everyone. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov -----Original Message----- From: James Barash [mailto:jbarash at bellatlantic.net] Sent: Friday, April 25, 2003 9:34 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Convert int month to char month You need to pass a datetime variable to convert. Try convert(datetime,cast('4/25/03' as datetime),107) 107 is a style that should return MMM DD YYYY HH:MM See BOL for a list of styles. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, April 25, 2003 12:17 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Convert int month to char month Server: Msg 241, Level 16, State 1, Line 1 Syntax error converting datetime from character string. Got an error -- what's the 107? I'm using SQL Server 2000. Susan H. > Ken, > Try something like this: > > left(convert(datetime, mydate, 107),3) > > This works in SQL2000, I don't know of convert exists in SQL7. > > James Barash > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > Stoker, Kenneth E > Sent: Friday, April 25, 2003 11:27 AM > To: dba-SQLServer (E-mail) > Subject: [dba-SQLServer]Convert int month to char month > > > Does anyone know of a way to convert the return value of > month([mydate]) from an integer to its equivalent char value? > > 1 JAN > 2 FEB > 3 MAR > ..... > > Thank you for your help. > > Ken Stoker > Technology Commercialization > Information Systems Administrator > PH: (509) 375-3758 > FAX: (509) 375-6731 > E-mail: Kenneth.Stoker at pnl.gov > > > _______________________________________________ > 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 Kenneth.Stoker at pnl.gov Fri Apr 25 13:19:07 2003 From: Kenneth.Stoker at pnl.gov (Stoker, Kenneth E) Date: Fri, 25 Apr 2003 11:19:07 -0700 Subject: [dba-SQLServer]SQL Mail Message-ID: <249C1CB246997C48BB74963CCD361C1B69B7AC@pnlmse28.pnl.gov> Everyone, How powerful is SQL Mail? I have recently been approached with a task to develop an automated e-mail capability for a SQL Server database. I need to query a table of action items that are approaching their deadline period and for each action, send an e-mail to the individual who will be responsible for the decision to proceed or abandon the action. The e-mail will therefore have to include the record information related to the pending action. This process would execute everyday. Everything I have read doesn't suggest that SQL Mail can do this, although I haven't seen anything that really comes out an says it can't. I can do it in other ways, most favorable would be through Access, but I would like to try to keep it within SQL Server if possible. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov From cjm at haleyaldrich.com Fri Apr 25 14:01:07 2003 From: cjm at haleyaldrich.com (Chris McIsaac) Date: Fri, 25 Apr 2003 15:01:07 -0400 Subject: [dba-SQLServer]SQL Mail Message-ID: <2D75DD4827824A42B818038E44FFE21F0349F6@bosmail.haleyaldrich.com> For a number of years, I've been running jobs that use xp_sendmail to send email hourly, daily, weekly, and monthly. I've been very happy with it. There are a couple of things to keep in mind, though. No matter how big a warning you put in the email about not replying to the server, you are going to have users do it any way. I set a rule on the sql server's email account to forward to me all mail received by the account. Otherwise, the replies just sit there. Also, if the email server goes down, sql mail will not re-establish a connection to the server. You will need to restart sql mail in order for it start up again. I've seen this with Novell and MS Exchange. Easy to do but still a PITA. -----Original Message----- From: Stoker, Kenneth E [mailto:Kenneth.Stoker at pnl.gov] Sent: Friday, April 25, 2003 2:19 PM To: dba-SQLServer (E-mail) Subject: [dba-SQLServer]SQL Mail Everyone, How powerful is SQL Mail? I have recently been approached with a task to develop an automated e-mail capability for a SQL Server database. I need to query a table of action items that are approaching their deadline period and for each action, send an e-mail to the individual who will be responsible for the decision to proceed or abandon the action. The e-mail will therefore have to include the record information related to the pending action. This process would execute everyday. Everything I have read doesn't suggest that SQL Mail can do this, although I haven't seen anything that really comes out an says it can't. I can do it in other ways, most favorable would be through Access, but I would like to try to keep it within SQL Server if possible. From MarkBoyd at McBeeAssociates.com Fri Apr 25 14:38:34 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Fri, 25 Apr 2003 15:38:34 -0400 Subject: [dba-SQLServer]SQL Import Spec Message-ID: I have been loading gigs and gigs of data into our SQL Server for the past month. The process is fairly time consuming: 1. Import a 16 GB text file into a 1 field SQL table 2. Run a sproc to separate records into 7 different tables based on record layout 3. Export each of the 7 tables from SQL to text 4. Import each of the 7 text files into linked SQL tables using Access import specs. I need to do this for almost 70 16 GB text files. Each file takes about a day to fully load. Is there a way to expedite this process? I am really looking for a way to save an import spec in Enterprise Mgr. That way, I can omit using Access and run the whole process as a SQL job, with very minimal human interaction. Any direction is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuxedo_man at hotmail.com Fri Apr 25 14:41:39 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Fri, 25 Apr 2003 19:41:39 +0000 Subject: [dba-SQLServer]users Message-ID: I don't think so. Must be either the table owner, db_owner, or db_ddladmin fixed roles to create a trigger on a table. Just curious, why such a request? Billy >From: "Susan Harkins" >Reply-To: dba-sqlserver at databaseadvisors.com >To: "SQLList" >Subject: [dba-SQLServer]users >Date: Fri, 25 Apr 2003 10:13:42 -0400 > >Can you grant permission to a single user or group to create a trigger -- I >can't find any such permission. It's an odd request, I know. > >Susan H. > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From CWortz at tea.state.tx.us Fri Apr 25 14:44:13 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Fri, 25 Apr 2003 14:44:13 -0500 Subject: [dba-SQLServer]SQL Import Spec Message-ID: Mark, I must be missing something because I don't see the purpose of steps 3 and 4. What are you doing in those steps that cannot be done during step 2? 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: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:39 To: SQLServerList Subject: [dba-SQLServer]SQL Import Spec I have been loading gigs and gigs of data into our SQL Server for the past month. The process is fairly time consuming: 1. Import a 16 GB text file into a 1 field SQL table 2. Run a sproc to separate records into 7 different tables based on record layout 3. Export each of the 7 tables from SQL to text 4. Import each of the 7 text files into linked SQL tables using Access import specs. I need to do this for almost 70 16 GB text files. Each file takes about a day to fully load. Is there a way to expedite this process? I am really looking for a way to save an import spec in Enterprise Mgr. That way, I can omit using Access and run the whole process as a SQL job, with very minimal human interaction. Any direction is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fhtapia at hotmail.com Fri Apr 25 14:52:33 2003 From: fhtapia at hotmail.com (Francisco H Tapia) Date: Fri, 25 Apr 2003 12:52:33 -0700 Subject: [dba-SQLServer]SQL Import Spec References: Message-ID: Have you looked into using DTS? -Francisco http://rcm.netfirms.com On Friday, April 25, 2003 12:38 PM [GMT-8], Mark Boyd wrote: : I have been loading gigs and gigs of data into our SQL Server for the : past month. : : The process is fairly time consuming: : : 1. Import a 16 GB text file into a 1 field SQL table : 2. Run a sproc to separate records into 7 different tables based on : record layout : 3. Export each of the 7 tables from SQL to text : 4. Import each of the 7 text files into linked SQL tables using : Access import specs. : : : : I need to do this for almost 70 16 GB text files. Each file takes : about a day to fully load. : : Is there a way to expedite this process? I am really looking for a : way to save an import spec in Enterprise Mgr. : : That way, I can omit using Access and run the whole process as a SQL : job, with very minimal human interaction. : : Any direction is greatly appreciated. : : : : Thanks, : : Mark Boyd : : Sr. Systems Analyst : : McBee Associates, Inc. : : : : : : : :: _______________________________________________ :: 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 Fri Apr 25 14:56:22 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Fri, 25 Apr 2003 15:56:22 -0400 Subject: [dba-SQLServer]SQL Import Spec Message-ID: Charles - There are 7 different record layouts in this huge text file. Step 2 runs 7 queries to separate records based on their record layout type (using a record layout indicator). Once the 7 tables are created (records still only 1 field), I need to break the data into fields. I only use access because I can use the import specs, instead of manually selecting the field breaks for each table. -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Friday, April 25, 2003 3:44 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Mark, I must be missing something because I don't see the purpose of steps 3 and 4. What are you doing in those steps that cannot be done during step 2? 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: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:39 To: SQLServerList Subject: [dba-SQLServer]SQL Import Spec I have been loading gigs and gigs of data into our SQL Server for the past month. The process is fairly time consuming: 1. Import a 16 GB text file into a 1 field SQL table 2. Run a sproc to separate records into 7 different tables based on record layout 3. Export each of the 7 tables from SQL to text 4. Import each of the 7 text files into linked SQL tables using Access import specs. I need to do this for almost 70 16 GB text files. Each file takes about a day to fully load. Is there a way to expedite this process? I am really looking for a way to save an import spec in Enterprise Mgr. That way, I can omit using Access and run the whole process as a SQL job, with very minimal human interaction. Any direction is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From MarkBoyd at McBeeAssociates.com Fri Apr 25 14:57:57 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Fri, 25 Apr 2003 15:57:57 -0400 Subject: [dba-SQLServer]SQL Import Spec Message-ID: Francisco - I'm not real familiar with DTS. I've used it to import and export objects, but I can't find a way to save an import spec, in order to use again. Is there a way to do this? Mark -----Original Message----- From: Francisco H Tapia [mailto:fhtapia at hotmail.com] Sent: Friday, April 25, 2003 3:53 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]SQL Import Spec Have you looked into using DTS? -Francisco http://rcm.netfirms.com On Friday, April 25, 2003 12:38 PM [GMT-8], Mark Boyd wrote: : I have been loading gigs and gigs of data into our SQL Server for the : past month. : : The process is fairly time consuming: : : 1. Import a 16 GB text file into a 1 field SQL table : 2. Run a sproc to separate records into 7 different tables based on : record layout : 3. Export each of the 7 tables from SQL to text : 4. Import each of the 7 text files into linked SQL tables using : Access import specs. : : : : I need to do this for almost 70 16 GB text files. Each file takes : about a day to fully load. : : Is there a way to expedite this process? I am really looking for a : way to save an import spec in Enterprise Mgr. : : That way, I can omit using Access and run the whole process as a SQL : job, with very minimal human interaction. : : Any direction is greatly appreciated. : : : : Thanks, : : Mark Boyd : : Sr. Systems Analyst : : McBee Associates, Inc. : : : : : : : :: _______________________________________________ :: 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 CWortz at tea.state.tx.us Fri Apr 25 15:09:57 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Fri, 25 Apr 2003 15:09:57 -0500 Subject: [dba-SQLServer]SQL Import Spec Message-ID: Mark, Once you determined which of the seven layouts, why are you not storing each data item into its appropriate field during step 2? The data items are delimited are they not? And if not, then how are you performing step 4? I hope step 4 is not a manual step! 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: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:56 To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Charles - There are 7 different record layouts in this huge text file. Step 2 runs 7 queries to separate records based on their record layout type (using a record layout indicator). Once the 7 tables are created (records still only 1 field), I need to break the data into fields. I only use access because I can use the import specs, instead of manually selecting the field breaks for each table. -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Friday, April 25, 2003 3:44 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Mark, I must be missing something because I don't see the purpose of steps 3 and 4. What are you doing in those steps that cannot be done during step 2? Charles Wortz -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:39 To: SQLServerList Subject: [dba-SQLServer]SQL Import Spec I have been loading gigs and gigs of data into our SQL Server for the past month. The process is fairly time consuming: 1. Import a 16 GB text file into a 1 field SQL table 2. Run a sproc to separate records into 7 different tables based on record layout 3. Export each of the 7 tables from SQL to text 4. Import each of the 7 text files into linked SQL tables using Access import specs. I need to do this for almost 70 16 GB text files. Each file takes about a day to fully load. Is there a way to expedite this process? I am really looking for a way to save an import spec in Enterprise Mgr. That way, I can omit using Access and run the whole process as a SQL job, with very minimal human interaction. Any direction is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. From MarkBoyd at McBeeAssociates.com Fri Apr 25 15:17:36 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Fri, 25 Apr 2003 16:17:36 -0400 Subject: [dba-SQLServer]SQL Import Spec Message-ID: Charles - I think I'm a little confused. How can I distinguish where the field breaks are without some type of specification? There is no delimiter between data items. Mark -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Friday, April 25, 2003 4:10 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Mark, Once you determined which of the seven layouts, why are you not storing each data item into its appropriate field during step 2? The data items are delimited are they not? And if not, then how are you performing step 4? I hope step 4 is not a manual step! 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: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:56 To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Charles - There are 7 different record layouts in this huge text file. Step 2 runs 7 queries to separate records based on their record layout type (using a record layout indicator). Once the 7 tables are created (records still only 1 field), I need to break the data into fields. I only use access because I can use the import specs, instead of manually selecting the field breaks for each table. -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Friday, April 25, 2003 3:44 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Mark, I must be missing something because I don't see the purpose of steps 3 and 4. What are you doing in those steps that cannot be done during step 2? Charles Wortz -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:39 To: SQLServerList Subject: [dba-SQLServer]SQL Import Spec I have been loading gigs and gigs of data into our SQL Server for the past month. The process is fairly time consuming: 1. Import a 16 GB text file into a 1 field SQL table 2. Run a sproc to separate records into 7 different tables based on record layout 3. Export each of the 7 tables from SQL to text 4. Import each of the 7 text files into linked SQL tables using Access import specs. I need to do this for almost 70 16 GB text files. Each file takes about a day to fully load. Is there a way to expedite this process? I am really looking for a way to save an import spec in Enterprise Mgr. That way, I can omit using Access and run the whole process as a SQL job, with very minimal human interaction. Any direction is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From CWortz at tea.state.tx.us Fri Apr 25 15:31:08 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Fri, 25 Apr 2003 15:31:08 -0500 Subject: [dba-SQLServer]SQL Import Spec Message-ID: Mark, Now you have me confused. No delimiters between data items? Then your records must be fixed length and your import specs must be doing column counts which you could code into your step 2. If your records are variable length, then there must be data delimiters which you also can code into your step 2. Of course, as another has already mentioned, this can be done by DTS. IIRC, BOL has a good tutorial on DTS. 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: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 15:18 To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Charles - I think I'm a little confused. How can I distinguish where the field breaks are without some type of specification? There is no delimiter between data items. Mark -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Friday, April 25, 2003 4:10 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Mark, Once you determined which of the seven layouts, why are you not storing each data item into its appropriate field during step 2? The data items are delimited are they not? And if not, then how are you performing step 4? I hope step 4 is not a manual step! Charles Wortz ----Original Message----- From: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:56 To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Charles - There are 7 different record layouts in this huge text file. Step 2 runs 7 queries to separate records based on their record layout type (using a record layout indicator). Once the 7 tables are created (records still only 1 field), I need to break the data into fields. I only use access because I can use the import specs, instead of manually selecting the field breaks for each table. -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Friday, April 25, 2003 3:44 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Mark, I must be missing something because I don't see the purpose of steps 3 and 4. What are you doing in those steps that cannot be done during step 2? Charles Wortz -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:39 To: SQLServerList Subject: [dba-SQLServer]SQL Import Spec I have been loading gigs and gigs of data into our SQL Server for the past month. The process is fairly time consuming: 1. Import a 16 GB text file into a 1 field SQL table 2. Run a sproc to separate records into 7 different tables based on record layout 3. Export each of the 7 tables from SQL to text 4. Import each of the 7 text files into linked SQL tables using Access import specs. I need to do this for almost 70 16 GB text files. Each file takes about a day to fully load. Is there a way to expedite this process? I am really looking for a way to save an import spec in Enterprise Mgr. That way, I can omit using Access and run the whole process as a SQL job, with very minimal human interaction. Any direction is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. _______________________________________________ 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 MarkBoyd at McBeeAssociates.com Fri Apr 25 15:34:26 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Fri, 25 Apr 2003 16:34:26 -0400 Subject: [dba-SQLServer]SQL Import Spec Message-ID: Thanks Charles and Francisco. I'm looking into DTS now. I think this is what I need. How can I call a saved package to run from within a sproc? Is this possible? Mark -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Friday, April 25, 2003 4:31 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Mark, Now you have me confused. No delimiters between data items? Then your records must be fixed length and your import specs must be doing column counts which you could code into your step 2. If your records are variable length, then there must be data delimiters which you also can code into your step 2. Of course, as another has already mentioned, this can be done by DTS. IIRC, BOL has a good tutorial on DTS. 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: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 15:18 To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Charles - I think I'm a little confused. How can I distinguish where the field breaks are without some type of specification? There is no delimiter between data items. Mark -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Friday, April 25, 2003 4:10 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Mark, Once you determined which of the seven layouts, why are you not storing each data item into its appropriate field during step 2? The data items are delimited are they not? And if not, then how are you performing step 4? I hope step 4 is not a manual step! Charles Wortz ----Original Message----- From: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:56 To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Charles - There are 7 different record layouts in this huge text file. Step 2 runs 7 queries to separate records based on their record layout type (using a record layout indicator). Once the 7 tables are created (records still only 1 field), I need to break the data into fields. I only use access because I can use the import specs, instead of manually selecting the field breaks for each table. -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Friday, April 25, 2003 3:44 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]SQL Import Spec Mark, I must be missing something because I don't see the purpose of steps 3 and 4. What are you doing in those steps that cannot be done during step 2? Charles Wortz -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] Sent: Friday 2003 Apr 25 14:39 To: SQLServerList Subject: [dba-SQLServer]SQL Import Spec I have been loading gigs and gigs of data into our SQL Server for the past month. The process is fairly time consuming: 1. Import a 16 GB text file into a 1 field SQL table 2. Run a sproc to separate records into 7 different tables based on record layout 3. Export each of the 7 tables from SQL to text 4. Import each of the 7 text files into linked SQL tables using Access import specs. I need to do this for almost 70 16 GB text files. Each file takes about a day to fully load. Is there a way to expedite this process? I am really looking for a way to save an import spec in Enterprise Mgr. That way, I can omit using Access and run the whole process as a SQL job, with very minimal human interaction. Any direction is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Robert.Djabarov at usaa.com Fri Apr 25 16:43:32 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Fri, 25 Apr 2003 16:43:32 -0500 Subject: [dba-SQLServer]SQL Import Spec Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABF83@ex02.eagle.usaa.com> Why do you need to do another import using Access? Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Mark Boyd [mailto:MarkBoyd at mcbeeassociates.com] Sent: Friday, April 25, 2003 2:39 PM To: SQLServerList Subject: [dba-SQLServer]SQL Import Spec I have been loading gigs and gigs of data into our SQL Server for the past month. The process is fairly time consuming: 1. Import a 16 GB text file into a 1 field SQL table 2. Run a sproc to separate records into 7 different tables based on record layout 3. Export each of the 7 tables from SQL to text 4. Import each of the 7 text files into linked SQL tables using Access import specs. I need to do this for almost 70 16 GB text files. Each file takes about a day to fully load. Is there a way to expedite this process? I am really looking for a way to save an import spec in Enterprise Mgr. That way, I can omit using Access and run the whole process as a SQL job, with very minimal human interaction. Any direction is greatly appreciated. Thanks, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 528 bytes Desc: image001.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 2302 bytes Desc: image002.jpg URL: From stuart at lexacorp.com.pg Fri Apr 25 19:37:47 2003 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 26 Apr 2003 10:37:47 +1000 Subject: [dba-SQLServer]Convert int month to char month In-Reply-To: <249C1CB246997C48BB74963CCD361C1B69B7A2@pnlmse28.pnl.gov> Message-ID: <3EAA617B.17256.303850@localhost> Simplest would be: SUBSTRING("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC",myMonth * 3 -2,3) On 25 Apr 2003 at 8:26, Stoker, Kenneth E wrote: > Does anyone know of a way to convert the return value of > month([mydate]) from an integer to its equivalent char value? > > 1 JAN > 2 FEB > 3 MAR > ..... > > Thank you for your help. > -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. From harkins at iglou.com Fri Apr 25 20:43:03 2003 From: harkins at iglou.com (Susan Harkins) Date: Fri, 25 Apr 2003 21:43:03 -0400 Subject: [dba-SQLServer]users References: Message-ID: <005301c30b95$3924ede0$9fe6ffcc@SusanOne> That's what I figured too. Not for me, just from a reader, but I'm not a SQL Server expert by any means -- needed to verify what I thought. Thanks! Susan H. > I don't think so. Must be either the table owner, db_owner, or db_ddladmin > fixed roles to create a trigger on a table. > Just curious, why such a request? > > Billy > > > > > > >From: "Susan Harkins" > >Reply-To: dba-sqlserver at databaseadvisors.com > >To: "SQLList" > >Subject: [dba-SQLServer]users > >Date: Fri, 25 Apr 2003 10:13:42 -0400 > > > >Can you grant permission to a single user or group to create a trigger -- I > >can't find any such permission. It's an odd request, I know. > > > >Susan H. > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > > > _________________________________________________________________ > Help STOP 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 harkins at iglou.com Fri Apr 25 21:25:06 2003 From: harkins at iglou.com (Susan Harkins) Date: Fri, 25 Apr 2003 22:25:06 -0400 Subject: [dba-SQLServer]Convert int month to char month References: Message-ID: <014501c30b9b$6885ee30$9fe6ffcc@SusanOne> Aha... that did work! ;) Thanks! Susan H. > You need to pass a datetime variable to convert. Try > convert(datetime,cast('4/25/03' as datetime),107) > > 107 is a style that should return MMM DD YYYY HH:MM > See BOL for a list of styles. > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan > Harkins > Sent: Friday, April 25, 2003 12:17 PM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer]Convert int month to char month > > > Server: Msg 241, Level 16, State 1, Line 1 > Syntax error converting datetime from character string. > > Got an error -- what's the 107? I'm using SQL Server 2000. > > Susan H. > > > > Ken, > > Try something like this: > > > > left(convert(datetime, mydate, 107),3) > > > > This works in SQL2000, I don't know of convert exists in SQL7. > > > > James Barash > > > > -----Original Message----- > > From: dba-sqlserver-bounces at databaseadvisors.com > > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > > Stoker, Kenneth E > > Sent: Friday, April 25, 2003 11:27 AM > > To: dba-SQLServer (E-mail) > > Subject: [dba-SQLServer]Convert int month to char month > > > > > > Does anyone know of a way to convert the return value of > > month([mydate]) from an integer to its equivalent char value? > > > > 1 JAN > > 2 FEB > > 3 MAR > > ..... > > > > Thank you for your help. > > > > Ken Stoker > > Technology Commercialization > > Information Systems Administrator > > PH: (509) 375-3758 > > FAX: (509) 375-6731 > > E-mail: Kenneth.Stoker at pnl.gov > > > > > > _______________________________________________ > > 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 mmaddison at optusnet.com.au Fri Apr 25 09:29:02 2003 From: mmaddison at optusnet.com.au (Michael Maddison) Date: Sat, 26 Apr 2003 00:29:02 +1000 Subject: [dba-SQLServer]SQL Import Spec In-Reply-To: Message-ID: Mark, Yes its possible. I dont have it handy but I found an example either in BOL or on MSDN that had a working example. cheers Michael M Thanks Charles and Francisco. I'm looking into DTS now. I think this is what I need. How can I call a saved package to run from within a sproc? Is this possible? Mark From selina at easydatabases.com.au Sat Apr 26 00:09:18 2003 From: selina at easydatabases.com.au (Selina Iddon) Date: Sat, 26 Apr 2003 15:09:18 +1000 Subject: [dba-SQLServer] Why is it so? References: Message-ID: <001d01c30bb1$fda98c90$6465000a@venus> Hi Everyone Can someone please explain the following. I had a SQL database with a Union View which took 4 seconds to open inside SQL. Using ODBC connection linked table with Access, it took 20-23 seconds to open. Trying all kinds of things I eventually made a new SQL View which did nothing but show all fields in the Union View. I then linked the new view and hey presto, Access also only takes 4 seconds to open it. Great that it worked, but I'd love to know why. Thanks Selina From davide at dalyn.co.nz Sun Apr 27 14:44:56 2003 From: davide at dalyn.co.nz (David Emerson) Date: Mon, 28 Apr 2003 07:44:56 +1200 Subject: [dba-SQLServer]Exporting tables to text In-Reply-To: <20030425141537.7749C3A01@xmxpita.myway.com> Message-ID: <5.2.0.9.0.20030428074405.00b1c960@mail.dalyn.co.nz> Thanks for the code Elizabeth. I think this may be the way I will need to go. David At 25/04/2003, you wrote: >Sheesh, sorry. I hadn't actually run through it in an ADP. > >Well, you could always manually create your file in code. I had to do >this for a file that was loaded into DB2. The load card expected some >header information in the file, so it was just as easy to create the text >file manually in code. > >The code I have has lots of extra stuff in it that you probably don't >need, so I'll give you the jist of it (this is DAO, just create your >recordset in ADO..): > > >Public Sub CreateFile() >Dim rst As DAO.Recordset >Dim strSQL As String >Dim db As DAO.Database >Dim strLine As String >On Error GoTo CreateFileError > >Set db = CurrentDb >strSQL = "SELECT * from tbltmpDataForFile" >Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot) >Open "c:\TESTFILE.txt" For Output As #1 > >With rst > Do While Not .EOF > If (!earningscode = "602" Or !earningscode = "603") And _ > Nz(!transactionamount) = 0 Then > .MoveNext > Else > strLine = "T," > strLine = strLine & "0" & !ISESyscd & "," > strLine = strLine & "0" & !transactiontype & "," > strLine = strLine & !earningscode & "," > strLine = strLine & strAmount & "," > strLine = strLine & !LivingDedCode & "," > strLine = strLine & strAmount > Print #1, strLine > .MoveNext > End If > Loop >End With >rst.Close >Set rst = Nothing >Set db = Nothing > >Elizabeth > > > >--- On Thu 04/24, David Emerson < davide at dalyn.co.nz > wrote:From: David >Emerson [mailto: davide at dalyn.co.nz]To: >dba-sqlserver at databaseadvisors.comDate: Fri, 25 Apr 2003 10:17:09 >+1200Subject: RE: [dba-SQLServer]Exporting tables to textThanks for the >reply. Unfortunately I am using an adp which doesn't allow >the saving of secifications. From michael.broesdorf at web.de Mon Apr 28 06:36:00 2003 From: michael.broesdorf at web.de (=?iso-8859-1?Q?Michael_Br=F6sdorf?=) Date: Mon, 28 Apr 2003 13:36:00 +0200 Subject: AW: [dba-SQLServer] Why is it so? In-Reply-To: <001d01c30bb1$fda98c90$6465000a@venus> Message-ID: Hi Selina, I had the same problem with some queries that where filtering data. Access obviously had to read the whole table(s) and did the filtering locally, which caused a lot of network traffic. Doing the filtering on the server using a view greatly reduced the amount of data sent over the network thereby increasing performance considerably. You can use the SQL Profiler that comes with SQL-Server to see what exactly gets requested from the server by ODBC. I found that a very usefull tool to find performance problems. HTH, Michael -----Urspr?ngliche Nachricht----- Von: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Selina Iddon Gesendet: Samstag, 26. April 2003 07:09 An: dba-sqlserver at databaseadvisors.com Betreff: [dba-SQLServer] Why is it so? Hi Everyone Can someone please explain the following. I had a SQL database with a Union View which took 4 seconds to open inside SQL. Using ODBC connection linked table with Access, it took 20-23 seconds to open. Trying all kinds of things I eventually made a new SQL View which did nothing but show all fields in the Union View. I then linked the new view and hey presto, Access also only takes 4 seconds to open it. Great that it worked, but I'd love to know why. Thanks Selina _______________________________________________ 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 Apr 28 10:34:29 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 28 Apr 2003 08:34:29 -0700 Subject: [dba-SQLServer] Why is it so? References: <001d01c30bb1$fda98c90$6465000a@venus> Message-ID: <002a01c30d9b$a95ad4a0$b615010a@FHTAPIA> Selina, You mentioned that the query took all of 4 seconds to run inside SQL, is that Query Analyzer that you're talking about? Also you said that using linked tables in access it took 20-23 seconds to open, was the Union Query made in Access when you were seeing this 20-23 time? Finally you mentioned that you linked to the view from Access and that was only 4 seconds... If the above is true on your union query then that makes perfect sense because Access will request all the data from all the tables in the query and then join them and finally come up with the results... by linking the view the work is done on the Sql Server and only the results are passed to Access... -Francisco http://rcm.netfirms.com On Friday, April 25, 2003 10:09 PM [GMT-8], Selina Iddon wrote: : Hi Everyone : Can someone please explain the following. : I had a SQL database with a Union View which took 4 seconds to open : inside SQL. Using ODBC connection linked table with Access, it took : 20-23 seconds to open. : Trying all kinds of things I eventually made a new SQL View which did : nothing but show all fields in the Union View. I then linked the new : view and hey presto, Access also only takes 4 seconds to open it. : Great that it worked, but I'd love to know why. : Thanks : Selina : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From michael.broesdorf at web.de Tue Apr 29 05:38:48 2003 From: michael.broesdorf at web.de (=?iso-8859-1?Q?Michael_Br=F6sdorf?=) Date: Tue, 29 Apr 2003 12:38:48 +0200 Subject: [dba-SQLServer]Backup question In-Reply-To: <002a01c30d9b$a95ad4a0$b615010a@FHTAPIA> Message-ID: Dear group, we have a SQL Server 2000 running 6 databases. The machine it is running on seems to have some problems, so we want to move the whole thing to a different machine. We do regular backups of our all databases residing on the SQL Server. I was wondering, what else should be backed up/scripted in order to get the SQL Server running on the new machine as fast as possible (DTS packages, logins/roles etc.). Are there any other problem we might be running into? Any help is greatly appreciated, Michael From pgalleguillos at plus.cl Tue Apr 29 06:18:50 2003 From: pgalleguillos at plus.cl (Patricio Galleguillos) Date: Tue, 29 Apr 2003 07:18:50 -0400 Subject: [dba-SQLServer]Log file size (W2000 - SQL Server 2000) In-Reply-To: Message-ID: <000001c30e41$1c19c5a0$4200a8c0@OFICINA2> Dear Group Log file went to 2.8 GB with 1.9 GB free on the disk and after a daily automatic full backup we can read from one of our DBs but not write to it. So after stopping SQL Server (and Agent) and starting it everything goes all right until next morning. After reading books on-line and making some tests in another machine, it seems that if I make a Full Back Up and put the Recovery model to Simple and then restore, the log file size goes down drastically. My doubts are: Is this the way to do it? Am I losing important data the log may be storing by changing Full to Simple in the recovery model? Is the disk size the source of the problem since backups on this DB only take 12 MB disk space? Saludos Cordiales, Patricio Galleguillos pgalleguillos at plus.cl From Tim.Pain at e20.akzonobel.com Tue Apr 29 08:20:26 2003 From: Tim.Pain at e20.akzonobel.com (Pain, T. (Tim)) Date: Tue, 29 Apr 2003 14:20:26 +0100 Subject: [dba-SQLServer]Sprocs to Excel Message-ID: <0BB2DFBAEF484F4AA077B46F1B165FE6367D60@lbrn12.d20.intra> The following code will output a sproc to an Excel sheet, but does not seem to allow for the use of input parameters to the sproc. (watch for line wrap) DoCmd.OutputTo acOutputStoredProcedure, "usp_RptProductList", acFormatXLS, "ProductList.xls", True If you use - DoCmd.OutputTo acOutputReport, "ProductList", acFormatXLS, "ProductList.xls", True You can pass the sproc input parameters via the input parameters of the report, but creating a report just to pass parameters, seems to be a waste of time when I don't actually need the report. Any ideas on how I can pass parameters to a sproc and get the sproc output to an Excel sheet would be greatly appreciated. Many thanks Tim Pain From my.lists at verizon.net Tue Apr 29 11:13:31 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 29 Apr 2003 09:13:31 -0700 Subject: [dba-SQLServer]Backup question References: Message-ID: <001f01c30e6a$474c97b0$b615010a@FHTAPIA> Michael, If you need the DTS packages, you should be able to backup the MSDB database and restore to another server (IIRC) you may want to search in google for DTS backup programs -Francisco http://rcm.netfirms.com On Tuesday, April 29, 2003 3:38 AM [GMT-8], Michael Br?sdorf wrote: : Dear group, : : we have a SQL Server 2000 running 6 databases. The machine it is : running on seems to have some problems, so we want to move the whole : thing to a different machine. : : We do regular backups of our all databases residing on the SQL Server. : : I was wondering, what else should be backed up/scripted in order to : get the SQL Server running on the new machine as fast as possible : (DTS packages, logins/roles etc.). Are there any other problem we : might be running into? : : Any help is greatly appreciated, : : Michael : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From fhtapia at hotmail.com Tue Apr 29 11:25:06 2003 From: fhtapia at hotmail.com (Francisco H Tapia) Date: Tue, 29 Apr 2003 09:25:06 -0700 Subject: [dba-SQLServer]Backup question References: <001f01c30e6a$474c97b0$b615010a@FHTAPIA> Message-ID: found the link.. http://www.sqldts.com/default.aspx?6,105,242,0,0 -Francisco http://rcm.netfirms.com On Tuesday, April 29, 2003 9:13 AM [GMT-8], Francisco H Tapia wrote: : Michael, : If you need the DTS packages, you should be able to backup the MSDB : database and restore to another server (IIRC) you may want to search : in google for DTS backup programs : : : -Francisco : http://rcm.netfirms.com : : On Tuesday, April 29, 2003 3:38 AM [GMT-8], : Michael Br?sdorf wrote: : :: Dear group, :: :: we have a SQL Server 2000 running 6 databases. The machine it is :: running on seems to have some problems, so we want to move the whole :: thing to a different machine. :: :: We do regular backups of our all databases residing on the SQL :: Server. :: :: I was wondering, what else should be backed up/scripted in order to :: get the SQL Server running on the new machine as fast as possible :: (DTS packages, logins/roles etc.). Are there any other problem we :: might be running into? :: :: Any help is greatly appreciated, :: :: Michael :: :: _______________________________________________ :: 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 Tue Apr 29 14:26:46 2003 From: davide at dalyn.co.nz (David Emerson) Date: Wed, 30 Apr 2003 07:26:46 +1200 Subject: [dba-SQLServer]Sprocs to Excel In-Reply-To: <0BB2DFBAEF484F4AA077B46F1B165FE6367D60@lbrn12.d20.intra> Message-ID: <5.2.0.9.0.20030430071547.00b1bec8@mail.dalyn.co.nz> Tim, I found that you can do the following - Dim strSproc as string strSproc = "Exec usp_RptProductList param1" DoCmd.OutputTo acOutputStoredProcedure, strSproc, acFormatXLS, "ProductList.xls", True If the parameter is a variable then use strSproc = "Exec usp_RptProductList " & param1 If the parameter is a string or date variable then use strSproc = "Exec usp_RptProductList '" & param1 & "'" One warning though, Excel will name the sheet whatever the value of strSproc is. This means that if it is longer than 31 characters you will get an error when you open the excel sheet. Excel will rename the sheet and you can carry on using it but it is annoying if this happens every time you create a new spreadsheet. The same thing happens if you have more than 1 parameter because excel doesn't like comma's in its sheet names. Do avoid this the simplest way I found was for the sproc to create a table, run the sproc first, then export the table instead. Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 At 29/04/2003, you wrote: >The following code will output a sproc to an Excel sheet, but does not >seem to allow for the use of input parameters to the sproc. (watch for >line wrap) >DoCmd.OutputTo acOutputStoredProcedure, "usp_RptProductList", >acFormatXLS, "ProductList.xls", True > >If you use - >DoCmd.OutputTo acOutputReport, "ProductList", acFormatXLS, >"ProductList.xls", True >You can pass the sproc input parameters via the input parameters of the >report, but creating a report just to pass parameters, seems to be a >waste of time when I don't actually need the report. > >Any ideas on how I can pass parameters to a sproc and get the sproc >output to an Excel sheet would be greatly appreciated. > >Many thanks >Tim Pain > > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com From selina at easydatabases.com.au Wed Apr 30 06:27:44 2003 From: selina at easydatabases.com.au (Selina Iddon) Date: Wed, 30 Apr 2003 21:27:44 +1000 Subject: [dba-SQLServer] Why is it so? References: <001d01c30bb1$fda98c90$6465000a@venus> <002a01c30d9b$a95ad4a0$b615010a@FHTAPIA> Message-ID: <007301c30f0b$85528320$6465000a@venus> Thanks for your reply Francisco, but the Union was created as a view in SQL. So SQL would have already done the work before Access asked to see the results. This is why it is so bizarre. The 4 seconds to run in SQL wasn't through Query Analyser, it was through Enterprise Manager and opening the view to 'Return all Rows'. I then used 'Link Tables' in Access to this View via ODBC. Then double clicked on the 'linked table' in the database window (not via a query) and that is where it was taking 20-22 seconds to display the records. The second view I made in SQL which made the difference was 'SELECT * FROM View_Union_Name' and when I linked this view the same way and opened it the same way it takes 4 seconds to return exactly the same record set. Wierd hey. Cheers Selina ---------------------------------------------------------------------------- ---- Selina Iddon selina at easydatabases.com.au Ph: 0414 225 265 Easy Access Databases ----- Original Message ----- From: "Francisco H Tapia" To: Sent: Tuesday, April 29, 2003 1:34 AM Subject: Re: [dba-SQLServer] Why is it so? > Selina, > You mentioned that the query took all of 4 seconds to run inside SQL, is > that Query Analyzer that you're talking about? Also you said that using > linked tables in access it took 20-23 seconds to open, was the Union Query > made in Access when you were seeing this 20-23 time? Finally you mentioned > that you linked to the view from Access and that was only 4 seconds... > > If the above is true on your union query then that makes perfect sense > because Access will request all the data from all the tables in the query > and then join them and finally come up with the results... > > by linking the view the work is done on the Sql Server and only the results > are passed to Access... > > > -Francisco > http://rcm.netfirms.com > > On Friday, April 25, 2003 10:09 PM [GMT-8], > Selina Iddon wrote: > > : Hi Everyone > : Can someone please explain the following. > : I had a SQL database with a Union View which took 4 seconds to open > : inside SQL. Using ODBC connection linked table with Access, it took > : 20-23 seconds to open. > : Trying all kinds of things I eventually made a new SQL View which did > : nothing but show all fields in the Union View. I then linked the new > : view and hey presto, Access also only takes 4 seconds to open it. > : Great that it worked, but I'd love to know why. > : Thanks > : Selina > : > : > : _______________________________________________ > : 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 selina at easydatabases.com.au Wed Apr 30 06:29:52 2003 From: selina at easydatabases.com.au (Selina Iddon) Date: Wed, 30 Apr 2003 21:29:52 +1000 Subject: [dba-SQLServer] Why is it so? References: Message-ID: <007901c30f0b$d158a3d0$6465000a@venus> Thanks Michael. The work was all being done on SQL, I wasn't querying any records in Access, only trying to open the 'linked table' which was the first view. I'll definitely try the Profiler. Cheers Selina ---------------------------------------------------------------------------- ---- Selina Iddon selina at easydatabases.com.au Ph: 0414 225 265 Easy Access Databases ----- Original Message ----- From: "Michael Br?sdorf" To: Sent: Monday, April 28, 2003 9:36 PM Subject: AW: [dba-SQLServer] Why is it so? > Hi Selina, > > I had the same problem with some queries that where filtering data. Access > obviously had to read the whole table(s) and did the filtering locally, > which caused a lot of network traffic. Doing the filtering on the server > using a view greatly reduced the amount of data sent over the network > thereby increasing performance considerably. > > You can use the SQL Profiler that comes with SQL-Server to see what exactly > gets requested from the server by ODBC. I found that a very usefull tool to > find performance problems. > > HTH, > > Michael > > -----Urspr?ngliche Nachricht----- > Von: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com]Im Auftrag von Selina > Iddon > Gesendet: Samstag, 26. April 2003 07:09 > An: dba-sqlserver at databaseadvisors.com > Betreff: [dba-SQLServer] Why is it so? > > > Hi Everyone > Can someone please explain the following. > I had a SQL database with a Union View which took 4 seconds to open inside > SQL. Using ODBC connection linked table with Access, it took 20-23 seconds > to open. > Trying all kinds of things I eventually made a new SQL View which did > nothing but show all fields in the Union View. I then linked the new view > and hey presto, Access also only takes 4 seconds to open it. Great that it > worked, but I'd love to know why. > Thanks > Selina > > > _______________________________________________ > 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 Tim.Pain at e20.akzonobel.com Wed Apr 30 11:22:45 2003 From: Tim.Pain at e20.akzonobel.com (Pain, T. (Tim)) Date: Wed, 30 Apr 2003 17:22:45 +0100 Subject: [dba-SQLServer]Sprocs to Excel Message-ID: <0BB2DFBAEF484F4AA077B46F1B165FE6367D65@lbrn12.d20.intra> David, Many thanks for the advice. I have used you suggestion of creating and outputing the sproc to a table and then outputing the table to Excel. As my sproc has 15 parameters I though this would be easier to manage. I have to fiddle around a bit with the sproc as I wanted to use if for the input to both reports and Excel. So I have just added an extra parameter which I can then test in the sproc, if false then the sproc creates a table for use with excel, if true it just returns its output to the report. Regards Tim -----Original Message----- From: David Emerson [mailto:davide at dalyn.co.nz] Sent: 29 April 2003 20:27 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Sprocs to Excel Tim, I found that you can do the following - Dim strSproc as string strSproc = "Exec usp_RptProductList param1" DoCmd.OutputTo acOutputStoredProcedure, strSproc, acFormatXLS, "ProductList.xls", True If the parameter is a variable then use strSproc = "Exec usp_RptProductList " & param1 If the parameter is a string or date variable then use strSproc = "Exec usp_RptProductList '" & param1 & "'" One warning though, Excel will name the sheet whatever the value of strSproc is. This means that if it is longer than 31 characters you will get an error when you open the excel sheet. Excel will rename the sheet and you can carry on using it but it is annoying if this happens every time you create a new spreadsheet. The same thing happens if you have more than 1 parameter because excel doesn't like comma's in its sheet names. Do avoid this the simplest way I found was for the sproc to create a table, run the sproc first, then export the table instead. Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 At 29/04/2003, you wrote: >The following code will output a sproc to an Excel sheet, but does not >seem to allow for the use of input parameters to the sproc. (watch for >line wrap) DoCmd.OutputTo acOutputStoredProcedure, >"usp_RptProductList", acFormatXLS, "ProductList.xls", True > >If you use - >DoCmd.OutputTo acOutputReport, "ProductList", acFormatXLS, >"ProductList.xls", True You can pass the sproc input parameters via the >input parameters of the report, but creating a report just to pass >parameters, seems to be a waste of time when I don't actually need the >report. > >Any ideas on how I can pass parameters to a sproc and get the sproc >output to an Excel sheet would be greatly appreciated. > >Many thanks >Tim Pain > > > > >_______________________________________________ >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 artful at rogers.com Wed Apr 30 15:50:45 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 30 Apr 2003 16:50:45 -0400 Subject: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? In-Reply-To: <22F1CCD5171D17419CB37FEEE09D5F99E553E7@TTNEXCHSRV1.hshhp.com> Message-ID: <05c501c30f5a$2be2e830$8e01a8c0@Rock> That's what I thought, and not what I want. I need the security of separate windows and sql logins. There's history here that I cannot simply revise, I have to live with decisions made by others and me years ago. Even if I were free to make changes in this context, I remain unconvinced that integrated security is better. All I can see is simpler. As I see it, even assuming that you can log in, then you still have to pass another test in order to get anywhere near the database -- except in the case of Anonymous, who maps to Public. That looks to me like wearing two condoms :-) What precisely does a trusted connection do? Assume that you're cool and automatically let you into the database? And what does an untrusted connection do? Assume you're uncool and demand a password (at either or both the windows and sql levels)? Anyway, if SSPI = Windows authentication, I need the alternative: mixed-mode authentication or whatever its name is (windows login + sql login). My vague game plan was to have a login called Anonymous with no password and decidely limited privileges. Then the web site can open the door for anyone. Other logins would correspond to employees, sales reps and so on, all aggregated into roles defining their privileges. The BOD could see reports that mere mortals couldn't. My Access app already does this, but now I need my .NET app to do it :-) Arthur -----Original Message----- From: Jim DeMarco [mailto:Jdemarco at hshhp.org] Sent: April 30, 2003 9:15 AM To: artful at rogers.com Subject: RE: [dba-VB] Trusted Connection versus What? I believe that's Windows Authentication. You see this in the M$ DataLink generated connect string when you create a new data link and specify Windows NT Integrated Security in the login info section. Don't know what it stands for though. BTW, did a quick search on google and I see it used in .NET connect strings as well so it does still exist. Jim DeMarco From fhtapia at hotmail.com Wed Apr 30 16:00:37 2003 From: fhtapia at hotmail.com (Francisco H Tapia) Date: Wed, 30 Apr 2003 14:00:37 -0700 Subject: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? References: <05c501c30f5a$2be2e830$8e01a8c0@Rock> Message-ID: Arthur, Per the http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/pg_ado_providers_6.asp TRUSTED CONNECTION, Indicates the user authentication mode. This can be set to Yes or No. The default value is No. If this property is set to Yes, then SQLOLEDB uses Microsoft Windows NT Authentication Mode to authorize user access to the SQL Server database specified by the Location and Datasource property values. If this property is set to No, then SQLOLEDB uses Mixed Mode to authorize user access to the SQL Server database. The SQL Server login and password are specified in the User Id and Password properties. -Francisco http://rcm.netfirms.com On Wednesday, April 30, 2003 1:50 PM [GMT-8], Arthur Fuller wrote: : That's what I thought, and not what I want. I need the security of : separate windows and sql logins. There's history here that I cannot : simply revise, I have to live with decisions made by others and me : years ago. Even if I were free to make changes in this context, I : remain unconvinced that integrated security is better. All I can see : is simpler. As I see it, even assuming that you can log in, then you : still have to pass another test in order to get anywhere near the : database -- except in the case of Anonymous, who maps to Public. That : looks to me like wearing two condoms :-) : : What precisely does a trusted connection do? Assume that you're cool : and automatically let you into the database? And what does an : untrusted connection do? Assume you're uncool and demand a password : (at either or both the windows and sql levels)? : : Anyway, if SSPI = Windows authentication, I need the alternative: : mixed-mode authentication or whatever its name is (windows login + : sql login). : : My vague game plan was to have a login called Anonymous with no : password and decidely limited privileges. Then the web site can open : the door for anyone. Other logins would correspond to employees, : sales reps and so on, all aggregated into roles defining their : privileges. The BOD could see reports that mere mortals couldn't. My : Access app already does this, but now I need my .NET app to do it :-) : : Arthur : : -----Original Message----- : From: Jim DeMarco [mailto:Jdemarco at hshhp.org] : Sent: April 30, 2003 9:15 AM : To: artful at rogers.com : Subject: RE: [dba-VB] Trusted Connection versus What? : : : I believe that's Windows Authentication. You see this in the M$ : DataLink generated connect string when you create a new data link and : specify Windows NT Integrated Security in the login info section. : Don't know what it stands for though. : : BTW, did a quick search on google and I see it used in .NET connect : strings as well so it does still exist. : : Jim DeMarco : : : _______________________________________________ : 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 Apr 30 16:07:07 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 30 Apr 2003 14:07:07 -0700 Subject: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? References: <05c501c30f5a$2be2e830$8e01a8c0@Rock> Message-ID: <008701c30f5c$758ba600$b615010a@FHTAPIA> Arthur, I believe that windows authentication mode would grant access based on the rights from the box (web server) that connects to the SQL Server. You could set up you web site to capture the loginid and pwd and ask for a connection on the sql server using mixed mode (or sql authentication). I don't know how you'd set it up to ask for windows login + sql server login unless of course you set up a VPN, to which your users would connect to an intranet that would then ask for another login and pwd. -Francisco http://rcm.netfirms.com On Wednesday, April 30, 2003 1:50 PM [GMT-8], Arthur Fuller wrote: : My vague game plan was to have a login called Anonymous with no : password and decidely limited privileges. Then the web site can open : the door for anyone. Other logins would correspond to employees, : sales reps and so on, all aggregated into roles defining their : privileges. The BOD could see reports that mere mortals couldn't. My : Access app already does this, but now I need my .NET app to do it :-) From artful at rogers.com Wed Apr 30 16:07:04 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 30 Apr 2003 17:07:04 -0400 Subject: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? In-Reply-To: Message-ID: <05ca01c30f5c$739eca20$8e01a8c0@Rock> Muchas gracias, Francisco! Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: April 30, 2003 5:01 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? Arthur, Per the http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/ pg_ado_providers_6.asp TRUSTED CONNECTION, Indicates the user authentication mode. This can be set to Yes or No. The default value is No. If this property is set to Yes, then SQLOLEDB uses Microsoft Windows NT Authentication Mode to authorize user access to the SQL Server database specified by the Location and Datasource property values. If this property is set to No, then SQLOLEDB uses Mixed Mode to authorize user access to the SQL Server database. The SQL Server login and password are specified in the User Id and Password properties. -Francisco From Robert.Djabarov at usaa.com Wed Apr 30 16:53:26 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 30 Apr 2003 16:53:26 -0500 Subject: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABFA5@ex02.eagle.usaa.com> Windows Integrated Authentication is not based on the web box, but on the rights associated with it or through a Windows Security group on the SQL server itself. In order to incorporate a Windows Authentication on your web site you need to implement a Windows Challenge Response within your ASP/JSP page. And, it definitely does not require a VPN! Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Francisco H Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, April 30, 2003 4:07 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? Arthur, I believe that windows authentication mode would grant access based on the rights from the box (web server) that connects to the SQL Server. You could set up you web site to capture the loginid and pwd and ask for a connection on the sql server using mixed mode (or sql authentication). I don't know how you'd set it up to ask for windows login + sql server login unless of course you set up a VPN, to which your users would connect to an intranet that would then ask for another login and pwd. -Francisco http://rcm.netfirms.com On Wednesday, April 30, 2003 1:50 PM [GMT-8], Arthur Fuller wrote: : My vague game plan was to have a login called Anonymous with no : password and decidely limited privileges. Then the web site can open : the door for anyone. Other logins would correspond to employees, : sales reps and so on, all aggregated into roles defining their : privileges. The BOD could see reports that mere mortals couldn't. My : Access app already does this, but now I need my .NET app to do it :-) _______________________________________________ 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 Apr 30 17:01:57 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 30 Apr 2003 17:01:57 -0500 Subject: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC09@ex02.eagle.usaa.com> If Trusted_Connection property is set to No, SQL OLEDB Provider is using SQL Server Standard Security Authentication mechanism, not Mixed Mode. In order to utilize the above-mentioned authentication the server (SQL) needs to be configured to accept both SQL Server and Windows Security Authentication. If a connection to the server is attempted to be established using either one of them, there is no need for the other. In fact, if a user passes the first one, even if he fails on the second, - he/she still has access to the data that he/she just got denied access with the second attempt. Kind of doesn't make sense. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Francisco H Tapia [mailto:fhtapia at hotmail.com] Sent: Wednesday, April 30, 2003 4:01 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? Arthur, Per the http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/pg_ado_providers_6.asp TRUSTED CONNECTION, Indicates the user authentication mode. This can be set to Yes or No. The default value is No. If this property is set to Yes, then SQLOLEDB uses Microsoft Windows NT Authentication Mode to authorize user access to the SQL Server database specified by the Location and Datasource property values. If this property is set to No, then SQLOLEDB uses Mixed Mode to authorize user access to the SQL Server database. The SQL Server login and password are specified in the User Id and Password properties. -Francisco http://rcm.netfirms.com On Wednesday, April 30, 2003 1:50 PM [GMT-8], Arthur Fuller wrote: : That's what I thought, and not what I want. I need the security of : separate windows and sql logins. There's history here that I cannot : simply revise, I have to live with decisions made by others and me : years ago. Even if I were free to make changes in this context, I : remain unconvinced that integrated security is better. All I can see : is simpler. As I see it, even assuming that you can log in, then you : still have to pass another test in order to get anywhere near the : database -- except in the case of Anonymous, who maps to Public. That : looks to me like wearing two condoms :-) : : What precisely does a trusted connection do? Assume that you're cool : and automatically let you into the database? And what does an : untrusted connection do? Assume you're uncool and demand a password : (at either or both the windows and sql levels)? : : Anyway, if SSPI = Windows authentication, I need the alternative: : mixed-mode authentication or whatever its name is (windows login + : sql login). : : My vague game plan was to have a login called Anonymous with no : password and decidely limited privileges. Then the web site can open : the door for anyone. Other logins would correspond to employees, : sales reps and so on, all aggregated into roles defining their : privileges. The BOD could see reports that mere mortals couldn't. My : Access app already does this, but now I need my .NET app to do it :-) : : Arthur : : -----Original Message----- : From: Jim DeMarco [mailto:Jdemarco at hshhp.org] : Sent: April 30, 2003 9:15 AM : To: artful at rogers.com : Subject: RE: [dba-VB] Trusted Connection versus What? : : : I believe that's Windows Authentication. You see this in the M$ : DataLink generated connect string when you create a new data link and : specify Windows NT Integrated Security in the login info section. : Don't know what it stands for though. : : BTW, did a quick search on google and I see it used in .NET connect : strings as well so it does still exist. : : Jim DeMarco : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fhtapia at hotmail.com Wed Apr 30 17:25:09 2003 From: fhtapia at hotmail.com (Francisco H Tapia) Date: Wed, 30 Apr 2003 15:25:09 -0700 Subject: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? References: <5A31F89EC4C79B49B5030FF2EF58E9D24EBC09@ex02.eagle.usaa.com> Message-ID: yes of course if the Sql Server is not set up to accept mixed mode authentication then of course you can't use it. (those of course were the words of MS, so I suppose they were just assuming that people had the server set up to use either or. If both Win NT authentication or Sql Server authentication grant the same access it is pointless to keep both, or it would seem unless you have 9x workstation along with NT workstations on your network. -Francisco http://rcm.netfirms.com On Wednesday, April 30, 2003 3:01 PM [GMT-8], Djabarov, Robert wrote: : If Trusted_Connection property is set to No, SQL OLEDB Provider is : using SQL Server Standard Security Authentication mechanism, not : Mixed Mode. In order to utilize the above-mentioned authentication : the server (SQL) needs to be configured to accept both SQL Server and : Windows Security Authentication. If a connection to the server is : attempted to be established using either one of them, there is no : need for the other. In fact, if a user passes the first one, even if : he fails on the second, - he/she still has access to the data that : he/she just got denied access with the second attempt. Kind of : doesn't make sense. : : Robert Djabarov : Senior SQL Server DBA : USAA IT/DBMS : ? (210) 913-3148 - phone : ? (210) 753-3148 - pager : : : -----Original Message----- : From: Francisco H Tapia [mailto:fhtapia at hotmail.com] : Sent: Wednesday, April 30, 2003 4:01 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus : What? : : Arthur, : : Per the : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/pg_ado_providers_6.asp : TRUSTED CONNECTION, : Indicates the user authentication mode. This can be set to Yes or : No. The : default value is No. If this property is set to Yes, then SQLOLEDB : uses : Microsoft Windows NT Authentication Mode to authorize user access to : the SQL : Server database specified by the Location and Datasource property : values. If : this property is set to No, then SQLOLEDB uses Mixed Mode to : authorize user : access to the SQL Server database. The SQL Server login and password : are : specified in the User Id and Password properties. : : -Francisco : http://rcm.netfirms.com : : On Wednesday, April 30, 2003 1:50 PM [GMT-8], : Arthur Fuller wrote: : :: That's what I thought, and not what I want. I need the security of :: separate windows and sql logins. There's history here that I cannot :: simply revise, I have to live with decisions made by others and me :: years ago. Even if I were free to make changes in this context, I :: remain unconvinced that integrated security is better. All I can see :: is simpler. As I see it, even assuming that you can log in, then you :: still have to pass another test in order to get anywhere near the :: database -- except in the case of Anonymous, who maps to Public. That :: looks to me like wearing two condoms :-) :: :: What precisely does a trusted connection do? Assume that you're cool :: and automatically let you into the database? And what does an :: untrusted connection do? Assume you're uncool and demand a password :: (at either or both the windows and sql levels)? :: :: Anyway, if SSPI = Windows authentication, I need the alternative: :: mixed-mode authentication or whatever its name is (windows login + :: sql login). :: :: My vague game plan was to have a login called Anonymous with no :: password and decidely limited privileges. Then the web site can open :: the door for anyone. Other logins would correspond to employees, :: sales reps and so on, all aggregated into roles defining their :: privileges. The BOD could see reports that mere mortals couldn't. My :: Access app already does this, but now I need my .NET app to do it :-) :: :: Arthur :: :: -----Original Message----- :: From: Jim DeMarco [mailto:Jdemarco at hshhp.org] :: Sent: April 30, 2003 9:15 AM :: To: artful at rogers.com :: Subject: RE: [dba-VB] Trusted Connection versus What? :: :: :: I believe that's Windows Authentication. You see this in the M$ :: DataLink generated connect string when you create a new data link and :: specify Windows NT Integrated Security in the login info section. :: Don't know what it stands for though. :: :: BTW, did a quick search on google and I see it used in .NET connect :: strings as well so it does still exist. :: :: Jim DeMarco :: :: :: _______________________________________________ :: 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 my.lists at verizon.net Wed Apr 30 17:32:00 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 30 Apr 2003 15:32:00 -0700 Subject: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus What? References: <5A31F89EC4C79B49B5030FF2EF58E9D202DABFA5@ex02.eagle.usaa.com> Message-ID: <00bc01c30f68$51b41e40$b615010a@FHTAPIA> If the Sql Server is set to windows authentication and the IIS box is hitting your sql server, I thought that "it" (the IIS server) was passing it's security context for the connection. I did not know that you could implement windows authentications from an ASP page, still then the short and quick answer for Arthur's question is you "can't" implement both sets of security in which it piggy backs one on top of the other, in this solution. Granted it does sound like a neat way to implement Windows authentication. -Francisco http://rcm.netfirms.com On Wednesday, April 30, 2003 2:53 PM [GMT-8], Djabarov, Robert wrote: : Windows Integrated Authentication is not based on the web box, but on : the rights associated with it or through a Windows Security group on : the SQL server itself. In order to incorporate a Windows : Authentication on your web site you need to implement a Windows : Challenge Response within your ASP/JSP page. And, it definitely does : not require a VPN! : : Robert Djabarov : Senior SQL Server DBA : USAA IT/DBMS : ? (210) 913-3148 - phone : ? (210) 753-3148 - pager : : : -----Original Message----- : From: Francisco H Tapia [mailto:my.lists at verizon.net] : Sent: Wednesday, April 30, 2003 4:07 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]RE: [dba-VB] Trusted Connection versus : What? : : Arthur, : I believe that windows authentication mode would grant access : based on : the rights from the box (web server) that connects to the SQL Server. : You : could set up you web site to capture the loginid and pwd and ask for a : connection on the sql server using mixed mode (or sql : authentication). I : don't know how you'd set it up to ask for windows login + sql server : login : unless of course you set up a VPN, to which your users would connect : to an : intranet that would then ask for another login and pwd. : : -Francisco : http://rcm.netfirms.com : : On Wednesday, April 30, 2003 1:50 PM [GMT-8], : Arthur Fuller wrote: : : :: My vague game plan was to have a login called Anonymous with no :: password and decidely limited privileges. Then the web site can open :: the door for anyone. Other logins would correspond to employees, :: sales reps and so on, all aggregated into roles defining their :: privileges. The BOD could see reports that mere mortals couldn't. My :: Access app already does this, but now I need my .NET app to do it :-) : : : : _______________________________________________ : 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