From martyconnelly at shaw.ca Wed Jun 1 12:24:31 2005 From: martyconnelly at shaw.ca (MartyConnelly) Date: Wed, 01 Jun 2005 10:24:31 -0700 Subject: [dba-SQLServer] Search your database.... References: Message-ID: <429DEF4F.9000608@shaw.ca> He wrote four articles on that http://databasejournal.com/features/mssql/article.php/3486331 SQL Server Full Text Search has the ability to index several types of binary data too. Included are Microsoft Word, Excel and PowerPoint documents, along with plain text, XML, and HTML pages. MSDE doesn't have this option. How about using the Google Desktop Search Engine. It also searches pdf documents. The trick here is to search only certain filetypes by adding filetype:html or filetype:txt to the end of search string It also returns all the data in an xml file, so you can search that directly from VBA or VB.Net code. It doesn't point you to the exact string only the document name that contains it. It is a work in progress, You need AddIns( open source being developed) to search certain filetypes greater than 5000 words. I know they exist for PDF, text and html. The XML doesn't return non ISO-8859-1 characters non-western european correctly in UTF-8. It is fast less than 5 secs for about 30000 files on a 20 gig disk, indexing takes about 12 hours intially. So these maybe showstoppers. I have some starter VBA code that retrieves and parses xml for this if you want it Francisco Tapia wrote: >Well a bit more googling turned up what I need, tho I'm still reading >the article, I hope this is all that is needed, anybody have any >special tricks, or caveats?... >http://www.databasejournal.com/features/mssql/article.php/3441981 > > >On 5/31/05, Francisco Tapia wrote: > > >>Yeah I forgot to mention, sorta like in the guise of Google/yahoo/msn etc.. >> >> >>SEARCH [ Machine +RPM -small ] >> >>would yeild all text w/ the word Machine and RPM but also exlcude the >>text w/ the word "small" >> >>On 5/31/05, Charlotte Foust wrote: >> >> >>>Regular Expressions? >>> >>>Charlotte Foust >>> >>> >>>-----Original Message----- >>>From: Francisco Tapia [mailto:fhtapia at gmail.com] >>>Sent: Tuesday, May 31, 2005 3:54 PM >>>To: dba-sqlserver at databaseadvisors.com >>>Subject: [dba-SQLServer] Search your database.... >>> >>> >>>Our company has been moving a lot of web content into SQL Server >>>databases... the purpose was to make them searchable. I'm not exactly >>>sure how to go about searching the ntext fields for this information.. >>>I'm thinking like, but is there a better method than the "like" >>>operator? >>> >>>maybe IN or EXISTS? >>> >>> >> >>-- >>-Francisco >>http://pcthis.blogspot.com |PC news with out the jargon! >>http://sqlthis.blogspot.com | Tsql and More... >> >> >> > > > > -- Marty Connelly Victoria, B.C. Canada From Paul.Hartland at orridge.co.uk Thu Jun 2 05:33:14 2005 From: Paul.Hartland at orridge.co.uk (Paul Hartland) Date: Thu, 2 Jun 2005 11:33:14 +0100 Subject: [dba-SQLServer] Uprading SQL Server 2000 Evaluation To SQL Server 2000 Standard Message-ID: <14A7AB003EFD444BBB193A23128DA20E391130@AL-PRI.Aldridge.local> To all, As an emergency about one month back we installed the SQL Server 2000 evaluation edition onto one of our servers, we now have a copy of SQL Server 2000 standard edition. Can someone tell me the best way to go about installing it i.e. will it let me upgrade the evaluation edition or should I install as a new instance etc and then copy the database's across and uninstall the evaluation edition ? PAUL HARTLAND Database Designer/Programmer paul.hartland at isharp.co.uk ISHARP DDI - 01922 472031 Mobile - 07730 523179 _______________________________________________ * This message is confidential. * This email, its content and any files transmitted with it are intended solely for the addressee and may be legally privileged and/or confidential. * Access by any other party is unauthorised without the express written permission of the sender. * If you have received this email in error you may not copy or use the contents, attachments or information in any way and any review, use, dissemination, forwarding, disclosure, alteration, printing of this information is strictly prohibited. Please destroy it and notify the sender via return e-mail. * This email has been prepared using information believed by Paul Hartland to be reliable and accurate, but the company makes no warranty as to accuracy or completeness. In particular the author does not accept responsibility for changes made to this email after it was sent. * Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the company or its affiliates. The Orridge web site can be found at: http://www.orridge.co.uk From accessd at shaw.ca Thu Jun 2 07:34:39 2005 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 02 Jun 2005 05:34:39 -0700 Subject: [dba-SQLServer] Uprading SQL Server 2000 Evaluation To SQL Server 2000 Standard In-Reply-To: <14A7AB003EFD444BBB193A23128DA20E391130@AL-PRI.Aldridge.local> Message-ID: <0IHG00G1KIXOMB@l-daemon> Hi Paul: Two parallel running systems is my recommendation. Install the second version. Port the details and then when you are sure the second version is running correctly the first version can be safely removed. (I have never had two versions of the same SQL running on the same machine but there should be no issues as long as they are named differently.) HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Thursday, June 02, 2005 3:33 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Uprading SQL Server 2000 Evaluation To SQL Server 2000 Standard To all, As an emergency about one month back we installed the SQL Server 2000 evaluation edition onto one of our servers, we now have a copy of SQL Server 2000 standard edition. Can someone tell me the best way to go about installing it i.e. will it let me upgrade the evaluation edition or should I install as a new instance etc and then copy the database's across and uninstall the evaluation edition ? PAUL HARTLAND Database Designer/Programmer paul.hartland at isharp.co.uk ISHARP DDI - 01922 472031 Mobile - 07730 523179 _______________________________________________ * This message is confidential. * This email, its content and any files transmitted with it are intended solely for the addressee and may be legally privileged and/or confidential. * Access by any other party is unauthorised without the express written permission of the sender. * If you have received this email in error you may not copy or use the contents, attachments or information in any way and any review, use, dissemination, forwarding, disclosure, alteration, printing of this information is strictly prohibited. Please destroy it and notify the sender via return e-mail. * This email has been prepared using information believed by Paul Hartland to be reliable and accurate, but the company makes no warranty as to accuracy or completeness. In particular the author does not accept responsibility for changes made to this email after it was sent. * Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the company or its affiliates. The Orridge web site can be found at: http://www.orridge.co.uk _______________________________________________ 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 Fri Jun 3 12:25:39 2005 From: JRojas at tnco-inc.com (Joe Rojas) Date: Fri, 3 Jun 2005 13:25:39 -0400 Subject: [dba-SQLServer] Insert trigger question Message-ID: <0CC84C9461AE6445AD5A602001C41C4B05A314@mercury.tnco-inc.com> If I have 20 records to insert into a table, in SS7, and I do it iteratively will my insert trigger execute 20 times? Currently the trigger uses a cursor based off of the inserted table and fetches 1 record at a time but I'm thinking that if I perform the insert task as stated above that I don't need a cursor because there is only on record in the inserted table anyway. Am I right? Thanks! JR This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. From JRojas at tnco-inc.com Fri Jun 3 13:07:47 2005 From: JRojas at tnco-inc.com (Joe Rojas) Date: Fri, 3 Jun 2005 14:07:47 -0400 Subject: [dba-SQLServer] Strip time portion from GETDATE() Message-ID: <0CC84C9461AE6445AD5A602001C41C4B05A316@mercury.tnco-inc.com> Hi all! SS7 Is there an easier way to strip the time portion from the value returned from GETDATE() other than CONVERT(datetime, Month(GETDATE()) + '/' + Day(GETDATE()) + '/' + Year(GETDATE()) ? Thanks! JR This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. From clopez at AirAuto.COM Fri Jun 3 13:15:19 2005 From: clopez at AirAuto.COM (Carolina Lopez) Date: Fri, 03 Jun 2005 11:15:19 -0700 Subject: [dba-SQLServer] Strip time portion from GETDATE() In-Reply-To: <0CC84C9461AE6445AD5A602001C41C4B05A316@mercury.tnco-inc.com> Message-ID: left(getdate(), 11) that's just the date returned as a character string. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Joe Rojas Sent: Friday, June 03, 2005 11:08 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer] Strip time portion from GETDATE() Hi all! SS7 Is there an easier way to strip the time portion from the value returned from GETDATE() other than CONVERT(datetime, Month(GETDATE()) + '/' + Day(GETDATE()) + '/' + Year(GETDATE()) ? Thanks! JR 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 mikedorism at verizon.net Fri Jun 3 14:45:42 2005 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Fri, 03 Jun 2005 15:45:42 -0400 Subject: [dba-SQLServer] Strip time portion from GETDATE() In-Reply-To: <0CC84C9461AE6445AD5A602001C41C4B05A316@mercury.tnco-inc.com> Message-ID: <001201c56874$d4fca7b0$2f01a8c0@hargrove.internal> Convert(datetime, GETDATE(), 112) Mike and Doris Manning mikedorism at verizon.net -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Friday, June 03, 2005 2:08 PM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer] Strip time portion from GETDATE() Hi all! SS7 Is there an easier way to strip the time portion from the value returned from GETDATE() other than CONVERT(datetime, Month(GETDATE()) + '/' + Day(GETDATE()) + '/' + Year(GETDATE()) ? Thanks! JR 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 JRojas at tnco-inc.com Fri Jun 3 15:09:17 2005 From: JRojas at tnco-inc.com (Joe Rojas) Date: Fri, 3 Jun 2005 16:09:17 -0400 Subject: [dba-SQLServer] Strip time portion from GETDATE() Message-ID: <0CC84C9461AE6445AD5A602001C41C4B05A317@mercury.tnco-inc.com> Thanks! This looks like what I was looking for! JR -----Original Message----- From: Mike & Doris Manning [mailto:mikedorism at verizon.net] Sent: Friday, June 03, 2005 3:46 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer] Strip time portion from GETDATE() Convert(datetime, GETDATE(), 112) Mike and Doris Manning mikedorism at verizon.net -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Friday, June 03, 2005 2:08 PM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer] Strip time portion from GETDATE() Hi all! SS7 Is there an easier way to strip the time portion from the value returned from GETDATE() other than CONVERT(datetime, Month(GETDATE()) + '/' + Day(GETDATE()) + '/' + Year(GETDATE()) ? Thanks! JR 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 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.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. From fhtapia at gmail.com Fri Jun 3 18:44:53 2005 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 3 Jun 2005 16:44:53 -0700 Subject: [dba-SQLServer] Insert trigger question In-Reply-To: <0CC84C9461AE6445AD5A602001C41C4B05A314@mercury.tnco-inc.com> References: <0CC84C9461AE6445AD5A602001C41C4B05A314@mercury.tnco-inc.com> Message-ID: If you are inserting via a sproc this is true, however it is best if you add some error handling to make sure that you are only dealing w/ a single record, otherwise you may want to add the functionality to handle a larger recordset, this can be true if you have other procedures that insert multple records at a time, or if you end up having to run an administrative task where you insert multiple records at once. On 6/3/05, Joe Rojas wrote: > If I have 20 records to insert into a table, in SS7, and I do it iteratively > will my insert trigger execute 20 times? > > Currently the trigger uses a cursor based off of the inserted table and > fetches 1 record at a time but I'm thinking that if I perform the insert > task as stated above that I don't need a cursor because there is only on > record in the inserted table anyway. > Am I right? > > Thanks! > JR > > > > -- -Francisco http://pcthis.blogspot.com |PC news with out the jargon! http://sqlthis.blogspot.com | Tsql and More... From ssharkins at bellsouth.net Sat Jun 4 12:31:14 2005 From: ssharkins at bellsouth.net (Susan Harkins) Date: Sat, 4 Jun 2005 13:31:14 -0400 Subject: [dba-SQLServer] one to one Message-ID: <20050604173114.WBUH25209.ibm63aec.bellsouth.net@SUSANONE> I'm guessing that you force a one-to-one in SQL Server the same way you do in Access -- by setting a unique index on the foreign key? Is this correct? Susan H. From DElam at jenkens.com Mon Jun 6 09:30:13 2005 From: DElam at jenkens.com (Elam, Debbie) Date: Mon, 6 Jun 2005 09:30:13 -0500 Subject: [dba-SQLServer] Search your database.... Message-ID: <7B1961ED924D1A459E378C9B1BB22B4C02485F28@natexch.jenkens.com> If you are looking to search text fields, you may want to consider full text indexing. Once that is implemented on the database (this is not installed standard, and requires a job to update the index regularly) the syntax is: [YourIDfield] In (Select [YourIDfield] From [YourTable] Where Contains ([YourTextField],'words separated by AND')) Debbie -----Original Message----- From: Francisco Tapia [mailto:fhtapia at gmail.com] Sent: Tuesday, May 31, 2005 5:58 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Search your database.... Yeah I forgot to mention, sorta like in the guise of Google/yahoo/msn etc.. SEARCH [ Machine +RPM -small ] would yeild all text w/ the word Machine and RPM but also exlcude the text w/ the word "small" On 5/31/05, Charlotte Foust wrote: > Regular Expressions? > > Charlotte Foust > > > -----Original Message----- > From: Francisco Tapia [mailto:fhtapia at gmail.com] > Sent: Tuesday, May 31, 2005 3:54 PM > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer] Search your database.... > > > Our company has been moving a lot of web content into SQL Server > databases... the purpose was to make them searchable. I'm not exactly > sure how to go about searching the ntext fields for this information.. > I'm thinking like, but is there a better method than the "like" > operator? > > maybe IN or EXISTS? -- -Francisco http://pcthis.blogspot.com |PC news with out the jargon! http://sqlthis.blogspot.com | Tsql and More... _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com - JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1) subject to the Attorney-Client Privilege, (2) an attorney work product, or (3) strictly confidential. If you are not the intended recipient of this message, you may not disclose, print, copy or disseminate this information. If you have received this in error, please reply and notify the sender (only) and delete the message. Unauthorized interception of this e-mail is a violation of federal criminal law. This communication does not reflect an intention by the sender or the sender's client or principal to conduct a transaction or make any agreement by electronic means. Nothing contained in this message or in any attachment shall satisfy the requirements for a writing, and nothing contained herein shall constitute a contract or electronic signature under the Electronic Signatures in Global and National Commerce Act, any version of the Uniform Electronic Transactions Act or any other statute governing electronic transactions. From Paul.Hartland at orridge.co.uk Tue Jun 7 10:06:50 2005 From: Paul.Hartland at orridge.co.uk (Paul Hartland) Date: Tue, 7 Jun 2005 16:06:50 +0100 Subject: [dba-SQLServer] Stored Procedures - Checking If Parameter Contains A Value Message-ID: <14A7AB003EFD444BBB193A23128DA20E391381@AL-PRI.Aldridge.local> To all, I have done a little work with SQL Server stored procedures with parameters (very simple ones), i.e. I have a stored procedure that selects a client based on the user entering an Account Number: CREATE PROCEDURE [genesis_select_ClientDetails] @strACNo [nvarchar](20) AS SELECT * FROM tblClient WHERE JobNo = @strACNo GO This works well enough, but what I want to do is put a simple check in there where if @strACNo IS NULL then I want @strACNo to equal the very first Account number in the Client table. I could do the check via my Visual Basic FE, but was wondering if it is possible to incorporate it into the stored procedure above. Thanks in advance for any help on this..... PAUL HARTLAND Database Designer/Programmer paul.hartland at isharp.co.uk Mobile - (+44)7730 523179 _______________________________________________ * This message is confidential. * This email, its content and any files transmitted with it are intended solely for the addressee and may be legally privileged and/or confidential. * Access by any other party is unauthorised without the express written permission of the sender. * If you have received this email in error you may not copy or use the contents, attachments or information in any way and any review, use, dissemination, forwarding, disclosure, alteration, printing of this information is strictly prohibited. Please destroy it and notify the sender via return e-mail. * This email has been prepared using information believed by Paul Hartland to be reliable and accurate, but the company makes no warranty as to accuracy or completeness. In particular the author does not accept responsibility for changes made to this email after it was sent. * Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the company or its affiliates. The Orridge web site can be found at: http://www.orridge.co.uk From fhtapia at gmail.com Tue Jun 7 11:44:25 2005 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 7 Jun 2005 09:44:25 -0700 Subject: [dba-SQLServer] Stored Procedures - Checking If Parameter Contains A Value In-Reply-To: <14A7AB003EFD444BBB193A23128DA20E391381@AL-PRI.Aldridge.local> References: <14A7AB003EFD444BBB193A23128DA20E391381@AL-PRI.Aldridge.local> Message-ID: Check BOL for the usage of ISNULL On 6/7/05, Paul Hartland wrote: > To all, > > I have done a little work with SQL Server stored procedures with > parameters (very simple ones), i.e. I have a stored procedure that > selects a client based on the user entering an Account Number: > > CREATE PROCEDURE [genesis_select_ClientDetails] > @strACNo [nvarchar](20) > > AS > > SELECT * > > FROM tblClient > > WHERE JobNo = @strACNo > > GO > > This works well enough, but what I want to do is put a simple check in > there where if @strACNo IS NULL then I want @strACNo to equal the very > first Account number in the Client table. I could do the check via my > Visual Basic FE, but was wondering if it is possible to incorporate it > into the stored procedure above. > > Thanks in advance for any help on this..... -- -Francisco http://pcthis.blogspot.com |PC news with out the jargon! http://sqlthis.blogspot.com | Tsql and More... From nick at frasiervan.com Wed Jun 8 13:07:42 2005 From: nick at frasiervan.com (nicholas van) Date: Wed, 8 Jun 2005 11:07:42 -0700 Subject: [dba-SQLServer] Stored Procedures - Checking If Parameter Contains AValue Message-ID: <200506081107.AA211222736@frasiervan.com> Will using a default value work? CREATE PROCEDURE [genesis_select_ClientDetails] @strACNo [nvarchar](20) = '000001' It should set teh @strACNo to '000001' when the input is Null. ---------- Original Message ---------------------------------- From: "Paul Hartland" Reply-To: dba-sqlserver at databaseadvisors.com Date: Tue, 7 Jun 2005 16:06:50 +0100 >To all, > >I have done a little work with SQL Server stored procedures with >parameters (very simple ones), i.e. I have a stored procedure that >selects a client based on the user entering an Account Number: > > CREATE PROCEDURE [genesis_select_ClientDetails] > @strACNo [nvarchar](20) > > AS > > SELECT * > > FROM tblClient > > WHERE JobNo = @strACNo > > GO > >This works well enough, but what I want to do is put a simple check in >there where if @strACNo IS NULL then I want @strACNo to equal the very >first Account number in the Client table. I could do the check via my >Visual Basic FE, but was wondering if it is possible to incorporate it >into the stored procedure above. > >Thanks in advance for any help on this..... > > >PAUL HARTLAND >Database Designer/Programmer >paul.hartland at isharp.co.uk >Mobile - (+44)7730 523179 > > > From dmcafee at pacbell.net Wed Jun 8 14:37:25 2005 From: dmcafee at pacbell.net (David Mcafee) Date: Wed, 8 Jun 2005 12:37:25 -0700 (PDT) Subject: [dba-SQLServer] Stored Procedures - Checking If Parameter Contains AValue In-Reply-To: 6667 Message-ID: <20050608193725.5046.qmail@web80805.mail.yahoo.com> Thats actually a great idea (if you are sure your first ID is 1, otherwise set a variable to the min ID such as: DECLARE @MinID As INT IF ISNULL(@strACNo,0) = 0 SELECT @MinID = MIN(AccountNo) FROM tblClient By the way are you the same Nick Van from Access-L (or was it AccessD) several years back? David --- nicholas van wrote: > Will using a default value work? > > CREATE PROCEDURE [genesis_select_ClientDetails] > @strACNo [nvarchar](20) = '000001' > > It should set teh @strACNo to '000001' when the > input is Null. > > ---------- Original Message > ---------------------------------- > From: "Paul Hartland" > Reply-To: dba-sqlserver at databaseadvisors.com > Date: Tue, 7 Jun 2005 16:06:50 +0100 > > >To all, > > > >I have done a little work with SQL Server stored > procedures with > >parameters (very simple ones), i.e. I have a stored > procedure that > >selects a client based on the user entering an > Account Number: > > > > CREATE PROCEDURE [genesis_select_ClientDetails] > > @strACNo [nvarchar](20) > > > > AS > > > > SELECT * > > > > FROM tblClient > > > > WHERE JobNo = @strACNo > > > > GO > > > >This works well enough, but what I want to do is > put a simple check in > >there where if @strACNo IS NULL then I want > @strACNo to equal the very > >first Account number in the Client table. I could > do the check via my > >Visual Basic FE, but was wondering if it is > possible to incorporate it > >into the stored procedure above. > > > >Thanks in advance for any help on this..... > > > > > >PAUL HARTLAND > >Database Designer/Programmer > >paul.hartland at isharp.co.uk > >Mobile - (+44)7730 523179 > > > > > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From roz.clarke at donnslaw.co.uk Fri Jun 10 05:03:08 2005 From: roz.clarke at donnslaw.co.uk (Roz Clarke) Date: Fri, 10 Jun 2005 11:03:08 +0100 Subject: [dba-SQLServer] Full-text Indexing Message-ID: <61F915314798D311A2F800A0C9C8318807225B30@dibble.observatory.donnslaw.co.uk> Hi all I have never wanted to use full text indexing before. I come to try and use it for the first time and I find I can't... No matter which of my databases I select, the Full-text Indexing menu item is greyed out. I've searched Books Online and MSDN. Is there something I'm missing here? TIA Roz -------------- next part -------------- The contents of this message and any attachments are the property of Donns Solicitors and are intended for the confidential use of the named recipient only. They may be legally privileged and should not be communicated to, or relied upon, by any other party without our written consent. If you are not the addressee, please notify us immediately so that we can make arrangements for its return. You should not show this e-mail to any person or take copies as you may be committing a criminal or civil offence for which you may be liable. The statement and opinions expressed in this e-mail message are those of the writer, and do not necessarily represent that of Donns Solicitors. Although any files attached to this e-mail will have been checked with virus protection software prior to transmission, you should carry out your own virus check before opening any attachment. Donns Solicitors does not accept any liability for any damage or loss which may be caused by software viruses... From DElam at jenkens.com Fri Jun 10 08:17:07 2005 From: DElam at jenkens.com (Elam, Debbie) Date: Fri, 10 Jun 2005 08:17:07 -0500 Subject: [dba-SQLServer] Full-text Indexing Message-ID: <7B1961ED924D1A459E378C9B1BB22B4C0492C97E@natexch.jenkens.com> Full text indexing is not installed on SQL server by default. You probably need to run setup again and add the feature. Debbie -----Original Message----- From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] Sent: Friday, June 10, 2005 5:03 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer] Full-text Indexing Hi all I have never wanted to use full text indexing before. I come to try and use it for the first time and I find I can't... No matter which of my databases I select, the Full-text Indexing menu item is greyed out. I've searched Books Online and MSDN. Is there something I'm missing here? TIA Roz - JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1) subject to the Attorney-Client Privilege, (2) an attorney work product, or (3) strictly confidential. If you are not the intended recipient of this message, you may not disclose, print, copy or disseminate this information. If you have received this in error, please reply and notify the sender (only) and delete the message. Unauthorized interception of this e-mail is a violation of federal criminal law. This communication does not reflect an intention by the sender or the sender's client or principal to conduct a transaction or make any agreement by electronic means. Nothing contained in this message or in any attachment shall satisfy the requirements for a writing, and nothing contained herein shall constitute a contract or electronic signature under the Electronic Signatures in Global and National Commerce Act, any version of the Uniform Electronic Transactions Act or any other statute governing electronic transactions. From roz.clarke at donnslaw.co.uk Fri Jun 10 09:50:52 2005 From: roz.clarke at donnslaw.co.uk (Roz Clarke) Date: Fri, 10 Jun 2005 15:50:52 +0100 Subject: [dba-SQLServer] Full-text Indexing Message-ID: <61F915314798D311A2F800A0C9C8318807225B35@dibble.observatory.donnslaw.co.uk> aahhh thanks Debbie :) and a curse on the head of the Books Online people for not saying so Roz -----Original Message----- From: Elam, Debbie [mailto:DElam at jenkens.com] Sent: 10 June 2005 14:17 To: 'dba-sqlserver at databaseadvisors.com' Subject: RE: [dba-SQLServer] Full-text Indexing Full text indexing is not installed on SQL server by default. You probably need to run setup again and add the feature. Debbie -----Original Message----- From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] Sent: Friday, June 10, 2005 5:03 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer] Full-text Indexing Hi all I have never wanted to use full text indexing before. I come to try and use it for the first time and I find I can't... No matter which of my databases I select, the Full-text Indexing menu item is greyed out. I've searched Books Online and MSDN. Is there something I'm missing here? TIA Roz - JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1) subject to the Attorney-Client Privilege, (2) an attorney work product, or (3) strictly confidential. If you are not the intended recipient of this message, you may not disclose, print, copy or disseminate this information. If you have received this in error, please reply and notify the sender (only) and delete the message. Unauthorized interception of this e-mail is a violation of federal criminal law. This communication does not reflect an intention by the sender or the sender's client or principal to conduct a transaction or make any agreement by electronic means. Nothing contained in this message or in any attachment shall satisfy the requirements for a writing, and nothing contained herein shall constitute a contract or electronic signature under the Electronic Signatures in Global and National Commerce Act, any version of the Uniform Electronic Transactions Act or any other statute governing electronic transactions. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com -------------- next part -------------- The contents of this message and any attachments are the property of Donns Solicitors and are intended for the confidential use of the named recipient only. They may be legally privileged and should not be communicated to, or relied upon, by any other party without our written consent. If you are not the addressee, please notify us immediately so that we can make arrangements for its return. You should not show this e-mail to any person or take copies as you may be committing a criminal or civil offence for which you may be liable. The statement and opinions expressed in this e-mail message are those of the writer, and do not necessarily represent that of Donns Solicitors. Although any files attached to this e-mail will have been checked with virus protection software prior to transmission, you should carry out your own virus check before opening any attachment. Donns Solicitors does not accept any liability for any damage or loss which may be caused by software viruses... From nick at frasiervan.com Fri Jun 10 09:53:20 2005 From: nick at frasiervan.com (nicholas van) Date: Fri, 10 Jun 2005 07:53:20 -0700 Subject: [dba-SQLServer] Full-text Indexing Message-ID: <200506100753.AA163971294@frasiervan.com> Did you install the Full Text Indexing component when installing Sql Server? It's a seperate component in the install. Full Text indexing is also not available through MSDE. Try this article for more information http://kb.instantasp.co.uk/Article.aspx?id=10532 ---------- Original Message ---------------------------------- From: Roz Clarke Reply-To: dba-sqlserver at databaseadvisors.com Date: Fri, 10 Jun 2005 11:03:08 +0100 >Hi all > >I have never wanted to use full text indexing before. I come to try and use >it for the first time and I find I can't... No matter which of my databases >I select, the Full-text Indexing menu item is greyed out. I've searched >Books Online and MSDN. Is there something I'm missing here? > >TIA > >Roz > From fhtapia at gmail.com Fri Jun 10 11:39:28 2005 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 10 Jun 2005 09:39:28 -0700 Subject: [dba-SQLServer] Full-text Indexing In-Reply-To: <61F915314798D311A2F800A0C9C8318807225B35@dibble.observatory.donnslaw.co.uk> References: <61F915314798D311A2F800A0C9C8318807225B35@dibble.observatory.donnslaw.co.uk> Message-ID: Roz, you must have mail set to off I had questions on Full Text Indexing a while back... this is the article I found online for installing, and setting up... http://www.databasejournal.com/features/mssql/article.php/3441981 One particular thing I found out was that I had to do the Full Text Indexing "ON" the server I was logged on to, for some reason even tho I have the client tools on my workstation I have to visit (or TS into) the server to setup fulltext indexing... alternatively I was able to remotely do this from my workstation using QA. On 6/10/05, Roz Clarke wrote: > aahhh > > thanks Debbie :) and a curse on the head of the Books Online people for not > saying so > > Roz > > -----Original Message----- > From: Elam, Debbie [mailto:DElam at jenkens.com] > Sent: 10 June 2005 14:17 > To: 'dba-sqlserver at databaseadvisors.com' > Subject: RE: [dba-SQLServer] Full-text Indexing > > > Full text indexing is not installed on SQL server by default. You probably > need to run setup again and add the feature. > > Debbie > > -----Original Message----- > From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] > Sent: Friday, June 10, 2005 5:03 AM > To: 'dba-sqlserver at databaseadvisors.com' > Subject: [dba-SQLServer] Full-text Indexing > > > Hi all > > I have never wanted to use full text indexing before. I come to try and use > it for the first time and I find I can't... No matter which of my databases > I select, the Full-text Indexing menu item is greyed out. I've searched > Books Online and MSDN. Is there something I'm missing here? > > TIA > -- -Francisco http://pcthis.blogspot.com |PC news with out the jargon! http://sqlthis.blogspot.com | Tsql and More... From adamcogan at ssw.com.au Fri Jun 10 18:20:49 2005 From: adamcogan at ssw.com.au (Adam Cogan www.ssw.com.au) Date: Sat, 11 Jun 2005 09:20:49 +1000 Subject: [dba-SQLServer] Convert from ntext to varchar Message-ID: Steven I always convert nChar to Char nVarchar to Varchar nText to Text We use a tool to do this - SSW SQL Auditor www.ssw.com.au/SQLAuditor HTH --Adam -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Steven W. Erbach Sent: Thursday, January 06, 2005 9:39 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Convert from ntext to varchar Dear Group, It seems that it might be a good idea to convert the ntext Comment columns I have in a number of tables to varchar, even though the maximum length is much less and there's no Unicode capability. The Comments in these tables aren't going to be book length. I'm having trouble, though converting from ntext to varchar. The existing columns are all ntext 16. I've tried using a stored procedure like this: CREATE PROCEDURE _spTmpConvertKeyStatsComment AS UPDATE tblKeyStats SET NewKeyStatsComment = CAST(KeyStatsComment AS varchar) GO In the tblKeyStats table I added a varchar 16 column named NewKeyStatsComments. As you can see I tried to use the CAST function. When I run this sproc in a SQL script, none of the data is copied into the NewKeyStatsComment column. I will say that some of the original KeyStatsComment values are NULL. Any thoughts? Regards, Steve Erbach Scientific Marketing Neenah, WI _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From rl_stewart at highstream.net Sun Jun 12 16:59:30 2005 From: rl_stewart at highstream.net (Robert L. Stewart) Date: Sun, 12 Jun 2005 16:59:30 -0500 Subject: [dba-SQLServer] Re: Convert from ntext to varchar In-Reply-To: <200506111700.j5BH0TR19244@databaseadvisors.com> References: <200506111700.j5BH0TR19244@databaseadvisors.com> Message-ID: <6.2.1.2.0.20050612165256.046bcd30@pop3.highstream.net> Steve, Try converting nText to Text. You are essentially taking a very large field and trying to reduce it to 16 characters with the varchar size you are using. You might check out UPDATETEXT in the books on line. Robert At 12:00 PM 6/11/2005, you wrote: >Date: Sat, 11 Jun 2005 09:20:49 +1000 >From: "Adam Cogan www.ssw.com.au" >Subject: RE: [dba-SQLServer] Convert from ntext to varchar >To: "Steven W. Erbach" >Cc: dba-sqlserver at databaseadvisors.com >Message-ID: > >Content-Type: text/plain; charset="us-ascii" > >Steven > > > >I always convert nChar to Char > > nVarchar to Varchar > > nText to Text > > > >We use a tool to do this - SSW SQL Auditor www.ssw.com.au/SQLAuditor > > > > >HTH > >--Adam > > > > > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Steven >W. Erbach >Sent: Thursday, January 06, 2005 9:39 PM >To: dba-sqlserver at databaseadvisors.com >Subject: [dba-SQLServer] Convert from ntext to varchar > > > >Dear Group, > > > >It seems that it might be a good idea to convert the ntext Comment >columns I have in a number of tables to varchar, even though the maximum >length is much less and there's no Unicode capability. The Comments in >these tables aren't going to be book length. > > > >I'm having trouble, though converting from ntext to varchar. The >existing columns are all ntext 16. I've tried using a stored procedure >like this: > > > >CREATE PROCEDURE _spTmpConvertKeyStatsComment AS > >UPDATE tblKeyStats > >SET NewKeyStatsComment = CAST(KeyStatsComment AS varchar) > > > >GO > > > >In the tblKeyStats table I added a varchar 16 column named >NewKeyStatsComments. As you can see I tried to use the CAST function. >When I run this sproc in a SQL script, none of the data is copied into >the NewKeyStatsComment column. I will say that some of the original >KeyStatsComment values are NULL. > > > >Any thoughts? > > > >Regards, > > > >Steve Erbach > >Scientific Marketing > >Neenah, WI From Paul.Hartland at orridge.co.uk Fri Jun 17 03:35:27 2005 From: Paul.Hartland at orridge.co.uk (Paul Hartland) Date: Fri, 17 Jun 2005 09:35:27 +0100 Subject: [dba-SQLServer] Multiple Updates In One Stored Procedure Message-ID: <14A7AB003EFD444BBB193A23128DA20E391886@AL-PRI.Aldridge.local> To all, If I want to create a Stored Procedure that updates multiple tables, do I have to have the word GO after each update section ? Thanks in advance for any help.. PAUL HARTLAND Database Designer/Programmer paul.hartland at isharp.co.uk ISHARP DDI - 01922 472031 Mobile - 07730 523179 _______________________________________________ * This message is confidential. * This email, its content and any files transmitted with it are intended solely for the addressee and may be legally privileged and/or confidential. * Access by any other party is unauthorised without the express written permission of the sender. * If you have received this email in error you may not copy or use the contents, attachments or information in any way and any review, use, dissemination, forwarding, disclosure, alteration, printing of this information is strictly prohibited. Please destroy it and notify the sender via return e-mail. * This email has been prepared using information believed by Paul Hartland to be reliable and accurate, but the company makes no warranty as to accuracy or completeness. In particular the author does not accept responsibility for changes made to this email after it was sent. * Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the company or its affiliates. The Orridge web site can be found at: http://www.orridge.co.uk From accessd at shaw.ca Fri Jun 17 10:24:13 2005 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 17 Jun 2005 08:24:13 -0700 Subject: [dba-SQLServer] Multiple Updates In One Stored Procedure In-Reply-To: <14A7AB003EFD444BBB193A23128DA20E391886@AL-PRI.Aldridge.local> Message-ID: <0II800F5HISCA1@l-daemon> Hi Paul: There is ways in many cases ways around using the 'GO' but it is a good way to separate the sections. This seems like an odd question.(?) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Friday, June 17, 2005 1:35 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Multiple Updates In One Stored Procedure To all, If I want to create a Stored Procedure that updates multiple tables, do I have to have the word GO after each update section ? Thanks in advance for any help.. PAUL HARTLAND Database Designer/Programmer paul.hartland at isharp.co.uk ISHARP DDI - 01922 472031 Mobile - 07730 523179 _______________________________________________ * This message is confidential. * This email, its content and any files transmitted with it are intended solely for the addressee and may be legally privileged and/or confidential. * Access by any other party is unauthorised without the express written permission of the sender. * If you have received this email in error you may not copy or use the contents, attachments or information in any way and any review, use, dissemination, forwarding, disclosure, alteration, printing of this information is strictly prohibited. Please destroy it and notify the sender via return e-mail. * This email has been prepared using information believed by Paul Hartland to be reliable and accurate, but the company makes no warranty as to accuracy or completeness. In particular the author does not accept responsibility for changes made to this email after it was sent. * Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the company or its affiliates. The Orridge web site can be found at: http://www.orridge.co.uk _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fhtapia at gmail.com Fri Jun 17 11:28:42 2005 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 17 Jun 2005 09:28:42 -0700 Subject: [dba-SQLServer] Multiple Updates In One Stored Procedure In-Reply-To: <0II800F5HISCA1@l-daemon> References: <14A7AB003EFD444BBB193A23128DA20E391886@AL-PRI.Aldridge.local> <0II800F5HISCA1@l-daemon> Message-ID: I think Paul asks, because in BOL you find a lot of examples w/ the GO keyword aftwards... I think it would help him a lot if he picked up a good Stored Procedures book. Altho BOL do seem very through. http://www.amazon.com/exec/obidos/tg/detail/-/0072228962/qid=1117667473/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/002-8508889-5196029?v=glance&s=books&n=507846 On 6/17/05, Jim Lawrence wrote: > > Hi Paul: > > There is ways in many cases ways around using the 'GO' but it is a good > way > to separate the sections. This seems like an odd question.(?) > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul > Hartland > Sent: Friday, June 17, 2005 1:35 AM > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer] Multiple Updates In One Stored Procedure > > To all, > > If I want to create a Stored Procedure that updates multiple tables, do > I have to have the word GO after each update section ? > > Thanks in advance for any help.. > > > PAUL HARTLAND > Database Designer/Programmer > paul.hartland at isharp.co.uk > ISHARP > DDI - 01922 472031 > Mobile - 07730 523179 > > > > _______________________________________________ > > * This message is confidential. > * This email, its content and any files transmitted with it are intended > solely for the addressee and may be legally privileged and/or > confidential. > * Access by any other party is unauthorised without the express written > permission of the sender. > * If you have received this email in error you may not copy or use the > contents, attachments or information in any way and any review, use, > dissemination, forwarding, disclosure, alteration, printing of this > information is strictly prohibited. Please destroy it and notify the > sender > via return e-mail. > * This email has been prepared using information believed by Paul Hartland > to be reliable and accurate, but the company makes no warranty as to > accuracy or completeness. In particular the author does not accept > responsibility for changes made to this email after it was sent. > * Any opinions expressed in this document are those of the author and do > not necessarily reflect the opinions of the company or its affiliates. > > The Orridge web site can be found at: > http://www.orridge.co.uk > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://pcthis.blogspot.com |PC news with out the jargon! http://sqlthis.blogspot.com | Tsql and More... From Paul.Hartland at orridge.co.uk Mon Jun 20 02:14:49 2005 From: Paul.Hartland at orridge.co.uk (Paul Hartland) Date: Mon, 20 Jun 2005 08:14:49 +0100 Subject: [dba-SQLServer] Multiple Updates In One Stored Procedure Message-ID: <14A7AB003EFD444BBB193A23128DA20E391918@AL-PRI.Aldridge.local> The true reason I ask is because I am passing the procedure two parameters, and after the first GO keyword it loses the parameters, but when I tried with just GO at the very end it worked fine. Yet in many examples I have seen they have had GO after each Update/Insert PAUL HARTLAND Database Designer/Programmer paul.hartland at isharp.co.uk ISHARP DDI - 01922 472031 Mobile - 07730 523179 ISHARP (Information Services for Hospitality, Audit, Retail and Pharmacy) provide IT resources for the Christie Group Stock & Inventory Services companies. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: 17 June 2005 17:29 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Multiple Updates In One Stored Procedure I think Paul asks, because in BOL you find a lot of examples w/ the GO keyword aftwards... I think it would help him a lot if he picked up a good Stored Procedures book. Altho BOL do seem very through. http://www.amazon.com/exec/obidos/tg/detail/-/0072228962/qid=1117667473/ sr=8-1/ref=sr_8_xs_ap_i1_xgl14/002-8508889-5196029?v=glance&s=books&n=50 7846 On 6/17/05, Jim Lawrence wrote: > > Hi Paul: > > There is ways in many cases ways around using the 'GO' but it is a > good way to separate the sections. This seems like an odd question.(?) > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul > Hartland > Sent: Friday, June 17, 2005 1:35 AM > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer] Multiple Updates In One Stored Procedure > > To all, > > If I want to create a Stored Procedure that updates multiple tables, > do I have to have the word GO after each update section ? > > Thanks in advance for any help.. > > > PAUL HARTLAND > Database Designer/Programmer > paul.hartland at isharp.co.uk > ISHARP > DDI - 01922 472031 > Mobile - 07730 523179 > > > > _______________________________________________ > > * This message is confidential. > * This email, its content and any files transmitted with it are > intended solely for the addressee and may be legally privileged and/or > confidential. > * Access by any other party is unauthorised without the express > written permission of the sender. > * If you have received this email in error you may not copy or use the > contents, attachments or information in any way and any review, use, > dissemination, forwarding, disclosure, alteration, printing of this > information is strictly prohibited. Please destroy it and notify the > sender via return e-mail. > * This email has been prepared using information believed by Paul > Hartland to be reliable and accurate, but the company makes no > warranty as to accuracy or completeness. In particular the author does > not accept responsibility for changes made to this email after it was sent. > * Any opinions expressed in this document are those of the author and > do not necessarily reflect the opinions of the company or its affiliates. > > The Orridge web site can be found at: > http://www.orridge.co.uk > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://pcthis.blogspot.com |PC news with out the jargon! http://sqlthis.blogspot.com | Tsql and More... _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fhtapia at gmail.com Mon Jun 20 10:22:02 2005 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 20 Jun 2005 08:22:02 -0700 Subject: [dba-SQLServer] Multiple Updates In One Stored Procedure In-Reply-To: <14A7AB003EFD444BBB193A23128DA20E391918@AL-PRI.Aldridge.local> References: <14A7AB003EFD444BBB193A23128DA20E391918@AL-PRI.Aldridge.local> Message-ID: Typically you wouldn't use the "GO" keyword in a stored procedure, instead you'd use the RETURN keyword when you completed the set of transactions you intended. On 6/20/05, Paul Hartland wrote: > > The true reason I ask is because I am passing the procedure two > parameters, and after the first GO keyword it loses the parameters, but > when I tried with just GO at the very end it worked fine. Yet in many > examples I have seen they have had GO after each Update/Insert > > > PAUL HARTLAND > Database Designer/Programmer > paul.hartland at isharp.co.uk > ISHARP > DDI - 01922 472031 > Mobile - 07730 523179 > > > > ISHARP (Information Services for Hospitality, Audit, Retail and > Pharmacy) provide IT resources for the Christie Group Stock & Inventory > Services companies. > > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > Francisco Tapia > Sent: 17 June 2005 17:29 > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] Multiple Updates In One Stored Procedure > > I think Paul asks, because in BOL you find a lot of examples w/ the GO > keyword aftwards... I think it would help him a lot if he picked up a > good Stored Procedures book. Altho BOL do seem very through. > > http://www.amazon.com/exec/obidos/tg/detail/-/0072228962/qid=1117667473/ > sr=8-1/ref=sr_8_xs_ap_i1_xgl14/002-8508889-5196029?v=glance&s=books&n=50 > 7846 > > > > On 6/17/05, Jim Lawrence wrote: > > > > Hi Paul: > > > > There is ways in many cases ways around using the 'GO' but it is a > > good way to separate the sections. This seems like an odd question.(?) > > > > -----Original Message----- > > From: dba-sqlserver-bounces at databaseadvisors.com > > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul > > Hartland > > Sent: Friday, June 17, 2005 1:35 AM > > To: dba-sqlserver at databaseadvisors.com > > Subject: [dba-SQLServer] Multiple Updates In One Stored Procedure > > > > To all, > > > > If I want to create a Stored Procedure that updates multiple tables, > > do I have to have the word GO after each update section ? > > > > Thanks in advance for any help.. > > > -- -Francisco http://pcthis.blogspot.com |PC news with out the jargon! http://sqlthis.blogspot.com | Tsql and More... From Rich_Lavsa at pghcorning.com Wed Jun 22 11:44:12 2005 From: Rich_Lavsa at pghcorning.com (Lavsa, Rich) Date: Wed, 22 Jun 2005 12:44:12 -0400 Subject: [dba-SQLServer] Linked Server - Stored Procedure Performance issue Message-ID: <2A261FF9D5EBCA46940C11688CE872EE01E969DF@goexchange2.pghcorning.com> HELLO ALL, Summary: Pass through query in Access using DSN (Oracle is faster then Linked Server in SQL Server using Stored procedure). I currently have an application that pulls data from our ERP system which is in Oracle 9i, Net8 client. The current application has an Access Front end (A2k2) and a SQL server back end. What I have been trying to do over the last 2 days is convert all PassThrough queries, into stored procedures. So far this has worked beautifully, and eliminated a ton of code which I had developed to dynamically alter the where clause and now only have to pass in a parameter for a stored procedure. Anyway, I ran into a stumbling block. The above approach helped in both simplicity and speed for all information stored in SQL server. However the information stored in Oracle hasn't gone so easy. I set up a linked server, so that all authentication will come from the server and won't have to worry about adding a new user, and having to make sure they have access to the DNS. Anyway, the current pass through query will run in roughly 1-2 seconds. When converted to a procedure to use the linked server, it jumps up to 1 minute 47 seconds. The fastest I could get it down to is 1 minute 30 seconds. Any tips/tricks/criticism welcome... Thanks in advance for any help to solve this issue. Here are the basics of what I have tried... ====================================================================== ACCESS PASS THROUGH (1-2 seconds) connect via Oracle ODBC SELECT A.ORDER_NUMBER, A.ORDER_LINE_NUMBER, B.PART_CODE, B.PART_DESC_1, c.UNIT_OF_MEASURE , c.ORDER_QUANTITY FROM fin_Prod.SALES_ORDER_LINES A, fin_Prod.PRODUCT_MASTER B, fin_Prod.SALES_ORDER_LINE_QTYS C Where (A.COMPANY_CODE = B.COMPANY_CODE) And (A.ORDER_LINE_NUMBER = C.ORDER_LINE_NUMBER) AND (A.ORDER_NUMBER = C.ORDER_NUMBER) AND (A.DIVISION = C.DIVISION) AND (A.COMPANY_CODE = C.COMPANY_CODE) AND (A.PART_CODE = B.PART_CODE) AND (A.Unit_Sales = c.UNIT_OF_MEASURE) And A.ORDER_NUMBER = '310376' AND C.ORDER_NUMBER = '310376' ====================================================================== ====================================================================== SQL Server Stored Procedure(1) sql(1min 47 seconds) uses RENCS linked server SELECT A.ORDER_NUMBER, A.ORDER_LINE_NUMBER, B.PART_CODE, B.PART_DESC_1, c.UNIT_OF_MEASURE , c.ORDER_QUANTITY FROM RENCS..FIN_PROD.SALES_ORDER_LINES A, RENCS..FIN_PROD.PRODUCT_MASTER B, RENCS..FIN_PROD.SALES_ORDER_LINE_QTYS C Where A.ORDER_NUMBER = '310376' AND C.oRDER_NUMBER = '310376' AND (A.PART_CODE = B.PART_CODE) AND (A.COMPANY_CODE = B.COMPANY_CODE) And (A.ORDER_LINE_NUMBER = C.ORDER_LINE_NUMBER) AND (A.ORDER_NUMBER = C.ORDER_NUMBER) AND (A.DIVISION = C.DIVISION) AND (A.COMPANY_CODE = C.COMPANY_CODE) AND (A.Unit_Sales = c.UNIT_OF_MEASURE) ====================================================================== ====================================================================== SQL Server Stored Procedure (2) sql (1min 30 seconds) use RENCS linked server SELECT A.ORDER_NUMBER, A.ORDER_LINE_NUMBER, B.PART_CODE, B.PART_DESC_1, C.UNIT_OF_MEASURE, C.ORDER_QUANTITY FROM OPENQUERY(RENCS, 'select ORDER_NUMBER, ORDER_LINE_NUMBER, COMPANY_CODE, PART_CODE, DIVISION, Unit_Sales from fin_Prod.SALES_ORDER_LINES') A LEFT OUTER JOIN OPENQUERY(RENCS,'select UNIT_OF_MEASURE, ORDER_QUANTITY, ORDER_LINE_NUMBER, ORDER_NUMBER, COMPANY_CODE, DIVISION from fin_Prod.SALES_ORDER_LINE_QTYS') C ON A.ORDER_NUMBER = C.ORDER_NUMBER AND A.ORDER_LINE_NUMBER = C.ORDER_LINE_NUMBER AND A.COMPANY_CODE = C.COMPANY_CODE AND A.DIVISION = C.DIVISION AND A.UNIT_SALES = C.UNIT_OF_MEASURE LEFT OUTER JOIN OPENQUERY(RENCS, 'select PART_CODE, PART_DESC_1,COMPANY_CODE from fin_Prod.PRODUCT_MASTER') B ON A.COMPANY_CODE = B.COMPANY_CODE AND A.PART_CODE = B.PART_CODE WHERE (A.ORDER_NUMBER = '310376') and (c.ORDER_NUMBER = '310376') ====================================================================== Rich From clopez at AirAuto.COM Thu Jun 23 13:34:16 2005 From: clopez at AirAuto.COM (Carolina Lopez) Date: Thu, 23 Jun 2005 11:34:16 -0700 Subject: [dba-SQLServer] dynamically create MS Access database via DTS package In-Reply-To: <2A261FF9D5EBCA46940C11688CE872EE01E969DF@goexchange2.pghcorning.com> Message-ID: Hi! Does anyone know of a way to dynamically create an Access database from scratch in a DTS package to be a destination? Would this require a custom task? How do you create that? I thought I found some code, but I couldn't get anything to work, probably due to my lack of VB knowledge. Thanks for whatever help anyone can provide! Carolina Carolina M. Lopez Airline Automation, Inc. 3530 E. Campo Abierto Ste. 200 Tucson, AZ 85718-5876 Ph. 520.577.6500 Ext. 23 From paul.hartland at fsmail.net Wed Jun 29 02:26:20 2005 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Wed, 29 Jun 2005 09:26:20 +0200 (CEST) Subject: [dba-SQLServer] Formatting A Number Into A Three Digit Character String Message-ID: <6757645.1120029980943.JavaMail.www@wwinf3203> To all, I have the foloowing stored procedure : CREATE PROCEDURE [genesis_insert_ResourceGuide] ( @strClient [nvarchar](255), @strJobType [nvarchar](100), @strACNo [nvarchar](50), @strLevel [nvarchar](75), @intMin [int], @intMax [int] ) AS SET NOCOUNT ON WHILE @intMin <= @intMax BEGIN INSERT INTO tblResourceGuide ( [Name], [ClientJobType], [A/CNo], [CountLevel], [Items], [Value], [Manager], [Supervisor], [Control], [Checker], [Counter], [Planner], [Dispensary], [Pharmacy] ) VALUES ( @strClient, @strJobType, @strACNo, 'Level ' + CONVERT(nvarchar, at intMin), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) SET @intMin = @intMin + 1 IF @intMin <= @intMax CONTINUE ELSE BREAK END SET NOCOUNT OFF GO This line 'Level ' + CONVERT(nvarchar, at intMin) as you will see converts a number into a string and adds it to Level (i.e Level 1, Level 2 etc etc).....The maximum a level will ever be is 999, so what I would like instead of Level 1, Level 2 etc etc is Level 001, Level 002 etc etc. Can someone tell me the function or code that I can use to achieve this. Thanks in advance for any help on this... Paul Hartland Database Developer -- Whatever you Wanadoo: http://www.wanadoo.co.uk/time/ This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm From mikedorism at verizon.net Wed Jun 29 06:39:33 2005 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Wed, 29 Jun 2005 07:39:33 -0400 Subject: [dba-SQLServer] Formatting A Number Into A Three Digit Character String In-Reply-To: <6757645.1120029980943.JavaMail.www@wwinf3203> Message-ID: <000401c57c9f$392641e0$2f01a8c0@hargrove.internal> Try 'Level ' + RIGHT('000' + CAST(@intMin AS varchar(3)),3) 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: Wednesday, June 29, 2005 3:26 AM To: SQL Group Subject: [dba-SQLServer] Formatting A Number Into A Three Digit Character String To all, I have the foloowing stored procedure : CREATE PROCEDURE [genesis_insert_ResourceGuide] ( @strClient [nvarchar](255), @strJobType [nvarchar](100), @strACNo [nvarchar](50), @strLevel [nvarchar](75), @intMin [int], @intMax [int] ) AS SET NOCOUNT ON WHILE @intMin <= @intMax BEGIN INSERT INTO tblResourceGuide ( [Name], [ClientJobType], [A/CNo], [CountLevel], [Items], [Value], [Manager], [Supervisor], [Control], [Checker], [Counter], [Planner], [Dispensary], [Pharmacy] ) VALUES ( @strClient, @strJobType, @strACNo, 'Level ' + CONVERT(nvarchar, at intMin), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) SET @intMin = @intMin + 1 IF @intMin <= @intMax CONTINUE ELSE BREAK END SET NOCOUNT OFF GO This line 'Level ' + CONVERT(nvarchar, at intMin) as you will see converts a number into a string and adds it to Level (i.e Level 1, Level 2 etc etc).....The maximum a level will ever be is 999, so what I would like instead of Level 1, Level 2 etc etc is Level 001, Level 002 etc etc. Can someone tell me the function or code that I can use to achieve this. Thanks in advance for any help on this... Paul Hartland Database Developer -- Whatever you Wanadoo: http://www.wanadoo.co.uk/time/ This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Paul.Hartland at orridge.co.uk Wed Jun 29 06:45:00 2005 From: Paul.Hartland at orridge.co.uk (Paul Hartland) Date: Wed, 29 Jun 2005 12:45:00 +0100 Subject: [dba-SQLServer] Formatting A Number Into A Three Digit CharacterString Message-ID: <14A7AB003EFD444BBB193A23128DA20E391E16@AL-PRI.Aldridge.local> Thanks, works like a charm....Don't know what I would do without this list sometimes. PAUL HARTLAND Database Designer/Programmer paul.hartland at isharp.co.uk ISHARP DDI - 01922 472031 Mobile - 07730 523179 ISHARP (Information Services for Hospitality, Audit, Retail and Pharmacy) provide IT resources for the Christie Group Stock & Inventory Services companies. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning Sent: 29 June 2005 12:40 To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer] Formatting A Number Into A Three Digit CharacterString Try 'Level ' + RIGHT('000' + CAST(@intMin AS varchar(3)),3) 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: Wednesday, June 29, 2005 3:26 AM To: SQL Group Subject: [dba-SQLServer] Formatting A Number Into A Three Digit Character String To all, I have the foloowing stored procedure : CREATE PROCEDURE [genesis_insert_ResourceGuide] ( @strClient [nvarchar](255), @strJobType [nvarchar](100), @strACNo [nvarchar](50), @strLevel [nvarchar](75), @intMin [int], @intMax [int] ) AS SET NOCOUNT ON WHILE @intMin <= @intMax BEGIN INSERT INTO tblResourceGuide ( [Name], [ClientJobType], [A/CNo], [CountLevel], [Items], [Value], [Manager], [Supervisor], [Control], [Checker], [Counter], [Planner], [Dispensary], [Pharmacy] ) VALUES ( @strClient, @strJobType, @strACNo, 'Level ' + CONVERT(nvarchar, at intMin), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) SET @intMin = @intMin + 1 IF @intMin <= @intMax CONTINUE ELSE BREAK END SET NOCOUNT OFF GO This line 'Level ' + CONVERT(nvarchar, at intMin) as you will see converts a number into a string and adds it to Level (i.e Level 1, Level 2 etc etc).....The maximum a level will ever be is 999, so what I would like instead of Level 1, Level 2 etc etc is Level 001, Level 002 etc etc. Can someone tell me the function or code that I can use to achieve this. Thanks in advance for any help on this... Paul Hartland Database Developer -- Whatever you Wanadoo: http://www.wanadoo.co.uk/time/ This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm _______________________________________________ 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 message is confidential. * This email, its content and any files transmitted with it are intended solely for the addressee and may be legally privileged and/or confidential. * Access by any other party is unauthorised without the express written permission of the sender. * If you have received this email in error you may not copy or use the contents, attachments or information in any way and any review, use, dissemination, forwarding, disclosure, alteration, printing of this information is strictly prohibited. Please destroy it and notify the sender via return e-mail. * This email has been prepared using information believed by Paul Hartland to be reliable and accurate, but the company makes no warranty as to accuracy or completeness. In particular the author does not accept responsibility for changes made to this email after it was sent. * Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the company or its affiliates. The Orridge web site can be found at: http://www.orridge.co.uk From dmcafee at pacbell.net Wed Jun 29 10:47:09 2005 From: dmcafee at pacbell.net (dmcafee at pacbell.net) Date: Wed, 29 Jun 2005 08:47:09 -0700 Subject: [dba-SQLServer] Formatting A Number Into A Three Digit CharacterString In-Reply-To: <000401c57c9f$392641e0$2f01a8c0@hargrove.internal> Message-ID: Wow, that's much shorter than what I've been using: REPLICATE('0', 3 - LEN(@intMin)) + CAST(@intMin AS VARCHAR(3)) or if substituting for NULLS: REPLICATE('0', 3 - LEN(ISNULL(@intMin,'000'))) + CAST(ISNULL(@intMin,'000') AS VARCHAR(3)) How did you come up with that? If I was to see that, I would assume that it would show up as 000999 (assuming @intMin = 999) David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mike & Doris Manning Sent: Wednesday, June 29, 2005 4:40 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer] Formatting A Number Into A Three Digit CharacterString Try 'Level ' + RIGHT('000' + CAST(@intMin AS varchar(3)),3) 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: Wednesday, June 29, 2005 3:26 AM To: SQL Group Subject: [dba-SQLServer] Formatting A Number Into A Three Digit Character String To all, I have the foloowing stored procedure : CREATE PROCEDURE [genesis_insert_ResourceGuide] ( @strClient [nvarchar](255), @strJobType [nvarchar](100), @strACNo [nvarchar](50), @strLevel [nvarchar](75), @intMin [int], @intMax [int] ) AS SET NOCOUNT ON WHILE @intMin <= @intMax BEGIN INSERT INTO tblResourceGuide ( [Name], [ClientJobType], [A/CNo], [CountLevel], [Items], [Value], [Manager], [Supervisor], [Control], [Checker], [Counter], [Planner], [Dispensary], [Pharmacy] ) VALUES ( @strClient, @strJobType, @strACNo, 'Level ' + CONVERT(nvarchar, at intMin), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) SET @intMin = @intMin + 1 IF @intMin <= @intMax CONTINUE ELSE BREAK END SET NOCOUNT OFF GO This line 'Level ' + CONVERT(nvarchar, at intMin) as you will see converts a number into a string and adds it to Level (i.e Level 1, Level 2 etc etc).....The maximum a level will ever be is 999, so what I would like instead of Level 1, Level 2 etc etc is Level 001, Level 002 etc etc. Can someone tell me the function or code that I can use to achieve this. Thanks in advance for any help on this... Paul Hartland Database Developer -- Whatever you Wanadoo: http://www.wanadoo.co.uk/time/ This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm _______________________________________________ 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 gmail.com Wed Jun 29 11:07:48 2005 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 29 Jun 2005 09:07:48 -0700 Subject: [dba-SQLServer] Formatting A Number Into A Three Digit CharacterString In-Reply-To: References: <000401c57c9f$392641e0$2f01a8c0@hargrove.internal> Message-ID: the RIGHT function assures that he will only be getting back the 3 digit data, because he is "ANDING" the 0's, then only selects to the right of that assuring him he will always have 3 digits or characters very clever indeed... On 6/29/05, dmcafee at pacbell.net wrote: > Wow, that's much shorter than what I've been using: > > REPLICATE('0', 3 - LEN(@intMin)) + CAST(@intMin AS VARCHAR(3)) > > or if substituting for NULLS: > > REPLICATE('0', 3 - LEN(ISNULL(@intMin,'000'))) + CAST(ISNULL(@intMin,'000') > AS VARCHAR(3)) > > > How did you come up with that? If I was to see that, I would assume that it > would show up as 000999 (assuming @intMin = 999) > > > David > > > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mike & > Doris Manning > Sent: Wednesday, June 29, 2005 4:40 AM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer] Formatting A Number Into A Three Digit > CharacterString > > > Try > > 'Level ' + RIGHT('000' + CAST(@intMin AS varchar(3)),3) > > 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: Wednesday, June 29, 2005 3:26 AM > To: SQL Group > Subject: [dba-SQLServer] Formatting A Number Into A Three Digit Character > String > > > To all, > > I have the foloowing stored procedure : > > CREATE PROCEDURE [genesis_insert_ResourceGuide] > ( > @strClient [nvarchar](255), > @strJobType [nvarchar](100), > @strACNo [nvarchar](50), > @strLevel [nvarchar](75), > @intMin [int], > @intMax [int] > ) > AS > SET NOCOUNT ON > WHILE @intMin <= @intMax > BEGIN > INSERT INTO tblResourceGuide > ( > [Name], > [ClientJobType], > [A/CNo], > [CountLevel], > [Items], > [Value], > [Manager], > [Supervisor], > [Control], > [Checker], > [Counter], > [Planner], > [Dispensary], > [Pharmacy] > ) > VALUES > ( > @strClient, > @strJobType, > @strACNo, > 'Level ' + CONVERT(nvarchar, at intMin), > 0, > 0, > 0, > 0, > 0, > 0, > 0, > 0, > 0, > 0 > ) > SET @intMin = @intMin + 1 > IF @intMin <= @intMax > CONTINUE > ELSE > BREAK > END > SET NOCOUNT OFF > GO > > This line 'Level ' + CONVERT(nvarchar, at intMin) as you will see converts a > number into a string and adds it to Level (i.e Level 1, Level 2 etc > etc).....The maximum a level will ever be is 999, so what I would like > instead of Level 1, Level 2 etc etc is Level 001, Level 002 etc etc. Can > someone tell me the function or code that I can use to achieve this. > > Thanks in advance for any help on this... > > Paul Hartland > Database Developer > > -- > > Whatever you Wanadoo: > http://www.wanadoo.co.uk/time/ > > This email has been checked for most known viruses - find out more at: > http://www.wanadoo.co.uk/help/id/7098.htm > _______________________________________________ > 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 > > -- -Francisco http://pcthis.blogspot.com |PC news with out the jargon! http://sqlthis.blogspot.com | Tsql and More... From clopez at AirAuto.COM Thu Jun 30 10:21:04 2005 From: clopez at AirAuto.COM (Carolina Lopez) Date: Thu, 30 Jun 2005 08:21:04 -0700 Subject: [dba-SQLServer] dynamically create MS Access database via DTS package In-Reply-To: Message-ID: Hi! Does anyone know of a way to dynamically create an Access database from scratch in a DTS package to be a destination? Would this require a custom task? How do you create that? I thought I found some code, but I couldn't get anything to work, probably due to my lack of VB knowledge. Thanks for whatever help anyone can provide! Carolina From mikedorism at verizon.net Thu Jun 30 10:38:05 2005 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Thu, 30 Jun 2005 11:38:05 -0400 Subject: [dba-SQLServer] dynamically create MS Access database via DTS package In-Reply-To: Message-ID: <000701c57d89$b5d40610$2f01a8c0@hargrove.internal> There are a couple of options depending on what you are trying to do. You could do it through an ActiveX task or you can do it through a TransferData task. Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com From clopez at AirAuto.COM Thu Jun 30 10:45:11 2005 From: clopez at AirAuto.COM (Carolina Lopez) Date: Thu, 30 Jun 2005 08:45:11 -0700 Subject: [dba-SQLServer] dynamically create MS Access database via DTS package In-Reply-To: <000701c57d89$b5d40610$2f01a8c0@hargrove.internal> Message-ID: Hello! Thanks for your response. I'm interested in the ActiveX option. Have you done this before? I want to create the Access database file from scratch via ActiveX, but not sure how to go about doing that. If you have any info, it sure would be appreciated! Thanks! Carolina -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mike & Doris Manning Sent: Thursday, June 30, 2005 8:38 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer] dynamically create MS Access database via DTS package There are a couple of options depending on what you are trying to do. You could do it through an ActiveX task or you can do it through a TransferData task. Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From DElam at jenkens.com Thu Jun 30 11:07:01 2005 From: DElam at jenkens.com (Elam, Debbie) Date: Thu, 30 Jun 2005 11:07:01 -0500 Subject: [dba-SQLServer] dynamically create MS Access database via DTS package Message-ID: <7B1961ED924D1A459E378C9B1BB22B4C0492CA62@natexch.jenkens.com> If someone has VB code that can create a database that might work. I don't have any, I have created Access databases from within other Access databases, but nothing else. Debbie -----Original Message----- From: Carolina Lopez [mailto:clopez at airauto.com] Sent: Thursday, June 30, 2005 10:21 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] dynamically create MS Access database via DTS package Hi! Does anyone know of a way to dynamically create an Access database from scratch in a DTS package to be a destination? Would this require a custom task? How do you create that? I thought I found some code, but I couldn't get anything to work, probably due to my lack of VB knowledge. Thanks for whatever help anyone can provide! Carolina _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com - JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1) subject to the Attorney-Client Privilege, (2) an attorney work product, or (3) strictly confidential. If you are not the intended recipient of this message, you may not disclose, print, copy or disseminate this information. If you have received this in error, please reply and notify the sender (only) and delete the message. Unauthorized interception of this e-mail is a violation of federal criminal law. This communication does not reflect an intention by the sender or the sender's client or principal to conduct a transaction or make any agreement by electronic means. Nothing contained in this message or in any attachment shall satisfy the requirements for a writing, and nothing contained herein shall constitute a contract or electronic signature under the Electronic Signatures in Global and National Commerce Act, any version of the Uniform Electronic Transactions Act or any other statute governing electronic transactions. From mikedorism at verizon.net Thu Jun 30 11:17:48 2005 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Thu, 30 Jun 2005 12:17:48 -0400 Subject: [dba-SQLServer] dynamically create MS Access database via DTSpackage In-Reply-To: Message-ID: <000801c57d8f$423f30c0$2f01a8c0@hargrove.internal> SQLDTS.com is my favorite link when I need help of this time. Here is a link that shows you how to create an Access database from scratch using DTS http://www.sqldts.com/default.aspx?288 I also highly recommend Microsoft SQL Server 2000 DTS (ISBN 0672320118) Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com From clopez at AirAuto.COM Thu Jun 30 11:39:12 2005 From: clopez at AirAuto.COM (Carolina Lopez) Date: Thu, 30 Jun 2005 09:39:12 -0700 Subject: [dba-SQLServer] dynamically create MS Access database via DTSpackage In-Reply-To: <000801c57d8f$423f30c0$2f01a8c0@hargrove.internal> Message-ID: Thanks for the link! Carolina -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Mike & Doris Manning Sent: Thursday, June 30, 2005 9:18 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer] dynamically create MS Access database via DTSpackage SQLDTS.com is my favorite link when I need help of this time. Here is a link that shows you how to create an Access database from scratch using DTS http://www.sqldts.com/default.aspx?288 I also highly recommend Microsoft SQL Server 2000 DTS (ISBN 0672320118) Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From martyconnelly at shaw.ca Thu Jun 30 13:14:20 2005 From: martyconnelly at shaw.ca (MartyConnelly) Date: Thu, 30 Jun 2005 11:14:20 -0700 Subject: [dba-SQLServer] dynamically create MS Access database via DTSpackage References: <000801c57d8f$423f30c0$2f01a8c0@hargrove.internal> Message-ID: <42C4367C.2010706@shaw.ca> You can also use ADOX VB code to create fields and indexes in tables. Sample code here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovrcreatingmodifyingaccesstables.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovrcreatingmodifyingindexes.asp?frame=true You can set keys and relationships with MS SQL though. (lower case user defined) CREATE TABLE Table1 (Id COUNTER CONSTRAINT PrimaryKey PRIMARY KEY, MyText TEXT (10)) CREATE TABLE Table2 (Id LONG, MyText TEXT) ALTER TABLE Table2 ADD CONSTRAINT Relation1 FOREIGN KEY ([Id]) REFERENCES Table1 ([Id]) Creating and Modifying Stored Queries via ADOX with Caveats http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovrcreatingmodifyingstoredqueries.asp?frame=true Mike & Doris Manning wrote: >SQLDTS.com is my favorite link when I need help of this time. Here is a >link that shows you how to create an Access database from scratch using DTS >http://www.sqldts.com/default.aspx?288 > >I also highly recommend Microsoft SQL Server 2000 DTS (ISBN 0672320118) > >Doris Manning >Database Administrator >Hargrove Inc. >www.hargroveinc.com > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > > > > > -- Marty Connelly Victoria, B.C. Canada