From szeller at cce.umn.edu Mon Mar 3 08:27:58 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Mon, 3 Mar 2003 08:27:58 -0600 Subject: [dba-SQLServer]Importing txt file Message-ID: If you are using an ADP, there is no such thing as a temporary table in the Access FE file. You'll have to do it all in SQL Server. There are temp tables in SQL Server denoted by a # before the name; and you'd use DTS to get the data into SQL Server. --Susan -----Original Message----- From: David Emerson [mailto:davide at dalyn.co.nz] Sent: Friday, February 28, 2003 1:43 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Importing txt file I don't think it is a problem with references by that Transfertext doesn't work with SQL Tables. Is there anyone else using an ADP and can use TransferText? David At 27/02/2003, you wrote: >Hi Doug: > >Check you references. There is probably a specific ole or dll that >Access97 had installed through it's reference list that is not >installed by default. Check the items in the Reference list in Access97 >and then check Access2002's Reference list. Install the missing >entry(s) and it should run fine. > >HTH >Jim > >-----Original Message----- >From: dba-sqlserver-admin at databaseadvisors.com >[mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of David >Emerson >Sent: Thursday, February 27, 2003 5:41 PM >To: dba-SQLServer at databaseadvisors.com >Subject: [dba-SQLServer]Importing txt file > > >In my A97 database I have a line which imports some raw data into a >temporary table - > >DoCmd.TransferText acImportDelim, "CVRAW", "ttmpCVRaw", >C\Data\RawData.txt, True > >Now that I have an AXP connected to SQL2K this doesn't work. What is >the method for importing into a table? From here I will be using a >sproc to manipulate the data into the right format to be added to >another table. > > >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 artful at rogers.com Mon Mar 3 12:43:35 2003 From: artful at rogers.com (Arthur Fuller) Date: Mon, 3 Mar 2003 13:43:35 -0500 Subject: [dba-SQLServer]Restore from Command Line? In-Reply-To: <00b201c2df6d$2922c8d0$b615010a@FHTAPIA> Message-ID: <005d01c2e1b4$cc35dc80$8e01a8c0@Rock> I have been looking at the SQLDMO library. It appears as if this approach may be better. (I did sp_attach... several times yesterday, with some questionable results, i.e. database is suspect messages afterwards from EM and sure enough, no tables no nothing). The DMO stuff looks promising, but one question. Assume that on the development box the db is stored say on e:\program files\Microsoft SQL Server\...\data. Assume that it should be restored to the same dir but on drive c:\. On looking through the DMO stuff, I can't readily see a property which would override the "physical file" property that is stored with the backup. Any suggestions on how to deal with that? Are the physical file attributes stored somewhere in the Restore object? Arthur -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: February 28, 2003 4:06 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Restore from Command Line? Then I would run a command from your Access ADP that connects to the MSDE and does nothing else but that... With CMD .Commandtext = "sp_attach .... 'more code End with -Francisco http://rcm.netfirms.com ----- Original Message ----- From: "Arthur Fuller" To: Sent: Friday, February 28, 2003 12:23 PM Subject: RE: [dba-SQLServer]Restore from Command Line? : I have assured that I can assume that MSDE is both installed and running. : The real issue is how to restore the database without user intervention. I : have been assured that on all target boxes the data directory and the MSDE : installation will be identical (the defaults on drive c:). So I'm thinking : that the tiny-Access-app with a call to sp_attach_db_single is the way to : go.... : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco H : Tapia : Sent: February 28, 2003 10:47 AM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Restore from Command Line? : : I have some SQL-DMO code lying around here that checks for a running : instance of SQL (msde) and if the local box does not have it running it : starts the service... I'll fish around for it today and forward it when I : find it... in any case it "should" help you...as for a command line : restore... I have not tried this but just a wag... using a batch file to log : into osql might be help out in this situation but of course this assumes : that SQL (msde) is running already... : : -Francisco : http://rcm.netfirms.com : ----- Original Message ----- : From: "Arthur Fuller" : To: : Cc: "Djabarov, Robert" : Sent: Friday, February 28, 2003 6:51 AM : Subject: RE: [dba-SQLServer]Restore from Command Line? : : : : I have searched BOL looking for this, so far without success. As I : consider : : the problem, however, a simple command-line restore may not solve it. The : : target machine is assumed to have a running instance of MSDE on it, but : not : : EM. I noticed that you cannot use the Access ADP backup and restore menu : : options on this box. I may have to go the sp_attach_db route. I suppose I : : can whip up a very simple Access app that does nothing but exec : sp_attach_db : : and the filename. : : Meanwhile, if you can give me a more accurate pointer to the BOL piece you : : meant, I'd appreciate it. : : : : -----Original Message----- : : From: dba-sqlserver-admin at databaseadvisors.com : : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Djabarov, : : Robert : : Sent: February 26, 2003 12:22 PM : : To: dba-sqlserver at databaseadvisors.com : : Subject: RE: [dba-SQLServer]Restore from Command Line? : : : : bol : : : : ______________________________________________________ : : Robert Djabarov : : Certified MS SQL Server DBA : : Certified MS SQL Server Programmer : : Certified MS VB Programmer : : * (210) 913-3148 - phone : : * (210) 753-3148 - pager : : : <*************************************************************************** : : **********************> : : : : -----Original Message----- : : From: dba-sqlserver-admin at databaseadvisors.com : : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Arthur : : Fuller : : Sent: Wednesday, February 26, 2003 10:37 AM : : To: dba-sqlserver at databaseadvisors.com : : Subject: [dba-SQLServer]Restore from Command Line? : : : : Can I restore a database from the command line (i.e. without any user : : intervention)? The P&D wizard offers the option to execute any command : once : : installation is finished. The CD will contain a zip of a database backup, : : and I want to restore it to a known name without any user intervention. : : TIA, : : Arthur : : : : : : _______________________________________________ : : 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 tuxedo_man at hotmail.com Mon Mar 3 15:03:26 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Mon, 03 Mar 2003 21:03:26 +0000 Subject: [dba-SQLServer]SQL Server default value not happening Message-ID: Try running this via query analyzer. It will tell you whether there is a default constraint for the column in question: SELECT TABLE_NAME, COLUMN_NAME, COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'type_in_column_name_here'; Billy >From: "John W. Colby" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: RE: [dba-SQLServer]SQL Server default value not happening >Date: Thu, 27 Feb 2003 09:18:19 -0500 > >No, I understand that. It is NOT being set AT ALL in the created record >from inside the ADP. That's how I discovered it wasn't being set. This >case is my active flag which must be set to see records. Three records >created yesterday were mysteriously missing. The answer... the active flag >is not being set true by default when the record is created. > >Further, IN DESIGN VIEW in the ADP, the default value doesn't show. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >-----Original Message----- >From: dba-sqlserver-admin at databaseadvisors.com >[mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Arthur >Fuller >Sent: Thursday, February 27, 2003 9:09 AM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]SQL Server default value not happening > > >I assume that you mean the SQL level default value rather than the Access >level default. If so, I don't think you'll see it set until after you save >the row. Same behaviour as ANPK values. > >-----Original Message----- >From: dba-sqlserver-admin at databaseadvisors.com >[mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of John W. >Colby >Sent: February 27, 2003 7:41 AM >To: AccessD >Cc: AccessD-SQLServer >Subject: [dba-SQLServer]SQL Server default value not happening > >I upsized my client billing to SQL Server the other day. This morning I >noticed that a couple of flag fields in my main time table are not being >set >to their default value. I went directly into EM and created a record in >the >table and the flags are correctly set there. I opened the ADP, opened the >table there and entered a record, and the default value is NOT being set >correctly there. > >Any ideas why the default values would work in EM but not in the ADP? > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >---------------------------------------------------- >Is email taking over your day? Manage your time with eMailBoss. >Try it free! http://www.eMailBoss.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 > > > > >---------------------------------------------------- >Is email taking over your day? Manage your time with eMailBoss. >Try it free! http://www.eMailBoss.com ><< winmail.dat > _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From davide at dalyn.co.nz Mon Mar 3 16:34:10 2003 From: davide at dalyn.co.nz (David Emerson) Date: Tue, 04 Mar 2003 11:34:10 +1300 Subject: [dba-SQLServer]Importing txt file - Solved In-Reply-To: Message-ID: <5.2.0.9.0.20030304113122.00b2bfa0@mail.dalyn.co.nz> It seems that ADP's don't have specs for importing. I needed to rename the fields in the column header of the txt file to match the fields in my SQL table. Then the transfertext command worked ok. (Sorry about the confusion Susan - By temporary table I meant one I had created in SQL as a temporary store of the data so that I could tidy it up before using it in my main tables). David At 3/03/2003, you wrote: >If you are using an ADP, there is no such thing as a temporary table in >the Access FE file. You'll have to do it all in SQL Server. There are >temp tables in SQL Server denoted by a # before the name; and you'd use >DTS to get the data into SQL Server. > >--Susan > >-----Original Message----- >From: David Emerson [mailto:davide at dalyn.co.nz] >Sent: Friday, February 28, 2003 1:43 PM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Importing txt file > > >I don't think it is a problem with references by that Transfertext >doesn't >work with SQL Tables. Is there anyone else using an ADP and can use >TransferText? > >David > > >At 27/02/2003, you wrote: > >Hi Doug: > > > >Check you references. There is probably a specific ole or dll that > >Access97 had installed through it's reference list that is not > >installed by default. Check the items in the Reference list in Access97 > > >and then check Access2002's Reference list. Install the missing > >entry(s) and it should run fine. > > > >HTH > >Jim > > > >-----Original Message----- > >From: dba-sqlserver-admin at databaseadvisors.com > >[mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of David > >Emerson > >Sent: Thursday, February 27, 2003 5:41 PM > >To: dba-SQLServer at databaseadvisors.com > >Subject: [dba-SQLServer]Importing txt file > > > > > >In my A97 database I have a line which imports some raw data into a > >temporary table - > > > >DoCmd.TransferText acImportDelim, "CVRAW", "ttmpCVRaw", > >C\Data\RawData.txt, True > > > >Now that I have an AXP connected to SQL2K this doesn't work. What is > >the method for importing into a table? From here I will be using a > >sproc to manipulate the data into the right format to be added to > >another table. > > > > > >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 > >_______________________________________________ >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 Mon Mar 3 22:14:29 2003 From: davide at dalyn.co.nz (David Emerson) Date: Tue, 04 Mar 2003 17:14:29 +1300 Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters Message-ID: <5.2.0.9.0.20030304170829.00b1b6a0@mail.dalyn.co.nz> What I am looking for here is some confirmation I am doing the right thing. In A97 I had a simple statement to return a single value if the corresponding record existed (this was in the Control Source of a field - =IIf(Not IsNull([CustIDNo]),nz(DLookUp("Current","tblCustStatement","CustIDNo = " & [CustIDNo] & " and StatementNumber = " & [InvNumber]-1),0)) Now in my ADP I am using the following (and setting the field control source to '=cbfAmtDue()') - Public Function cbfAmtDue() As Currency Dim cnn As ADODB.Connection, rst As ADODB.Recordset Set cnn = CurrentProject.Connection Set rst = New ADODB.Recordset rst.Open "tblCustStatement", cnn, adOpenDynamic, adLockOptimistic cbfAmtDue = 0 If Not IsNull([CustIDNo]) Then rst.Filter = "CustIDNo = " & Me!CustIDNo & " and StatementNumber = " & DLookup("InvNumber", "tblCustomers", "CustomerID = " & Me!txtCustID) - 1 If rst.EOF <> True Then 'Statement record exists cbfAmtDue = rst!CurrentMth End If End If rst.Close Set rst = Nothing cnn.Close Set cnn = Nothing It seems a long way about it but is there any simpler way? 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 Mar 4 01:40:30 2003 From: my.lists at verizon.net (Francisco Tapia) Date: Mon, 3 Mar 2003 23:40:30 -0800 Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters References: <5.2.0.9.0.20030304170829.00b1b6a0@mail.dalyn.co.nz> Message-ID: <007c01c2e221$56f06b30$0eb62904@amd2k> Think sprocs, David.... So your Function would be more along the lines of.. Public Function cbfAmtDue() as Currency Dim rst ADODB.Recordset Set rst = New ADODB.Recordset Currentproject.Connection.stp_AmountDue CustIDNo, InvNumber - 1, rst if rst.eof = true then cbfAmtDue = Null 'Or 0 else cbfAmtDue = rst!CurrentMth end if '--------END Now in a sproc on your SQL Server you'd add the following sproc... ---------- Create Procedure stp_AmountDue (@CustIDno as int, @InvNumber as Int) AS SELECT CurrentMth From tblCustStatement Where CustNoId = @CustNoId AND InvNumber = @InvNumber ---------END this is all OTOMH, so please check your syntax... -Francisco http://rcm.netfirms.com/ ----- Original Message ----- From: "David Emerson" To: Sent: Monday, March 03, 2003 8:14 PM Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters : What I am looking for here is some confirmation I am doing the right thing. : : In A97 I had a simple statement to return a single value if the : corresponding record existed (this was in the Control Source of a field - : : =IIf(Not : IsNull([CustIDNo]),nz(DLookUp("Current","tblCustStatement","CustIDNo = " & : [CustIDNo] & " and StatementNumber = " & [InvNumber]-1),0)) : : Now in my ADP I am using the following (and setting the field control : source to '=cbfAmtDue()') - : : Public Function cbfAmtDue() As Currency : : Dim cnn As ADODB.Connection, rst As ADODB.Recordset : : Set cnn = CurrentProject.Connection : Set rst = New ADODB.Recordset : rst.Open "tblCustStatement", cnn, adOpenDynamic, adLockOptimistic : : cbfAmtDue = 0 : If Not IsNull([CustIDNo]) Then : rst.Filter = "CustIDNo = " & Me!CustIDNo & " and StatementNumber = : " & DLookup("InvNumber", "tblCustomers", "CustomerID = " & Me!txtCustID) - 1 : If rst.EOF <> True Then 'Statement record exists : cbfAmtDue = rst!CurrentMth : End If : End If : : rst.Close : Set rst = Nothing : cnn.Close : Set cnn = Nothing : : It seems a long way about it but is there any simpler way? : : : 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 mikedorism at ntelos.net Tue Mar 4 07:16:06 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Tue, 4 Mar 2003 08:16:06 -0500 Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters In-Reply-To: <007c01c2e221$56f06b30$0eb62904@amd2k> Message-ID: <000201c2e250$3a6da340$84390cd8@hargrove.internal> Actually he doesn't need to use a recordset at all. He could create a sproc that returns "CurrentMth" as an Output Parameter. If there is no matching record, then the return value is NULL and he can use NZ function to convert it to 0. Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Tuesday, March 04, 2003 02:41 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters Think sprocs, David.... So your Function would be more along the lines of.. Public Function cbfAmtDue() as Currency Dim rst ADODB.Recordset Set rst = New ADODB.Recordset Currentproject.Connection.stp_AmountDue CustIDNo, InvNumber - 1, rst if rst.eof = true then cbfAmtDue = Null 'Or 0 else cbfAmtDue = rst!CurrentMth end if '--------END Now in a sproc on your SQL Server you'd add the following sproc... ---------- Create Procedure stp_AmountDue (@CustIDno as int, @InvNumber as Int) AS SELECT CurrentMth From tblCustStatement Where CustNoId = @CustNoId AND InvNumber = @InvNumber ---------END this is all OTOMH, so please check your syntax... -Francisco http://rcm.netfirms.com/ ----- Original Message ----- From: "David Emerson" To: Sent: Monday, March 03, 2003 8:14 PM Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters : What I am looking for here is some confirmation I am doing the right thing. : : In A97 I had a simple statement to return a single value if the : corresponding record existed (this was in the Control Source of a field - : : =IIf(Not : IsNull([CustIDNo]),nz(DLookUp("Current","tblCustStatement","CustIDNo = " & : [CustIDNo] & " and StatementNumber = " & [InvNumber]-1),0)) : : Now in my ADP I am using the following (and setting the field control : source to '=cbfAmtDue()') - : : Public Function cbfAmtDue() As Currency : : Dim cnn As ADODB.Connection, rst As ADODB.Recordset : : Set cnn = CurrentProject.Connection : Set rst = New ADODB.Recordset : rst.Open "tblCustStatement", cnn, adOpenDynamic, adLockOptimistic : : cbfAmtDue = 0 : If Not IsNull([CustIDNo]) Then : rst.Filter = "CustIDNo = " & Me!CustIDNo & " and StatementNumber = : " & DLookup("InvNumber", "tblCustomers", "CustomerID = " & Me!txtCustID) - 1 : If rst.EOF <> True Then 'Statement record exists : cbfAmtDue = rst!CurrentMth : End If : End If : : rst.Close : Set rst = Nothing : cnn.Close : Set cnn = Nothing : : It seems a long way about it but is there any simpler way? : : : 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 my.lists at verizon.net Tue Mar 4 11:51:44 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 4 Mar 2003 09:51:44 -0800 Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters References: <000201c2e250$3a6da340$84390cd8@hargrove.internal> Message-ID: <001301c2e276$b8fe7f60$b615010a@FHTAPIA> So maybe something like this? Dim oCmd As ADODB.Command Dim lRecordsAffected As Long ' Create and Open a new Connection Set oConn = New ADODB.Connection Set oConn = CurrentProject.Connection ' Create a new Command Set oCmd = New ADODB.Command With oCmd .CommandType = adCmdStoredProc .CommandText = "stp_AmountDue " Set .ActiveConnection = oConn ' Create the Command's Parameters and set their values .Parameters.Append .CreateParameter("RETURN_VALUE", _ adInteger, adParamReturnValue, 0) .Parameters.Append .CreateParameter("AmountDue", _ adCurrency, adParameterOutput, , NULL) .Parameters.Append .CreateParameter("CustIdNo", _ adInteger, adParamInput, , CustIdNo) .Parameters.Append .CreateParameter("InvNumber", _ adInteger, adParamInput, , InvNumber -1) ' Run the command .Execute lRecordsAffected, , adExecuteNoRecords ' Do not return recordset ' Print new identity value Debug.Print .Parameters("AmountDue").Value ' New Identity End With CREATE Procedure stp_AmountDue (@AmountDue as Currency, @CustIDno as int, @InvNumber as Int) AS SELECT @AmountDue = CurrentMth FROM tblCustStatement WHERE CustNoId = @CustNoId AND InvNumber = @InvNumber ---------END -Francisco http://rcm.netfirms.com ----- Original Message ----- From: "Mike and Doris Manning" To: Sent: Tuesday, March 04, 2003 5:16 AM Subject: RE: [dba-SQLServer]Replacement for DLookup with 2 parameters : Actually he doesn't need to use a recordset at all. He could create a sproc : that returns "CurrentMth" as an Output Parameter. If there is no matching : record, then the return value is NULL and he can use NZ function to convert : it to 0. : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco : Tapia : Sent: Tuesday, March 04, 2003 02:41 AM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : Think sprocs, David.... : So your Function would be more along the lines of.. : : Public Function cbfAmtDue() as Currency : Dim rst ADODB.Recordset : Set rst = New ADODB.Recordset : : Currentproject.Connection.stp_AmountDue CustIDNo, InvNumber - 1, rst : : if rst.eof = true then : cbfAmtDue = Null 'Or 0 : else : cbfAmtDue = rst!CurrentMth : end if : '--------END : Now in a sproc on your SQL Server you'd add the following sproc... : : ---------- : Create Procedure stp_AmountDue (@CustIDno as int, @InvNumber as Int) AS : SELECT CurrentMth From tblCustStatement Where CustNoId = @CustNoId AND : InvNumber = @InvNumber ---------END : : this is all OTOMH, so please check your syntax... : -Francisco : http://rcm.netfirms.com/ : ----- Original Message ----- : From: "David Emerson" : To: : Sent: Monday, March 03, 2003 8:14 PM : Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : : What I am looking for here is some confirmation I am doing the right : thing. : : : : In A97 I had a simple statement to return a single value if the : : corresponding record existed (this was in the Control Source of a field - : : : : =IIf(Not : : IsNull([CustIDNo]),nz(DLookUp("Current","tblCustStatement","CustIDNo = " & : : [CustIDNo] & " and StatementNumber = " & [InvNumber]-1),0)) : : : : Now in my ADP I am using the following (and setting the field control : : source to '=cbfAmtDue()') - : : : : Public Function cbfAmtDue() As Currency : : : : Dim cnn As ADODB.Connection, rst As ADODB.Recordset : : : : Set cnn = CurrentProject.Connection : : Set rst = New ADODB.Recordset : : rst.Open "tblCustStatement", cnn, adOpenDynamic, adLockOptimistic : : : : cbfAmtDue = 0 : : If Not IsNull([CustIDNo]) Then : : rst.Filter = "CustIDNo = " & Me!CustIDNo & " and StatementNumber : = : : " & DLookup("InvNumber", "tblCustomers", "CustomerID = " & Me!txtCustID) - : 1 : : If rst.EOF <> True Then 'Statement record exists : : cbfAmtDue = rst!CurrentMth : : End If : : End If : : : : rst.Close : : Set rst = Nothing : : cnn.Close : : Set cnn = Nothing : : : : It seems a long way about it but is there any simpler way? : : : : : : Regards : : : : David Emerson From mikedorism at ntelos.net Tue Mar 4 13:30:09 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Tue, 4 Mar 2003 14:30:09 -0500 Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters In-Reply-To: <001301c2e276$b8fe7f60$b615010a@FHTAPIA> Message-ID: <000001c2e284$7b8f3b20$84390cd8@hargrove.internal> Right. I've found it faster to use Output Parameters with a sproc instead of having to open a recordset. Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: Tuesday, March 04, 2003 12:52 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters So maybe something like this? Dim oCmd As ADODB.Command Dim lRecordsAffected As Long ' Create and Open a new Connection Set oConn = New ADODB.Connection Set oConn = CurrentProject.Connection ' Create a new Command Set oCmd = New ADODB.Command With oCmd .CommandType = adCmdStoredProc .CommandText = "stp_AmountDue " Set .ActiveConnection = oConn ' Create the Command's Parameters and set their values .Parameters.Append .CreateParameter("RETURN_VALUE", _ adInteger, adParamReturnValue, 0) .Parameters.Append .CreateParameter("AmountDue", _ adCurrency, adParameterOutput, , NULL) .Parameters.Append .CreateParameter("CustIdNo", _ adInteger, adParamInput, , CustIdNo) .Parameters.Append .CreateParameter("InvNumber", _ adInteger, adParamInput, , InvNumber -1) ' Run the command .Execute lRecordsAffected, , adExecuteNoRecords ' Do not return recordset ' Print new identity value Debug.Print .Parameters("AmountDue").Value ' New Identity End With CREATE Procedure stp_AmountDue (@AmountDue as Currency, @CustIDno as int, @InvNumber as Int) AS SELECT @AmountDue = CurrentMth FROM tblCustStatement WHERE CustNoId = @CustNoId AND InvNumber = @InvNumber ---------END -Francisco http://rcm.netfirms.com ----- Original Message ----- From: "Mike and Doris Manning" To: Sent: Tuesday, March 04, 2003 5:16 AM Subject: RE: [dba-SQLServer]Replacement for DLookup with 2 parameters : Actually he doesn't need to use a recordset at all. He could create a sproc : that returns "CurrentMth" as an Output Parameter. If there is no matching : record, then the return value is NULL and he can use NZ function to convert : it to 0. : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco : Tapia : Sent: Tuesday, March 04, 2003 02:41 AM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : Think sprocs, David.... : So your Function would be more along the lines of.. : : Public Function cbfAmtDue() as Currency : Dim rst ADODB.Recordset : Set rst = New ADODB.Recordset : : Currentproject.Connection.stp_AmountDue CustIDNo, InvNumber - 1, rst : : if rst.eof = true then : cbfAmtDue = Null 'Or 0 : else : cbfAmtDue = rst!CurrentMth : end if : '--------END : Now in a sproc on your SQL Server you'd add the following sproc... : : ---------- : Create Procedure stp_AmountDue (@CustIDno as int, @InvNumber as Int) AS : SELECT CurrentMth From tblCustStatement Where CustNoId = @CustNoId AND : InvNumber = @InvNumber ---------END : : this is all OTOMH, so please check your syntax... : -Francisco : http://rcm.netfirms.com/ : ----- Original Message ----- : From: "David Emerson" : To: : Sent: Monday, March 03, 2003 8:14 PM : Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : : What I am looking for here is some confirmation I am doing the right : thing. : : : : In A97 I had a simple statement to return a single value if the : : corresponding record existed (this was in the Control Source of a field - : : : : =IIf(Not : : IsNull([CustIDNo]),nz(DLookUp("Current","tblCustStatement","CustIDNo = " & : : [CustIDNo] & " and StatementNumber = " & [InvNumber]-1),0)) : : : : Now in my ADP I am using the following (and setting the field control : : source to '=cbfAmtDue()') - : : : : Public Function cbfAmtDue() As Currency : : : : Dim cnn As ADODB.Connection, rst As ADODB.Recordset : : : : Set cnn = CurrentProject.Connection : : Set rst = New ADODB.Recordset : : rst.Open "tblCustStatement", cnn, adOpenDynamic, adLockOptimistic : : : : cbfAmtDue = 0 : : If Not IsNull([CustIDNo]) Then : : rst.Filter = "CustIDNo = " & Me!CustIDNo & " and StatementNumber : = : : " & DLookup("InvNumber", "tblCustomers", "CustomerID = " & Me!txtCustID) - : 1 : : If rst.EOF <> True Then 'Statement record exists : : cbfAmtDue = rst!CurrentMth : : End If : : End If : : : : rst.Close : : Set rst = Nothing : : cnn.Close : : Set cnn = Nothing : : : : It seems a long way about it but is there any simpler way? : : : : : : Regards : : : : David Emerson _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From my.lists at verizon.net Tue Mar 4 13:47:17 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 4 Mar 2003 11:47:17 -0800 Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters References: <000001c2e284$7b8f3b20$84390cd8@hargrove.internal> Message-ID: <009801c2e286$dd4f4510$b615010a@FHTAPIA> This is true, though I've never time-ed it to find out my performance gains... The great thing is that there is more than one way to skin a 'sproc' ;o) -Francisco http://rcm.netfirms.com ----- Original Message ----- From: "Mike and Doris Manning" To: Sent: Tuesday, March 04, 2003 11:30 AM Subject: RE: [dba-SQLServer]Replacement for DLookup with 2 parameters : Right. I've found it faster to use Output Parameters with a sproc instead : of having to open a recordset. : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco H : Tapia : Sent: Tuesday, March 04, 2003 12:52 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : So maybe something like this? : : Dim oCmd As ADODB.Command : Dim lRecordsAffected As Long : : ' Create and Open a new Connection : Set oConn = New ADODB.Connection : Set oConn = CurrentProject.Connection : ' Create a new Command : Set oCmd = New ADODB.Command : With oCmd : .CommandType = adCmdStoredProc : .CommandText = "stp_AmountDue " : Set .ActiveConnection = oConn : : ' Create the Command's Parameters and set their values : .Parameters.Append .CreateParameter("RETURN_VALUE", _ : adInteger, adParamReturnValue, 0) : .Parameters.Append .CreateParameter("AmountDue", _ : adCurrency, adParameterOutput, , NULL) : .Parameters.Append .CreateParameter("CustIdNo", _ : adInteger, adParamInput, , CustIdNo) : .Parameters.Append .CreateParameter("InvNumber", _ : adInteger, adParamInput, , InvNumber -1) : ' Run the command : .Execute lRecordsAffected, , adExecuteNoRecords : ' Do not return recordset : : ' Print new identity value : Debug.Print .Parameters("AmountDue").Value ' New Identity End With : : CREATE Procedure stp_AmountDue (@AmountDue as Currency, @CustIDno as int, : @InvNumber as Int) AS : SELECT @AmountDue = CurrentMth FROM tblCustStatement WHERE CustNoId = : @CustNoId AND : InvNumber = @InvNumber : ---------END : : : -Francisco : http://rcm.netfirms.com : ----- Original Message ----- : From: "Mike and Doris Manning" : To: : Sent: Tuesday, March 04, 2003 5:16 AM : Subject: RE: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : : Actually he doesn't need to use a recordset at all. He could create a : sproc : : that returns "CurrentMth" as an Output Parameter. If there is no matching : : record, then the return value is NULL and he can use NZ function to : convert : : it to 0. : : : : Doris Manning : : Database Administrator : : Hargrove Inc. : : www.hargroveinc.com : : : : : : -----Original Message----- : : From: dba-sqlserver-admin at databaseadvisors.com : : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco : : Tapia : : Sent: Tuesday, March 04, 2003 02:41 AM : : To: dba-sqlserver at databaseadvisors.com : : Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : : : : Think sprocs, David.... : : So your Function would be more along the lines of.. : : : : Public Function cbfAmtDue() as Currency : : Dim rst ADODB.Recordset : : Set rst = New ADODB.Recordset : : : : Currentproject.Connection.stp_AmountDue CustIDNo, InvNumber - 1, rst : : : : if rst.eof = true then : : cbfAmtDue = Null 'Or 0 : : else : : cbfAmtDue = rst!CurrentMth : : end if : : '--------END : : Now in a sproc on your SQL Server you'd add the following sproc... : : : : ---------- : : Create Procedure stp_AmountDue (@CustIDno as int, @InvNumber as Int) AS : : SELECT CurrentMth From tblCustStatement Where CustNoId = @CustNoId AND : : InvNumber = @InvNumber ---------END : : : : this is all OTOMH, so please check your syntax... : : -Francisco : : http://rcm.netfirms.com/ : : ----- Original Message ----- : : From: "David Emerson" : : To: : : Sent: Monday, March 03, 2003 8:14 PM : : Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : : : : : What I am looking for here is some confirmation I am doing the right : : thing. : : : : : : In A97 I had a simple statement to return a single value if the : : : corresponding record existed (this was in the Control Source of a field : - : : : : : : =IIf(Not : : : IsNull([CustIDNo]),nz(DLookUp("Current","tblCustStatement","CustIDNo = " : & : : : [CustIDNo] & " and StatementNumber = " & [InvNumber]-1),0)) : : : : : : Now in my ADP I am using the following (and setting the field control : : : source to '=cbfAmtDue()') - : : : : : : Public Function cbfAmtDue() As Currency : : : : : : Dim cnn As ADODB.Connection, rst As ADODB.Recordset : : : : : : Set cnn = CurrentProject.Connection : : : Set rst = New ADODB.Recordset : : : rst.Open "tblCustStatement", cnn, adOpenDynamic, adLockOptimistic : : : : : : cbfAmtDue = 0 : : : If Not IsNull([CustIDNo]) Then : : : rst.Filter = "CustIDNo = " & Me!CustIDNo & " and : StatementNumber : : = : : : " & DLookup("InvNumber", "tblCustomers", "CustomerID = " & : Me!txtCustID) - : : 1 : : : If rst.EOF <> True Then 'Statement record exists : : : cbfAmtDue = rst!CurrentMth : : : End If : : : End If : : : : : : rst.Close : : : Set rst = Nothing : : : cnn.Close : : : Set cnn = Nothing : : : : : : It seems a long way about it but is there any simpler way? : : : : : : : : : Regards : : : : : : David Emerson : : : _______________________________________________ : 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 jcolby at colbyconsulting.com Tue Mar 4 16:36:25 2003 From: jcolby at colbyconsulting.com (John W. Colby) Date: Tue, 4 Mar 2003 17:36:25 -0500 Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure Message-ID: I just had a fascinating idea. I do a lot of building up of SQL Strings then executing them in A2K. Would it be possible to build a stored procedure where the parameter passed in is the SQL statement to be executed? IOW, do the same thing we do now, manually build a SQL string with the actual values of controls in where clauses etc., then pass that string to a stored procedure and have the stored procedure execute the SQL string and hand back the data? John W. Colby Colby Consulting www.ColbyConsulting.com I've stopped 9,257 spam messages. You can too! Get your free, safe spam protection at http://www.cloudmark.com/spamnetsig/ ---------------------------------------------------- Is email taking over your day? Manage your time with eMailBoss. Try it free! http://www.eMailBoss.com From accessd at shaw.ca Tue Mar 4 16:45:00 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Tue, 04 Mar 2003 14:45:00 -0800 Subject: [dba-SQLServer]Stored Procedures In-Reply-To: Message-ID: Hi All: Is there a way to use the results of one StoredProcedure to feed a second SP. The example I am working with is one SP to massages the data and the second one manipulates the data via Transpose/Pivot. TIA Jim From dmcafee at pacbell.net Tue Mar 4 16:48:37 2003 From: dmcafee at pacbell.net (David McAFee (Home)) Date: Tue, 04 Mar 2003 14:48:37 -0800 Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure In-Reply-To: Message-ID: Yes, but why not build it in the back, then any changes that would need to be made, could be made in the BE (by modifying the SPROC) without a need for a FE update? There is also a security risk involved, if anyone was to ever figure out the sproc's name you could possibly send a TRUNCATE command or some other ill script (or at least that's what I was told when I wanted to do this :) ) HTH David McAfee -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of John W. Colby Sent: Tuesday, March 04, 2003 2:36 PM To: AccessD-SQLServer; AccessD Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure I just had a fascinating idea. I do a lot of building up of SQL Strings then executing them in A2K. Would it be possible to build a stored procedure where the parameter passed in is the SQL statement to be executed? IOW, do the same thing we do now, manually build a SQL string with the actual values of controls in where clauses etc., then pass that string to a stored procedure and have the stored procedure execute the SQL string and hand back the data? John W. Colby Colby Consulting www.ColbyConsulting.com From szeller at cce.umn.edu Tue Mar 4 17:13:36 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Tue, 4 Mar 2003 17:13:36 -0600 Subject: [dba-SQLServer]Stored Procedures Message-ID: Jim, I use UDF's for this. Results of a UDF can be used like any table. So, I massage data in a UDF which can receive parameters and then do the second manipulation in the sproc. UDF's are only avaiable in 2000 though. --Susan -----Original Message----- From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] Sent: Tuesday, March 04, 2003 4:45 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures Hi All: Is there a way to use the results of one StoredProcedure to feed a second SP. The example I am working with is one SP to massages the data and the second one manipulates the data via Transpose/Pivot. TIA Jim _______________________________________________ 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 Mar 4 17:15:00 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Tue, 4 Mar 2003 17:15:00 -0600 Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure Message-ID: Another big problem is that this is like tying the hands of the sproc. Part of the power of the sproc is its efficiency from compiling. Sprocs that execute dynamic sql do not compile. --Susan -----Original Message----- From: David McAFee (Home) [mailto:dmcafee at pacbell.net] Sent: Tuesday, March 04, 2003 4:49 PM To: dba-sqlserver at databaseadvisors.com; AccessD Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored procedure Yes, but why not build it in the back, then any changes that would need to be made, could be made in the BE (by modifying the SPROC) without a need for a FE update? There is also a security risk involved, if anyone was to ever figure out the sproc's name you could possibly send a TRUNCATE command or some other ill script (or at least that's what I was told when I wanted to do this :) ) HTH David McAfee -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of John W. Colby Sent: Tuesday, March 04, 2003 2:36 PM To: AccessD-SQLServer; AccessD Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure I just had a fascinating idea. I do a lot of building up of SQL Strings then executing them in A2K. Would it be possible to build a stored procedure where the parameter passed in is the SQL statement to be executed? IOW, do the same thing we do now, manually build a SQL string with the actual values of controls in where clauses etc., then pass that string to a stored procedure and have the stored procedure execute the SQL string and hand back the data? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jcolby at colbyconsulting.com Tue Mar 4 17:23:47 2003 From: jcolby at colbyconsulting.com (John W. Colby) Date: Tue, 4 Mar 2003 18:23:47 -0500 Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure In-Reply-To: Message-ID: David, I typically have dozens or even hundreds of combos (for example) that are filtered on other controls (combos, text boxes etc. This means dozens or hundreds of stored procedures, one for each combo. If I do what I am talking about I just have a single sproc, and pass in the string. John W. Colby Colby Consulting www.ColbyConsulting.com I've stopped 9,258 spam messages. You can too! Get your free, safe spam protection at http://www.cloudmark.com/spamnetsig/ -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of David McAFee (Home) Sent: Tuesday, March 04, 2003 5:49 PM To: dba-sqlserver at databaseadvisors.com; AccessD Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored procedure Yes, but why not build it in the back, then any changes that would need to be made, could be made in the BE (by modifying the SPROC) without a need for a FE update? There is also a security risk involved, if anyone was to ever figure out the sproc's name you could possibly send a TRUNCATE command or some other ill script (or at least that's what I was told when I wanted to do this :) ) HTH David McAfee -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of John W. Colby Sent: Tuesday, March 04, 2003 2:36 PM To: AccessD-SQLServer; AccessD Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure I just had a fascinating idea. I do a lot of building up of SQL Strings then executing them in A2K. Would it be possible to build a stored procedure where the parameter passed in is the SQL statement to be executed? IOW, do the same thing we do now, manually build a SQL string with the actual values of controls in where clauses etc., then pass that string to a stored procedure and have the stored procedure execute the SQL string and hand back the data? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com ---------------------------------------------------- Is email taking over your day? Manage your time with eMailBoss. Try it free! http://www.eMailBoss.com -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 2768 bytes Desc: not available URL: From jcolby at colbyconsulting.com Tue Mar 4 17:25:30 2003 From: jcolby at colbyconsulting.com (John W. Colby) Date: Tue, 4 Mar 2003 18:25:30 -0500 Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure In-Reply-To: Message-ID: But what I am reading is that if you are talking about a situation like I am discussing, where the filter changes every time the sproc is used, the compile is actually counterproductive. John W. Colby Colby Consulting www.ColbyConsulting.com I've stopped 9,258 spam messages. You can too! Get your free, safe spam protection at http://www.cloudmark.com/spamnetsig/ -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan Zeller Sent: Tuesday, March 04, 2003 6:15 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored procedure Another big problem is that this is like tying the hands of the sproc. Part of the power of the sproc is its efficiency from compiling. Sprocs that execute dynamic sql do not compile. --Susan -----Original Message----- From: David McAFee (Home) [mailto:dmcafee at pacbell.net] Sent: Tuesday, March 04, 2003 4:49 PM To: dba-sqlserver at databaseadvisors.com; AccessD Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored procedure Yes, but why not build it in the back, then any changes that would need to be made, could be made in the BE (by modifying the SPROC) without a need for a FE update? There is also a security risk involved, if anyone was to ever figure out the sproc's name you could possibly send a TRUNCATE command or some other ill script (or at least that's what I was told when I wanted to do this :) ) HTH David McAfee -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of John W. Colby Sent: Tuesday, March 04, 2003 2:36 PM To: AccessD-SQLServer; AccessD Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure I just had a fascinating idea. I do a lot of building up of SQL Strings then executing them in A2K. Would it be possible to build a stored procedure where the parameter passed in is the SQL statement to be executed? IOW, do the same thing we do now, manually build a SQL string with the actual values of controls in where clauses etc., then pass that string to a stored procedure and have the stored procedure execute the SQL string and hand back the data? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com ---------------------------------------------------- Is email taking over your day? Manage your time with eMailBoss. Try it free! http://www.eMailBoss.com -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 2920 bytes Desc: not available URL: From artful at rogers.com Tue Mar 4 17:25:58 2003 From: artful at rogers.com (Arthur Fuller) Date: Tue, 4 Mar 2003 18:25:58 -0500 Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters In-Reply-To: <009801c2e286$dd4f4510$b615010a@FHTAPIA> Message-ID: <000501c2e2a5$6fe6e7c0$8e01a8c0@Rock> Since we're into variety (i.e. the plural of spouse is... spice), you could also create a scalar UDF that returns said value. -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: March 4, 2003 2:47 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters This is true, though I've never time-ed it to find out my performance gains... The great thing is that there is more than one way to skin a 'sproc' ;o) -Francisco http://rcm.netfirms.com ----- Original Message ----- From: "Mike and Doris Manning" To: Sent: Tuesday, March 04, 2003 11:30 AM Subject: RE: [dba-SQLServer]Replacement for DLookup with 2 parameters : Right. I've found it faster to use Output Parameters with a sproc instead : of having to open a recordset. : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco H : Tapia : Sent: Tuesday, March 04, 2003 12:52 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : So maybe something like this? : : Dim oCmd As ADODB.Command : Dim lRecordsAffected As Long : : ' Create and Open a new Connection : Set oConn = New ADODB.Connection : Set oConn = CurrentProject.Connection : ' Create a new Command : Set oCmd = New ADODB.Command : With oCmd : .CommandType = adCmdStoredProc : .CommandText = "stp_AmountDue " : Set .ActiveConnection = oConn : : ' Create the Command's Parameters and set their values : .Parameters.Append .CreateParameter("RETURN_VALUE", _ : adInteger, adParamReturnValue, 0) : .Parameters.Append .CreateParameter("AmountDue", _ : adCurrency, adParameterOutput, , NULL) : .Parameters.Append .CreateParameter("CustIdNo", _ : adInteger, adParamInput, , CustIdNo) : .Parameters.Append .CreateParameter("InvNumber", _ : adInteger, adParamInput, , InvNumber -1) : ' Run the command : .Execute lRecordsAffected, , adExecuteNoRecords : ' Do not return recordset : : ' Print new identity value : Debug.Print .Parameters("AmountDue").Value ' New Identity End With : : CREATE Procedure stp_AmountDue (@AmountDue as Currency, @CustIDno as int, : @InvNumber as Int) AS : SELECT @AmountDue = CurrentMth FROM tblCustStatement WHERE CustNoId = : @CustNoId AND : InvNumber = @InvNumber : ---------END : : : -Francisco : http://rcm.netfirms.com : ----- Original Message ----- : From: "Mike and Doris Manning" : To: : Sent: Tuesday, March 04, 2003 5:16 AM : Subject: RE: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : : Actually he doesn't need to use a recordset at all. He could create a : sproc : : that returns "CurrentMth" as an Output Parameter. If there is no matching : : record, then the return value is NULL and he can use NZ function to : convert : : it to 0. : : : : Doris Manning : : Database Administrator : : Hargrove Inc. : : www.hargroveinc.com : : : : : : -----Original Message----- : : From: dba-sqlserver-admin at databaseadvisors.com : : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco : : Tapia : : Sent: Tuesday, March 04, 2003 02:41 AM : : To: dba-sqlserver at databaseadvisors.com : : Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : : : : Think sprocs, David.... : : So your Function would be more along the lines of.. : : : : Public Function cbfAmtDue() as Currency : : Dim rst ADODB.Recordset : : Set rst = New ADODB.Recordset : : : : Currentproject.Connection.stp_AmountDue CustIDNo, InvNumber - 1, rst : : : : if rst.eof = true then : : cbfAmtDue = Null 'Or 0 : : else : : cbfAmtDue = rst!CurrentMth : : end if : : '--------END : : Now in a sproc on your SQL Server you'd add the following sproc... : : : : ---------- : : Create Procedure stp_AmountDue (@CustIDno as int, @InvNumber as Int) AS : : SELECT CurrentMth From tblCustStatement Where CustNoId = @CustNoId AND : : InvNumber = @InvNumber ---------END : : : : this is all OTOMH, so please check your syntax... : : -Francisco : : http://rcm.netfirms.com/ : : ----- Original Message ----- : : From: "David Emerson" : : To: : : Sent: Monday, March 03, 2003 8:14 PM : : Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters : : : : : : : What I am looking for here is some confirmation I am doing the right : : thing. : : : : : : In A97 I had a simple statement to return a single value if the : : : corresponding record existed (this was in the Control Source of a field : - : : : : : : =IIf(Not : : : IsNull([CustIDNo]),nz(DLookUp("Current","tblCustStatement","CustIDNo = " : & : : : [CustIDNo] & " and StatementNumber = " & [InvNumber]-1),0)) : : : : : : Now in my ADP I am using the following (and setting the field control : : : source to '=cbfAmtDue()') - : : : : : : Public Function cbfAmtDue() As Currency : : : : : : Dim cnn As ADODB.Connection, rst As ADODB.Recordset : : : : : : Set cnn = CurrentProject.Connection : : : Set rst = New ADODB.Recordset : : : rst.Open "tblCustStatement", cnn, adOpenDynamic, adLockOptimistic : : : : : : cbfAmtDue = 0 : : : If Not IsNull([CustIDNo]) Then : : : rst.Filter = "CustIDNo = " & Me!CustIDNo & " and : StatementNumber : : = : : : " & DLookup("InvNumber", "tblCustomers", "CustomerID = " & : Me!txtCustID) - : : 1 : : : If rst.EOF <> True Then 'Statement record exists : : : cbfAmtDue = rst!CurrentMth : : : End If : : : End If : : : : : : rst.Close : : : Set rst = Nothing : : : cnn.Close : : : Set cnn = Nothing : : : : : : It seems a long way about it but is there any simpler way? : : : : : : : : : Regards : : : : : : David Emerson : : : _______________________________________________ : 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 Tue Mar 4 17:34:49 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 4 Mar 2003 15:34:49 -0800 Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure References: Message-ID: <013e01c2e2a6$a6785e30$b615010a@FHTAPIA> Still tho at the cost of opening your System to potentially *unsafe* calls (ala, Unchecked buffer ;o)). I seriously doubt that you would need hundreds of sprocs, if you parametrize them you'd only need a few dozen... plus you'd be saving yourself the bandwidth of sending the entire statement accross the wire...tho it might seems small in the great scheme of things, you'd be making your app less "chatty" and therefore less prone to network problems. -Francisco http://rcm.netfirms.com ----- Original Message ----- From: "John W. Colby" To: Sent: Tuesday, March 04, 2003 3:25 PM Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored procedure : But what I am reading is that if you are talking about a situation like I am : discussing, where the filter changes every time the sproc is used, the : compile is actually counterproductive. : : John W. Colby : Colby Consulting : www.ColbyConsulting.com : : : I've stopped 9,258 spam messages. You can too! : Get your free, safe spam protection at http://www.cloudmark.com/spamnetsig/ : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan : Zeller : Sent: Tuesday, March 04, 2003 6:15 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored : procedure : : : Another big problem is that this is like tying the hands of the sproc. : Part of the power of the sproc is its efficiency from compiling. Sprocs : that execute dynamic sql do not compile. : : --Susan : : -----Original Message----- : From: David McAFee (Home) [mailto:dmcafee at pacbell.net] : Sent: Tuesday, March 04, 2003 4:49 PM : To: dba-sqlserver at databaseadvisors.com; AccessD : Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored : procedure : : : Yes, but why not build it in the back, then any changes that would need : to be made, could be made in the BE (by modifying the SPROC) without a : need for a FE update? There is also a security risk involved, if anyone : was to ever figure out the sproc's name you could possibly send a : TRUNCATE command or some other ill script (or at least that's what I was : told when I wanted to do this :) ) : : HTH : : David McAfee : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of John W. : Colby : Sent: Tuesday, March 04, 2003 2:36 PM : To: AccessD-SQLServer; AccessD : Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure : : : I just had a fascinating idea. I do a lot of building up of SQL Strings : then executing them in A2K. Would it be possible to build a stored : procedure where the parameter passed in is the SQL statement to be : executed? IOW, do the same thing we do now, manually build a SQL string : with the actual values of controls in where clauses etc., then pass that : string to a stored procedure and have the stored procedure execute the : SQL string and hand back the data? : : John W. Colby : Colby Consulting : www.ColbyConsulting.com : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : : : : ---------------------------------------------------- : Is email taking over your day? Manage your time with eMailBoss. : Try it free! http://www.eMailBoss.com : From szeller at cce.umn.edu Tue Mar 4 17:54:51 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Tue, 4 Mar 2003 17:54:51 -0600 Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure Message-ID: That's not my understanding and not my experience either. Sprocs are designed to accept input parameters and still compile even though the value for the parameter changes every time it's run. This is one of the reaons why you can't do some more complicated SQL manipulation (such as "where myfield in ('abc', 'def', 'ghi')") in a sproc and still have it compile. You can do that in a sproc, but you have to do it with more dynamic SQL and then it doesn't compile and is in fact slower in my experience. Depending on the number of users and the amount of data, this may or may not be an issue for you. That said, if you want to address the security hold that others are talking about and still use your method, some simple error handling could addres this. You could check the string that is passed for some key words and execute it only if you find it safe. Be sure to check for the presenece of a semicolon as this sometimes allow a new sql statement to execute and I have heard of hackers wiping out database by typing in "select * from mytable; drop table mytable". --Susan > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of John > W. Colby > Sent: Tuesday, March 04, 2003 5:26 PM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored > procedure > > But what I am reading is that if you are talking about a situation > like I am discussing, where the filter changes every time the sproc is > used, the compile is actually counterproductive. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > > I've stopped 9,258 spam messages. You can too! > Get your free, safe spam protection at > http://www.cloudmark.com/spamnetsig/ > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan > Zeller > Sent: Tuesday, March 04, 2003 6:15 PM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored > procedure > > > Another big problem is that this is like tying the hands of the sproc. > Part of the power of the sproc is its efficiency from compiling. > Sprocs > that execute dynamic sql do not compile. > > --Susan > > -----Original Message----- > From: David McAFee (Home) [mailto:dmcafee at pacbell.net] > Sent: Tuesday, March 04, 2003 4:49 PM > To: dba-sqlserver at databaseadvisors.com; AccessD > Subject: RE: [dba-SQLServer]Passing the SQL Setting to a stored > procedure > > > Yes, but why not build it in the back, then any changes that would > need > to be made, could be made in the BE (by modifying the SPROC) without a > need for a FE update? There is also a security risk involved, if > anyone > was to ever figure out the sproc's name you could possibly send a > TRUNCATE command or some other ill script (or at least that's what I > was > told when I wanted to do this :) ) > > HTH > > David McAfee > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of John W. > Colby > Sent: Tuesday, March 04, 2003 2:36 PM > To: AccessD-SQLServer; AccessD > Subject: [dba-SQLServer]Passing the SQL Setting to a stored procedure > > > I just had a fascinating idea. I do a lot of building up of SQL > Strings > then executing them in A2K. Would it be possible to build a stored > procedure where the parameter passed in is the SQL statement to be > executed? IOW, do the same thing we do now, manually build a SQL > string > with the actual values of controls in where clauses etc., then pass > that > string to a stored procedure and have the stored procedure execute the > SQL string and hand back the data? > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > > ---------------------------------------------------- > Is email taking over your day? Manage your time with eMailBoss. > Try it free! http://www.eMailBoss.com From davide at dalyn.co.nz Tue Mar 4 18:01:26 2003 From: davide at dalyn.co.nz (David Emerson) Date: Wed, 05 Mar 2003 13:01:26 +1300 Subject: [dba-SQLServer]Calling a Sproc with Parameter Message-ID: <5.2.0.9.0.20030305122424.00b1cfc0@mail.dalyn.co.nz> I have a button on a form which is used to filter the records. The code is - Private Sub cmdCustomerFilter_Click() On Error GoTo Err_cmdCustomerFilter_Click If Me!cmdCustomerFilter.Caption = "Show Active" Then Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" <- Problem line Me!cmdCustomerFilter.Caption = "Show All" Else Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" Me!cmdCustomerFilter.Caption = "Show Active" End If ..... End Sub In the sproc the parameter is - @AccStatus varchar(20) = '%' When I click on the button I get error 2353 - Bad query parameter. I can run the query in Query analyser and it runs ok. If I leave the @AccStatus = 'Active' off then a message appears telling me that the procedure expects the parameter (so this tells me it is calling the correct sproc) I think the problem is in the call but can't put my finger on it. Any help? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 -------------- next part -------------- An HTML attachment was scrubbed... URL: From davide at dalyn.co.nz Tue Mar 4 18:17:28 2003 From: davide at dalyn.co.nz (David Emerson) Date: Wed, 05 Mar 2003 13:17:28 +1300 Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters In-Reply-To: <000501c2e2a5$6fe6e7c0$8e01a8c0@Rock> References: <009801c2e286$dd4f4510$b615010a@FHTAPIA> Message-ID: <5.2.0.9.0.20030305131525.00b1b750@mail.dalyn.co.nz> Thanks all for the feedback. I am still digesting it. One point of clarification - My solution using ADO: I presume that this needs to pull all the records from the server to the local machine before filtering it as opposed to the sproc/UDF method which does all the filtering on the server. Is this correct? David At 4/03/2003, you wrote: >Since we're into variety (i.e. the plural of spouse is... spice), you could >also create a scalar UDF that returns said value. > >-----Original Message----- >From: dba-sqlserver-admin at databaseadvisors.com >[mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco H >Tapia >Sent: March 4, 2003 2:47 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters > >This is true, though I've never time-ed it to find out my performance >gains... The great thing is that there is more than one way to skin a >'sproc' ;o) > >-Francisco >http://rcm.netfirms.com >----- Original Message ----- >From: "Mike and Doris Manning" >To: >Sent: Tuesday, March 04, 2003 11:30 AM >Subject: RE: [dba-SQLServer]Replacement for DLookup with 2 parameters > > >: Right. I've found it faster to use Output Parameters with a sproc instead >: of having to open a recordset. >: >: Doris Manning >: Database Administrator >: Hargrove Inc. >: www.hargroveinc.com >: >: >: -----Original Message----- >: From: dba-sqlserver-admin at databaseadvisors.com >: [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco H >: Tapia >: Sent: Tuesday, March 04, 2003 12:52 PM >: To: dba-sqlserver at databaseadvisors.com >: Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters >: >: >: So maybe something like this? >: >: Dim oCmd As ADODB.Command >: Dim lRecordsAffected As Long >: >: ' Create and Open a new Connection >: Set oConn = New ADODB.Connection >: Set oConn = CurrentProject.Connection >: ' Create a new Command >: Set oCmd = New ADODB.Command >: With oCmd >: .CommandType = adCmdStoredProc >: .CommandText = "stp_AmountDue " >: Set .ActiveConnection = oConn >: >: ' Create the Command's Parameters and set their values >: .Parameters.Append .CreateParameter("RETURN_VALUE", _ >: adInteger, adParamReturnValue, 0) >: .Parameters.Append .CreateParameter("AmountDue", _ >: adCurrency, adParameterOutput, , NULL) >: .Parameters.Append .CreateParameter("CustIdNo", _ >: adInteger, adParamInput, , CustIdNo) >: .Parameters.Append .CreateParameter("InvNumber", _ >: adInteger, adParamInput, , InvNumber -1) >: ' Run the command >: .Execute lRecordsAffected, , adExecuteNoRecords >: ' Do not return recordset >: >: ' Print new identity value >: Debug.Print .Parameters("AmountDue").Value ' New Identity End With >: >: CREATE Procedure stp_AmountDue (@AmountDue as Currency, @CustIDno as int, >: @InvNumber as Int) AS >: SELECT @AmountDue = CurrentMth FROM tblCustStatement WHERE CustNoId = >: @CustNoId AND >: InvNumber = @InvNumber >: ---------END >: >: >: -Francisco >: http://rcm.netfirms.com >: ----- Original Message ----- >: From: "Mike and Doris Manning" >: To: >: Sent: Tuesday, March 04, 2003 5:16 AM >: Subject: RE: [dba-SQLServer]Replacement for DLookup with 2 parameters >: >: >: : Actually he doesn't need to use a recordset at all. He could create a >: sproc >: : that returns "CurrentMth" as an Output Parameter. If there is no >matching >: : record, then the return value is NULL and he can use NZ function to >: convert >: : it to 0. >: : >: : Doris Manning >: : Database Administrator >: : Hargrove Inc. >: : www.hargroveinc.com >: : >: : >: : -----Original Message----- >: : From: dba-sqlserver-admin at databaseadvisors.com >: : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco >: : Tapia >: : Sent: Tuesday, March 04, 2003 02:41 AM >: : To: dba-sqlserver at databaseadvisors.com >: : Subject: Re: [dba-SQLServer]Replacement for DLookup with 2 parameters >: : >: : >: : Think sprocs, David.... >: : So your Function would be more along the lines of.. >: : >: : Public Function cbfAmtDue() as Currency >: : Dim rst ADODB.Recordset >: : Set rst = New ADODB.Recordset >: : >: : Currentproject.Connection.stp_AmountDue CustIDNo, InvNumber - 1, rst >: : >: : if rst.eof = true then >: : cbfAmtDue = Null 'Or 0 >: : else >: : cbfAmtDue = rst!CurrentMth >: : end if >: : '--------END >: : Now in a sproc on your SQL Server you'd add the following sproc... >: : >: : ---------- >: : Create Procedure stp_AmountDue (@CustIDno as int, @InvNumber as Int) AS >: : SELECT CurrentMth From tblCustStatement Where CustNoId = @CustNoId AND >: : InvNumber = @InvNumber ---------END >: : >: : this is all OTOMH, so please check your syntax... >: : -Francisco >: : http://rcm.netfirms.com/ >: : ----- Original Message ----- >: : From: "David Emerson" >: : To: >: : Sent: Monday, March 03, 2003 8:14 PM >: : Subject: [dba-SQLServer]Replacement for DLookup with 2 parameters >: : >: : >: : : What I am looking for here is some confirmation I am doing the right >: : thing. >: : : >: : : In A97 I had a simple statement to return a single value if the >: : : corresponding record existed (this was in the Control Source of a >field >: - >: : : >: : : =IIf(Not >: : : IsNull([CustIDNo]),nz(DLookUp("Current","tblCustStatement","CustIDNo = >" >: & >: : : [CustIDNo] & " and StatementNumber = " & [InvNumber]-1),0)) >: : : >: : : Now in my ADP I am using the following (and setting the field control >: : : source to '=cbfAmtDue()') - >: : : >: : : Public Function cbfAmtDue() As Currency >: : : >: : : Dim cnn As ADODB.Connection, rst As ADODB.Recordset >: : : >: : : Set cnn = CurrentProject.Connection >: : : Set rst = New ADODB.Recordset >: : : rst.Open "tblCustStatement", cnn, adOpenDynamic, adLockOptimistic >: : : >: : : cbfAmtDue = 0 >: : : If Not IsNull([CustIDNo]) Then >: : : rst.Filter = "CustIDNo = " & Me!CustIDNo & " and >: StatementNumber >: : = >: : : " & DLookup("InvNumber", "tblCustomers", "CustomerID = " & >: Me!txtCustID) - >: : 1 >: : : If rst.EOF <> True Then 'Statement record exists >: : : cbfAmtDue = rst!CurrentMth >: : : End If >: : : End If >: : : >: : : rst.Close >: : : Set rst = Nothing >: : : cnn.Close >: : : Set cnn = Nothing >: : : From accessd at shaw.ca Wed Mar 5 01:21:17 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Tue, 04 Mar 2003 23:21:17 -0800 Subject: [dba-SQLServer]Stored Procedures In-Reply-To: Message-ID: Thanks Susan: Unfortunately, the client is running on SQL7. :-( Jim -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan Zeller Sent: Tuesday, March 04, 2003 3:14 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures Jim, I use UDF's for this. Results of a UDF can be used like any table. So, I massage data in a UDF which can receive parameters and then do the second manipulation in the sproc. UDF's are only avaiable in 2000 though. --Susan -----Original Message----- From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] Sent: Tuesday, March 04, 2003 4:45 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures Hi All: Is there a way to use the results of one StoredProcedure to feed a second SP. The example I am working with is one SP to massages the data and the second one manipulates the data via Transpose/Pivot. TIA Jim _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From my.lists at verizon.net Wed Mar 5 01:52:15 2003 From: my.lists at verizon.net (Francisco Tapia) Date: Tue, 4 Mar 2003 23:52:15 -0800 Subject: [dba-SQLServer]Stored Procedures References: Message-ID: <006901c2e2ec$289a8650$0eb62904@amd2k> There is no way that I know of to do what you are asking in SQL7, viable workarounds include executing your sproc1, to execute a nested sproc that writes to a temp table and then refrencing the temp table from sproc1 long after sproc2 (nested) has executed. just a wag tho. -Francisco http://rcm.netfirms.com/ ----- Original Message ----- From: "Jim Lawrence (AccessD)" To: Sent: Tuesday, March 04, 2003 11:21 PM Subject: RE: [dba-SQLServer]Stored Procedures : Thanks Susan: : : Unfortunately, the client is running on SQL7. :-( : : Jim : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan : Zeller : Sent: Tuesday, March 04, 2003 3:14 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Jim, : : I use UDF's for this. Results of a UDF can be used like any table. So, : I massage data in a UDF which can receive parameters and then do the : second manipulation in the sproc. UDF's are only avaiable in 2000 : though. : : --Susan : : : -----Original Message----- : From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] : Sent: Tuesday, March 04, 2003 4:45 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Hi All: : : Is there a way to use the results of one StoredProcedure to feed a : second SP. The example I am working with is one SP to massages the data : and the second one manipulates the data via Transpose/Pivot. : : TIA : Jim From mikedorism at ntelos.net Wed Mar 5 07:25:27 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Wed, 5 Mar 2003 08:25:27 -0500 Subject: [dba-SQLServer]Calling a Sproc with Parameter In-Reply-To: <5.2.0.9.0.20030305122424.00b1cfc0@mail.dalyn.co.nz> Message-ID: <000f01c2e31a$b37fb0a0$f6360cd8@hargrove.internal> Two things. 1) Make sure your sproc is looking for LIKE @AccStatus and not = @AccStatus 2) When you use EXEC, you don't add the name of the parameter. "EXEC spfrmCustomers 'Active'" Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of David Emerson Sent: Tuesday, March 04, 2003 07:01 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Calling a Sproc with Parameter I have a button on a form which is used to filter the records. The code is - Private Sub cmdCustomerFilter_Click() On Error GoTo Err_cmdCustomerFilter_Click If Me!cmdCustomerFilter.Caption = "Show Active" Then Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" <- Problem line Me!cmdCustomerFilter.Caption = "Show All" Else Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" Me!cmdCustomerFilter.Caption = "Show Active" End If ..... End Sub In the sproc the parameter is - @AccStatus varchar(20) = '%' When I click on the button I get error 2353 - Bad query parameter. I can run the query in Query analyser and it runs ok. If I leave the @AccStatus = 'Active' off then a message appears telling me that the procedure expects the parameter (so this tells me it is calling the correct sproc) I think the problem is in the call but can't put my finger on it. Any help? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 -------------- next part -------------- An HTML attachment was scrubbed... URL: From szeller at cce.umn.edu Wed Mar 5 08:13:53 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Wed, 5 Mar 2003 08:13:53 -0600 Subject: [dba-SQLServer]Stored Procedures Message-ID: I'm assuming SQL7 has temp tables given Francisco's comment. If that's the case, you can do everything in one sproc with temp tables. I actually am doing this in several cases. I create sometimes two or three temp tables in my sproc, then use those to do something or return something and then drop the temp table, all in the same sproc. Let me know if you need info on how to do this. --Susan -----Original Message----- From: Francisco Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, March 05, 2003 1:52 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Stored Procedures There is no way that I know of to do what you are asking in SQL7, viable workarounds include executing your sproc1, to execute a nested sproc that writes to a temp table and then refrencing the temp table from sproc1 long after sproc2 (nested) has executed. just a wag tho. -Francisco http://rcm.netfirms.com/ ----- Original Message ----- From: "Jim Lawrence (AccessD)" To: Sent: Tuesday, March 04, 2003 11:21 PM Subject: RE: [dba-SQLServer]Stored Procedures : Thanks Susan: : : Unfortunately, the client is running on SQL7. :-( : : Jim : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan : Zeller : Sent: Tuesday, March 04, 2003 3:14 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Jim, : : I use UDF's for this. Results of a UDF can be used like any table. So, : I massage data in a UDF which can receive parameters and then do the : second manipulation in the sproc. UDF's are only avaiable in 2000 : though. : : --Susan : : : -----Original Message----- : From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] : Sent: Tuesday, March 04, 2003 4:45 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Hi All: : : Is there a way to use the results of one StoredProcedure to feed a : second SP. The example I am working with is one SP to massages the data : and the second one manipulates the data via Transpose/Pivot. : : TIA : 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 Mar 5 09:13:03 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 5 Mar 2003 09:13:03 -0600 Subject: [dba-SQLServer]Calling a Sproc with Parameter Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBDA@ex02.eagle.usaa.com> I will have to respectfully disagree with the previous recommendations. LIKE will prevent your sp from compiling in the first place, while the usage of EXEC is very proper in the original code. Although the suggested form is still valid, specifying named parameters is actually encouraged for the clarity of the code, and MS fully supports EXEC sp_PROC @Parm1='', @Parm2=, etc. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Wednesday, March 05, 2003 7:25 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter Two things. 1) Make sure your sproc is looking for LIKE @AccStatus and not = @AccStatus 2) When you use EXEC, you don't add the name of the parameter. "EXEC spfrmCustomers 'Active'" Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of David Emerson Sent: Tuesday, March 04, 2003 07:01 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Calling a Sproc with Parameter I have a button on a form which is used to filter the records. The code is - Private Sub cmdCustomerFilter_Click() On Error GoTo Err_cmdCustomerFilter_Click If Me!cmdCustomerFilter.Caption = "Show Active" Then Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" <- Problem line Me!cmdCustomerFilter.Caption = "Show All" Else Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" Me!cmdCustomerFilter.Caption = "Show Active" End If ..... End Sub In the sproc the parameter is - @AccStatus varchar(20) = '%' When I click on the button I get error 2353 - Bad query parameter. I can run the query in Query analyser and it runs ok. If I leave the @AccStatus = 'Active' off then a message appears telling me that the procedure expects the parameter (so this tells me it is calling the correct sproc) I think the problem is in the call but can't put my finger on it. Any help? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 -------------- next part -------------- An HTML attachment was scrubbed... URL: From accessd at shaw.ca Wed Mar 5 10:02:45 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Wed, 05 Mar 2003 08:02:45 -0800 Subject: [dba-SQLServer]Stored Procedures In-Reply-To: Message-ID: Hi Susan: Yes, please. I could probably figure it out if given enough time but you are skilled in this. I would greatly appreciate any description or example you could provide. :-) TIA Jim -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan Zeller Sent: Wednesday, March 05, 2003 6:14 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures I'm assuming SQL7 has temp tables given Francisco's comment. If that's the case, you can do everything in one sproc with temp tables. I actually am doing this in several cases. I create sometimes two or three temp tables in my sproc, then use those to do something or return something and then drop the temp table, all in the same sproc. Let me know if you need info on how to do this. --Susan -----Original Message----- From: Francisco Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, March 05, 2003 1:52 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Stored Procedures There is no way that I know of to do what you are asking in SQL7, viable workarounds include executing your sproc1, to execute a nested sproc that writes to a temp table and then refrencing the temp table from sproc1 long after sproc2 (nested) has executed. just a wag tho. -Francisco http://rcm.netfirms.com/ ----- Original Message ----- From: "Jim Lawrence (AccessD)" To: Sent: Tuesday, March 04, 2003 11:21 PM Subject: RE: [dba-SQLServer]Stored Procedures : Thanks Susan: : : Unfortunately, the client is running on SQL7. :-( : : Jim : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan : Zeller : Sent: Tuesday, March 04, 2003 3:14 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Jim, : : I use UDF's for this. Results of a UDF can be used like any table. So, : I massage data in a UDF which can receive parameters and then do the : second manipulation in the sproc. UDF's are only avaiable in 2000 : though. : : --Susan : : : -----Original Message----- : From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] : Sent: Tuesday, March 04, 2003 4:45 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Hi All: : : Is there a way to use the results of one StoredProcedure to feed a : second SP. The example I am working with is one SP to massages the data : and the second one manipulates the data via Transpose/Pivot. : : TIA : Jim _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From chris at denverdb.com Wed Mar 5 10:15:50 2003 From: chris at denverdb.com (Chris Mackin) Date: Wed, 5 Mar 2003 09:15:50 -0700 Subject: [dba-SQLServer]Stored Procedures In-Reply-To: Message-ID: The key to remember Jm is that you need to create your Temp table in the outermost level of nesting since the table will disappear after the sproc that created it has completed execution. Use a # in fronbt of the table name for creating and all references to it (CREATE TABLE #MyTemp....) Then in the nested sproc INSERT INTO #MyTemp....... In your main sproc you can use it in a SQL statement same as any other table. Chris Mackin Denver Database Consulting, LLC www.denverdb.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Jim Lawrence (AccessD) Sent: Wednesday, March 05, 2003 9:03 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures Hi Susan: Yes, please. I could probably figure it out if given enough time but you are skilled in this. I would greatly appreciate any description or example you could provide. :-) TIA Jim -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan Zeller Sent: Wednesday, March 05, 2003 6:14 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures I'm assuming SQL7 has temp tables given Francisco's comment. If that's the case, you can do everything in one sproc with temp tables. I actually am doing this in several cases. I create sometimes two or three temp tables in my sproc, then use those to do something or return something and then drop the temp table, all in the same sproc. Let me know if you need info on how to do this. --Susan -----Original Message----- From: Francisco Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, March 05, 2003 1:52 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Stored Procedures There is no way that I know of to do what you are asking in SQL7, viable workarounds include executing your sproc1, to execute a nested sproc that writes to a temp table and then refrencing the temp table from sproc1 long after sproc2 (nested) has executed. just a wag tho. -Francisco http://rcm.netfirms.com/ ----- Original Message ----- From: "Jim Lawrence (AccessD)" To: Sent: Tuesday, March 04, 2003 11:21 PM Subject: RE: [dba-SQLServer]Stored Procedures : Thanks Susan: : : Unfortunately, the client is running on SQL7. :-( : : Jim : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan : Zeller : Sent: Tuesday, March 04, 2003 3:14 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Jim, : : I use UDF's for this. Results of a UDF can be used like any table. So, : I massage data in a UDF which can receive parameters and then do the : second manipulation in the sproc. UDF's are only avaiable in 2000 : though. : : --Susan : : : -----Original Message----- : From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] : Sent: Tuesday, March 04, 2003 4:45 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Hi All: : : Is there a way to use the results of one StoredProcedure to feed a : second SP. The example I am working with is one SP to massages the data : and the second one manipulates the data via Transpose/Pivot. : : TIA : Jim _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ 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 Mar 5 10:35:47 2003 From: fhtapia at hotmail.com (Francisco H Tapia) Date: Wed, 5 Mar 2003 08:35:47 -0800 Subject: [dba-SQLServer]Calling a Sproc with Parameter References: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBDA@ex02.eagle.usaa.com> Message-ID: Both points are valid, but in this case the Sproc must be able to handle the '%'. Assuming that you are not executing Dynamic Sql in your sproc you maybe manipulating the sproc to select all Customers not just the active ones... Do you have access to Query Analyzer? if so I would test the sproc in there to make sure it executes w/o errors. I have found certain errors to be Access Only. Such as selecting data from a linked table on another server. -Francisco http://rcm.netfirms.com ----- Original Message ----- From: "Djabarov, Robert" To: Sent: Wednesday, March 05, 2003 7:13 AM Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter I will have to respectfully disagree with the previous recommendations. LIKE will prevent your sp from compiling in the first place, while the usage of EXEC is very proper in the original code. Although the suggested form is still valid, specifying named parameters is actually encouraged for the clarity of the code, and MS fully supports EXEC sp_PROC @Parm1='', @Parm2=, etc. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Wednesday, March 05, 2003 7:25 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter Two things. 1) Make sure your sproc is looking for LIKE @AccStatus and not = @AccStatus 2) When you use EXEC, you don't add the name of the parameter. "EXEC spfrmCustomers 'Active'" Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of David Emerson Sent: Tuesday, March 04, 2003 07:01 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Calling a Sproc with Parameter I have a button on a form which is used to filter the records. The code is - Private Sub cmdCustomerFilter_Click() On Error GoTo Err_cmdCustomerFilter_Click If Me!cmdCustomerFilter.Caption = "Show Active" Then Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" <- Problem line Me!cmdCustomerFilter.Caption = "Show All" Else Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" Me!cmdCustomerFilter.Caption = "Show Active" End If ..... End Sub In the sproc the parameter is - @AccStatus varchar(20) = '%' When I click on the button I get error 2353 - Bad query parameter. I can run the query in Query analyser and it runs ok. If I leave the @AccStatus = 'Active' off then a message appears telling me that the procedure expects the parameter (so this tells me it is calling the correct sproc) I think the problem is in the call but can't put my finger on it. Any help? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From szeller at cce.umn.edu Wed Mar 5 11:05:50 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Wed, 5 Mar 2003 11:05:50 -0600 Subject: [dba-SQLServer]Stored Procedures Message-ID: Jim, Here's a paired down sproc that shows creating a temp table, using the data from the temp table and then dropping it. I've made this so simple that the temp table isn't really neccesary, but it will give you the idea. Let me know if you have questions. Temp tables work just like real tables, but the have a # in front of the name. --Susan create proc dbo.p_rpt_Activity_Summary @IP_Activity_ID int as set nocount on /* A. Put all the ip_empjob start rows into a temp table */ select ip_empjob_id, emplid, empl_rcdno , effdt as startdate, cast(null as datetime) as enddate into #ip_emp_job_start_end from ip_emp_job where action not in ('LOA', 'PLA', 'RET', 'SUS', 'SWB', 'TER', 'TWB') --select * from #ip_emp_job_start_end /* B. Do something with the data in the temp table. */ select a.empl_type_desc , a.COMPRATE , a.AREA , a.ORG , a.SUBORG FROM #ip_emp_job_start_end a inner join tbl_student b on a.emplid = b.emplid where b.ip_activity_id = @ip_activity_id /* C. Drop temp table -- cleaner to drop this explicity, even though it will drop when the sproc finishes. */ drop table #ip_emp_job_start_end GO -----Original Message----- From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] Sent: Wednesday, March 05, 2003 10:03 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures Hi Susan: Yes, please. I could probably figure it out if given enough time but you are skilled in this. I would greatly appreciate any description or example you could provide. :-) TIA Jim -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan Zeller Sent: Wednesday, March 05, 2003 6:14 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures I'm assuming SQL7 has temp tables given Francisco's comment. If that's the case, you can do everything in one sproc with temp tables. I actually am doing this in several cases. I create sometimes two or three temp tables in my sproc, then use those to do something or return something and then drop the temp table, all in the same sproc. Let me know if you need info on how to do this. --Susan -----Original Message----- From: Francisco Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, March 05, 2003 1:52 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Stored Procedures There is no way that I know of to do what you are asking in SQL7, viable workarounds include executing your sproc1, to execute a nested sproc that writes to a temp table and then refrencing the temp table from sproc1 long after sproc2 (nested) has executed. just a wag tho. -Francisco http://rcm.netfirms.com/ ----- Original Message ----- From: "Jim Lawrence (AccessD)" To: Sent: Tuesday, March 04, 2003 11:21 PM Subject: RE: [dba-SQLServer]Stored Procedures : Thanks Susan: : : Unfortunately, the client is running on SQL7. :-( : : Jim : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan : Zeller : Sent: Tuesday, March 04, 2003 3:14 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Jim, : : I use UDF's for this. Results of a UDF can be used like any table. So, : I massage data in a UDF which can receive parameters and then do the : second manipulation in the sproc. UDF's are only avaiable in 2000 : though. : : --Susan : : : -----Original Message----- : From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] : Sent: Tuesday, March 04, 2003 4:45 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Hi All: : : Is there a way to use the results of one StoredProcedure to feed a : second SP. The example I am working with is one SP to massages the data : and the second one manipulates the data via Transpose/Pivot. : : TIA : Jim _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From davide at dalyn.co.nz Wed Mar 5 12:43:58 2003 From: davide at dalyn.co.nz (David Emerson) Date: Thu, 06 Mar 2003 07:43:58 +1300 Subject: [dba-SQLServer]Calling a Sproc with Parameter In-Reply-To: References: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBDA@ex02.eagle.usaa.com> Message-ID: <5.2.0.9.0.20030306073422.00b1b3c8@mail.dalyn.co.nz> I have used query analyser and run the sproc both with entering % and Active as the parameter. Both work OK. I can't seem to find any information on "error 2353 - Bad query parameter." Anyone know of a source that will explain this? (I tried Access help, BOL, Google). Here is the sproc in case I have missed something - ALTER PROCEDURE spfrmCustomers ( @AccStatus varchar(20) = '%' ) AS SET NOCOUNT ON SELECT dbo.tblCustomers.*, case when [Residential]=1 then CSurname + C1stName else TradingName end as SortOrder FROM dbo.tblCustomers WHERE AccStatus like @AccStatus ORDER BY SortOrder If @@Error <> 0 Begin Select 'Unexpected error occurred: ', @@Error Return @@Error End else return 0 David At 5/03/2003, you wrote: >Both points are valid, but in this case the Sproc must be able to handle the >'%'. Assuming that you are not executing Dynamic Sql in your sproc you >maybe manipulating the sproc to select all Customers not just the active >ones... Do you have access to Query Analyzer? if so I would test the sproc >in there to make sure it executes w/o errors. I have found certain errors >to be Access Only. Such as selecting data from a linked table on another >server. > > >-Francisco >http://rcm.netfirms.com >----- Original Message ----- >From: "Djabarov, Robert" >To: >Sent: Wednesday, March 05, 2003 7:13 AM >Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter > > >I will have to respectfully disagree with the previous recommendations. >LIKE will prevent your sp from compiling in the first place, while the usage >of EXEC is very proper in the original code. Although the suggested form is >still valid, specifying named parameters is actually encouraged for the >clarity of the code, and MS fully supports EXEC sp_PROC @Parm1='', >@Parm2=, etc. > >Robert Djabarov >Senior SQL Server DBA >USAA IT/DBMS >* (210) 913-3148 - phone >* (210) 753-3148 - pager > >-----Original Message----- >From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] >Sent: Wednesday, March 05, 2003 7:25 AM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter > >Two things. > >1) Make sure your sproc is looking for LIKE @AccStatus and not = @AccStatus > >2) When you use EXEC, you don't add the name of the parameter. >"EXEC spfrmCustomers 'Active'" > >Doris Manning >Database Administrator >Hargrove Inc. >www.hargroveinc.com >-----Original Message----- >From: dba-sqlserver-admin at databaseadvisors.com >[mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of David Emerson >Sent: Tuesday, March 04, 2003 07:01 PM >To: dba-SQLServer at databaseadvisors.com >Subject: [dba-SQLServer]Calling a Sproc with Parameter >I have a button on a form which is used to filter the records. The code >is - > >Private Sub cmdCustomerFilter_Click() > > On Error GoTo Err_cmdCustomerFilter_Click > > If Me!cmdCustomerFilter.Caption = "Show Active" Then > Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" <- >Problem line > Me!cmdCustomerFilter.Caption = "Show All" > Else > Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" > Me!cmdCustomerFilter.Caption = "Show Active" > End If >..... > >End Sub > >In the sproc the parameter is - > >@AccStatus varchar(20) = '%' > >When I click on the button I get error 2353 - Bad query parameter. I can >run the query in Query analyser and it runs ok. > >If I leave the @AccStatus = 'Active' off then a message appears telling me >that the procedure expects the parameter (so this tells me it is calling the >correct sproc) > >I think the problem is in the call but can't put my finger on it. Any help? > > > >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 Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 -------------- next part -------------- An HTML attachment was scrubbed... URL: From szeller at cce.umn.edu Wed Mar 5 12:57:14 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Wed, 5 Mar 2003 12:57:14 -0600 Subject: [dba-SQLServer]Calling a Sproc with Parameter Message-ID: In situtaions like this I do lots of testing eliminating one thing at a time. Given what you have already tried, what I would do is change the sproc so it doesn't require an input parameter and then hard code a value (active or %) into your sproc. Try running it from the app to see if it works. If it does, you know for sure the problem is in how you are passing the parameter. If the problem is in passing the parameter, I might put the parameter in a variable in your FE and then do something like: Me.RecordSource = "EXEC spfrmCustomers @AccStatus = " & strAccStatus --Susan -----Original Message----- From: David Emerson [mailto:davide at dalyn.co.nz] Sent: Wednesday, March 05, 2003 12:44 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Calling a Sproc with Parameter I have used query analyser and run the sproc both with entering % and Active as the parameter. Both work OK. I can't seem to find any information on "error 2353 - Bad query parameter." Anyone know of a source that will explain this? (I tried Access help, BOL, Google). Here is the sproc in case I have missed something - ALTER PROCEDURE spfrmCustomers ( @AccStatus varchar(20) = '%' ) AS SET NOCOUNT ON SELECT dbo.tblCustomers.*, case when [Residential]=1 then CSurname + C1stName else TradingName end as SortOrder FROM dbo.tblCustomers WHERE AccStatus like @AccStatus ORDER BY SortOrder If @@Error <> 0 Begin Select 'Unexpected error occurred: ', @@Error Return @@Error End else return 0 David At 5/03/2003, you wrote: Both points are valid, but in this case the Sproc must be able to handle the '%'. Assuming that you are not executing Dynamic Sql in your sproc you maybe manipulating the sproc to select all Customers not just the active ones... Do you have access to Query Analyzer? if so I would test the sproc in there to make sure it executes w/o errors. I have found certain errors to be Access Only. Such as selecting data from a linked table on another server. -Francisco http://rcm.netfirms.com ----- Original Message ----- From: "Djabarov, Robert" To: Sent: Wednesday, March 05, 2003 7:13 AM Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter I will have to respectfully disagree with the previous recommendations. LIKE will prevent your sp from compiling in the first place, while the usage of EXEC is very proper in the original code. Although the suggested form is still valid, specifying named parameters is actually encouraged for the clarity of the code, and MS fully supports EXEC sp_PROC @Parm1='', @Parm2=, etc. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS * (210) 913-3148 - phone * (210) 753-3148 - pager -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Wednesday, March 05, 2003 7:25 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter Two things. 1) Make sure your sproc is looking for LIKE @AccStatus and not = @AccStatus 2) When you use EXEC, you don't add the name of the parameter. "EXEC spfrmCustomers 'Active'" Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of David Emerson Sent: Tuesday, March 04, 2003 07:01 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Calling a Sproc with Parameter I have a button on a form which is used to filter the records. The code is - Private Sub cmdCustomerFilter_Click() On Error GoTo Err_cmdCustomerFilter_Click If Me!cmdCustomerFilter.Caption = "Show Active" Then Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" <- Problem line Me!cmdCustomerFilter.Caption = "Show All" Else Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" Me!cmdCustomerFilter.Caption = "Show Active" End If ..... End Sub In the sproc the parameter is - @AccStatus varchar(20) = '%' When I click on the button I get error 2353 - Bad query parameter. I can run the query in Query analyser and it runs ok. If I leave the @AccStatus = 'Active' off then a message appears telling me that the procedure expects the parameter (so this tells me it is calling the correct sproc) I think the problem is in the call but can't put my finger on it. Any help? 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 Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 -------------- next part -------------- An HTML attachment was scrubbed... URL: From my.lists at verizon.net Wed Mar 5 13:16:11 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 5 Mar 2003 11:16:11 -0800 Subject: [dba-SQLServer]Calling a Sproc with Parameter References: <657FB70438B7D311AF320090279C180103C5E465@EXCHMAIL> Message-ID: <002301c2e34b$af7b2210$b615010a@FHTAPIA> Since it works in QA, now try executing it from the stored procedure tab in your ADP, look for spfrmCustomers and double click it, then enter the parameter manually (into the input box)... If this works fine, then the error lies in the call Modify for grins... Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" to Me.RecordSource = "EXEC spfrmCustomers 'Active'" OR Me.RecordSource = "EXEC spfrmCustomers @AccStatus = "& chr(39) & "Active" & chr(39) -Francisco http://rcm.netfirms.com ----- Original Message ----- From: "David Emerson" To: Sent: Wednesday, March 05, 2003 10:43 AM Subject: Re: [dba-SQLServer]Calling a Sproc with Parameter : I have used query analyser and run the sproc both with entering % and : Active as the parameter. Both work OK. : : I can't seem to find any information on "error 2353 - Bad query : parameter." Anyone know of a source that will explain this? (I tried : Access help, BOL, Google). : : Here is the sproc in case I have missed something - : : ALTER PROCEDURE spfrmCustomers : : ( : @AccStatus varchar(20) = '%' : ) : : AS : SET NOCOUNT ON : : SELECT dbo.tblCustomers.*, : case : when [Residential]=1 : then CSurname + C1stName : else TradingName : end : as SortOrder : FROM dbo.tblCustomers : WHERE AccStatus like @AccStatus : ORDER BY SortOrder : : If @@Error <> 0 : Begin : Select 'Unexpected error occurred: ', @@Error : Return @@Error : End : else : return 0 : : : : David : : At 5/03/2003, you wrote: : : : Both points are valid, but in this case the Sproc must be able to handle : the : '%'. Assuming that you are not executing Dynamic Sql in your sproc you : maybe manipulating the sproc to select all Customers not just the active : ones... Do you have access to Query Analyzer? if so I would test the : sproc : in there to make sure it executes w/o errors. I have found certain : errors : to be Access Only. Such as selecting data from a linked table on : another : server. : : : -Francisco : http://rcm.netfirms.com : ----- Original Message ----- : From: "Djabarov, Robert" : To: : Sent: Wednesday, March 05, 2003 7:13 AM : Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter : : : I will have to respectfully disagree with the previous recommendations. : LIKE will prevent your sp from compiling in the first place, while the : usage : of EXEC is very proper in the original code. Although the suggested : form is : still valid, specifying named parameters is actually encouraged for the : clarity of the code, and MS fully supports EXEC sp_PROC : @Parm1='', : @Parm2=, etc. : : Robert Djabarov : Senior SQL Server DBA : USAA IT/DBMS : * (210) 913-3148 - phone : * (210) 753-3148 - pager : : -----Original Message----- : From: Mike and Doris Manning [ mailto:mikedorism at ntelos.net : ] : Sent: Wednesday, March 05, 2003 7:25 AM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter : : Two things. : : 1) Make sure your sproc is looking for LIKE @AccStatus and not = : @AccStatus : : 2) When you use EXEC, you don't add the name of the parameter. : "EXEC spfrmCustomers 'Active'" : : Doris Manning : Database Administrator : Hargrove Inc. : www.hargroveinc.com : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [ mailto:dba-sqlserver-admin at databaseadvisors.com : ] On Behalf Of David : Emerson : Sent: Tuesday, March 04, 2003 07:01 PM : To: dba-SQLServer at databaseadvisors.com : Subject: [dba-SQLServer]Calling a Sproc with Parameter : I have a button on a form which is used to filter the records. The code : is - : : Private Sub cmdCustomerFilter_Click() : : On Error GoTo Err_cmdCustomerFilter_Click : : If Me!cmdCustomerFilter.Caption = "Show Active" Then : Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" : <- : Problem line : Me!cmdCustomerFilter.Caption = "Show All" : Else : Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" : Me!cmdCustomerFilter.Caption = "Show Active" : End If : ..... : : End Sub : : In the sproc the parameter is - : : @AccStatus varchar(20) = '%' : : When I click on the button I get error 2353 - Bad query parameter. I : can : run the query in Query analyser and it runs ok. : : If I leave the @AccStatus = 'Active' off then a message appears telling : me : that the procedure expects the parameter (so this tells me it is calling : the : correct sproc) : : I think the problem is in the call but can't put my finger on it. Any : help? : : : : 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 : : Regards : : David Emerson : DALYN Software Ltd : 25b Cunliffe St, Johnsonville : Wellington, New Zealand : Ph/Fax (877) 456-1205 : : From davide at dalyn.co.nz Wed Mar 5 17:01:37 2003 From: davide at dalyn.co.nz (David Emerson) Date: Thu, 06 Mar 2003 12:01:37 +1300 Subject: [dba-SQLServer]Calling a Sproc with Parameter In-Reply-To: <002301c2e34b$af7b2210$b615010a@FHTAPIA> References: <657FB70438B7D311AF320090279C180103C5E465@EXCHMAIL> Message-ID: <5.2.0.9.0.20030306114201.00b1b208@mail.dalyn.co.nz> Thanks for your suggestions Susan and Francisco, The sproc works if I open it from Access and manually enter the parameter. Tried all suggestions below - no difference. Tried changing the name of the parameter - same result. Tried (with same result) - Me.RecordSource = "EXEC spfrmCustomers @AccStatus='" & strAccStatus & "'" Me.RecordSource = "EXEC spfrmCustomers @AccStatus='" strAccStatus Me.RecordSource = "EXEC spfrmCustomers strAccStatus" Finally, tried clearing the InputParameter property on the form (was @AccStatus='%') and bingo! One happy-chappy :) Seemed to be some conflict with this but I don't understand why. David At 5/03/2003, you wrote: >Since it works in QA, now try executing it from the stored procedure tab in >your ADP, look for spfrmCustomers and double click it, then enter the >parameter manually (into the input box)... If this works fine, then the >error lies in the call > >Modify for grins... >Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" >to >Me.RecordSource = "EXEC spfrmCustomers 'Active'" >OR >Me.RecordSource = "EXEC spfrmCustomers @AccStatus = "& chr(39) & "Active" & >chr(39) > > > > > >-Francisco >http://rcm.netfirms.com >----- Original Message ----- >From: "David Emerson" >To: >Sent: Wednesday, March 05, 2003 10:43 AM >Subject: Re: [dba-SQLServer]Calling a Sproc with Parameter > > >: I have used query analyser and run the sproc both with entering % and >: Active as the parameter. Both work OK. >: >: I can't seem to find any information on "error 2353 - Bad query >: parameter." Anyone know of a source that will explain this? (I tried >: Access help, BOL, Google). >: >: Here is the sproc in case I have missed something - >: >: ALTER PROCEDURE spfrmCustomers >: >: ( >: @AccStatus varchar(20) = '%' >: ) >: >: AS >: SET NOCOUNT ON >: >: SELECT dbo.tblCustomers.*, >: case >: when [Residential]=1 >: then CSurname + C1stName >: else TradingName >: end >: as SortOrder >: FROM dbo.tblCustomers >: WHERE AccStatus like @AccStatus >: ORDER BY SortOrder >: >: If @@Error <> 0 >: Begin >: Select 'Unexpected error occurred: ', @@Error >: Return @@Error >: End >: else >: return 0 >: >: >: >: David >: >: At 5/03/2003, you wrote: >: >: >: Both points are valid, but in this case the Sproc must be able to handle >: the >: '%'. Assuming that you are not executing Dynamic Sql in your sproc you >: maybe manipulating the sproc to select all Customers not just the active >: ones... Do you have access to Query Analyzer? if so I would test the >: sproc >: in there to make sure it executes w/o errors. I have found certain >: errors >: to be Access Only. Such as selecting data from a linked table on >: another >: server. >: >: >: -Francisco >: http://rcm.netfirms.com >: ----- Original Message ----- >: From: "Djabarov, Robert" >: To: >: Sent: Wednesday, March 05, 2003 7:13 AM >: Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter >: >: >: I will have to respectfully disagree with the previous recommendations. >: LIKE will prevent your sp from compiling in the first place, while the >: usage >: of EXEC is very proper in the original code. Although the suggested >: form is >: still valid, specifying named parameters is actually encouraged for the >: clarity of the code, and MS fully supports EXEC sp_PROC >: @Parm1='', >: @Parm2=, etc. >: >: Robert Djabarov >: Senior SQL Server DBA >: USAA IT/DBMS >: * (210) 913-3148 - phone >: * (210) 753-3148 - pager >: >: -----Original Message----- >: From: Mike and Doris Manning [ mailto:mikedorism at ntelos.net >: ] >: Sent: Wednesday, March 05, 2003 7:25 AM >: To: dba-sqlserver at databaseadvisors.com >: Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter >: >: Two things. >: >: 1) Make sure your sproc is looking for LIKE @AccStatus and not = >: @AccStatus >: >: 2) When you use EXEC, you don't add the name of the parameter. >: "EXEC spfrmCustomers 'Active'" >: >: Doris Manning >: Database Administrator >: Hargrove Inc. >: www.hargroveinc.com >: -----Original Message----- >: From: dba-sqlserver-admin at databaseadvisors.com >: [ mailto:dba-sqlserver-admin at databaseadvisors.com >: ] On Behalf Of David >: Emerson >: Sent: Tuesday, March 04, 2003 07:01 PM >: To: dba-SQLServer at databaseadvisors.com >: Subject: [dba-SQLServer]Calling a Sproc with Parameter >: I have a button on a form which is used to filter the records. The code >: is - >: >: Private Sub cmdCustomerFilter_Click() >: >: On Error GoTo Err_cmdCustomerFilter_Click >: >: If Me!cmdCustomerFilter.Caption = "Show Active" Then >: Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" >: <- >: Problem line >: Me!cmdCustomerFilter.Caption = "Show All" >: Else >: Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" >: Me!cmdCustomerFilter.Caption = "Show Active" >: End If >: ..... >: >: End Sub >: >: In the sproc the parameter is - >: >: @AccStatus varchar(20) = '%' >: >: When I click on the button I get error 2353 - Bad query parameter. I >: can >: run the query in Query analyser and it runs ok. >: >: If I leave the @AccStatus = 'Active' off then a message appears telling >: me >: that the procedure expects the parameter (so this tells me it is calling >: the >: correct sproc) >: >: I think the problem is in the call but can't put my finger on it. Any >: help? >: >: >: >: Regards >: >: David Emerson >: DALYN Software Ltd >: 25b Cunliffe St, Johnsonville >: Wellington, New Zealand >: Ph/Fax (877) 456-1205 >: From accessd at shaw.ca Wed Mar 5 19:42:43 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Wed, 05 Mar 2003 17:42:43 -0800 Subject: [dba-SQLServer]Stored Procedures In-Reply-To: Message-ID: Thank Susan very much for this information...I will put it to good use. Jim -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan Zeller Sent: Wednesday, March 05, 2003 9:06 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures Jim, Here's a paired down sproc that shows creating a temp table, using the data from the temp table and then dropping it. I've made this so simple that the temp table isn't really neccesary, but it will give you the idea. Let me know if you have questions. Temp tables work just like real tables, but the have a # in front of the name. --Susan create proc dbo.p_rpt_Activity_Summary @IP_Activity_ID int as set nocount on /* A. Put all the ip_empjob start rows into a temp table */ select ip_empjob_id, emplid, empl_rcdno , effdt as startdate, cast(null as datetime) as enddate into #ip_emp_job_start_end from ip_emp_job where action not in ('LOA', 'PLA', 'RET', 'SUS', 'SWB', 'TER', 'TWB') --select * from #ip_emp_job_start_end /* B. Do something with the data in the temp table. */ select a.empl_type_desc , a.COMPRATE , a.AREA , a.ORG , a.SUBORG FROM #ip_emp_job_start_end a inner join tbl_student b on a.emplid = b.emplid where b.ip_activity_id = @ip_activity_id /* C. Drop temp table -- cleaner to drop this explicity, even though it will drop when the sproc finishes. */ drop table #ip_emp_job_start_end GO -----Original Message----- From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] Sent: Wednesday, March 05, 2003 10:03 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures Hi Susan: Yes, please. I could probably figure it out if given enough time but you are skilled in this. I would greatly appreciate any description or example you could provide. :-) TIA Jim -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan Zeller Sent: Wednesday, March 05, 2003 6:14 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedures I'm assuming SQL7 has temp tables given Francisco's comment. If that's the case, you can do everything in one sproc with temp tables. I actually am doing this in several cases. I create sometimes two or three temp tables in my sproc, then use those to do something or return something and then drop the temp table, all in the same sproc. Let me know if you need info on how to do this. --Susan -----Original Message----- From: Francisco Tapia [mailto:my.lists at verizon.net] Sent: Wednesday, March 05, 2003 1:52 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Stored Procedures There is no way that I know of to do what you are asking in SQL7, viable workarounds include executing your sproc1, to execute a nested sproc that writes to a temp table and then refrencing the temp table from sproc1 long after sproc2 (nested) has executed. just a wag tho. -Francisco http://rcm.netfirms.com/ ----- Original Message ----- From: "Jim Lawrence (AccessD)" To: Sent: Tuesday, March 04, 2003 11:21 PM Subject: RE: [dba-SQLServer]Stored Procedures : Thanks Susan: : : Unfortunately, the client is running on SQL7. :-( : : Jim : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan : Zeller : Sent: Tuesday, March 04, 2003 3:14 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Jim, : : I use UDF's for this. Results of a UDF can be used like any table. So, : I massage data in a UDF which can receive parameters and then do the : second manipulation in the sproc. UDF's are only avaiable in 2000 : though. : : --Susan : : : -----Original Message----- : From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] : Sent: Tuesday, March 04, 2003 4:45 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Stored Procedures : : : Hi All: : : Is there a way to use the results of one StoredProcedure to feed a : second SP. The example I am working with is one SP to massages the data : and the second one manipulates the data via Transpose/Pivot. : : TIA : Jim _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ 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 Mar 6 01:39:57 2003 From: my.lists at verizon.net (Francisco Tapia) Date: Wed, 5 Mar 2003 23:39:57 -0800 Subject: [dba-SQLServer]Calling a Sproc with Parameter References: <657FB70438B7D311AF320090279C180103C5E465@EXCHMAIL> <5.2.0.9.0.20030306114201.00b1b208@mail.dalyn.co.nz> Message-ID: <005501c2e3b3$98520b40$0eb62904@amd2k> intresting :S -Francisco http://rcm.netfirms.com/ ----- Original Message ----- From: "David Emerson" To: Sent: Wednesday, March 05, 2003 3:01 PM Subject: Re: [dba-SQLServer]Calling a Sproc with Parameter : Thanks for your suggestions Susan and Francisco, : : The sproc works if I open it from Access and manually enter the parameter. : : Tried all suggestions below - no difference. : : Tried changing the name of the parameter - same result. : : Tried (with same result) - : Me.RecordSource = "EXEC spfrmCustomers @AccStatus='" & : strAccStatus & "'" : Me.RecordSource = "EXEC spfrmCustomers @AccStatus='" strAccStatus : Me.RecordSource = "EXEC spfrmCustomers strAccStatus" : : Finally, tried clearing the InputParameter property on the form : (was @AccStatus='%') and bingo! One happy-chappy :) Seemed to be some : conflict with this but I don't understand why. : : David : : : At 5/03/2003, you wrote: : >Since it works in QA, now try executing it from the stored procedure tab in : >your ADP, look for spfrmCustomers and double click it, then enter the : >parameter manually (into the input box)... If this works fine, then the : >error lies in the call : > : >Modify for grins... : >Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" : >to : >Me.RecordSource = "EXEC spfrmCustomers 'Active'" : >OR : >Me.RecordSource = "EXEC spfrmCustomers @AccStatus = "& chr(39) & "Active" & : >chr(39) : > : > : > : > : > : >-Francisco : >http://rcm.netfirms.com : >----- Original Message ----- : >From: "David Emerson" : >To: : >Sent: Wednesday, March 05, 2003 10:43 AM : >Subject: Re: [dba-SQLServer]Calling a Sproc with Parameter : > : > : >: I have used query analyser and run the sproc both with entering % and : >: Active as the parameter. Both work OK. : >: : >: I can't seem to find any information on "error 2353 - Bad query : >: parameter." Anyone know of a source that will explain this? (I tried : >: Access help, BOL, Google). : >: : >: Here is the sproc in case I have missed something - : >: : >: ALTER PROCEDURE spfrmCustomers : >: : >: ( : >: @AccStatus varchar(20) = '%' : >: ) : >: : >: AS : >: SET NOCOUNT ON : >: : >: SELECT dbo.tblCustomers.*, : >: case : >: when [Residential]=1 : >: then CSurname + C1stName : >: else TradingName : >: end : >: as SortOrder : >: FROM dbo.tblCustomers : >: WHERE AccStatus like @AccStatus : >: ORDER BY SortOrder : >: : >: If @@Error <> 0 : >: Begin : >: Select 'Unexpected error occurred: ', @@Error : >: Return @@Error : >: End : >: else : >: return 0 : >: : >: : >: : >: David : >: : >: At 5/03/2003, you wrote: : >: : >: : >: Both points are valid, but in this case the Sproc must be able to handle : >: the : >: '%'. Assuming that you are not executing Dynamic Sql in your sproc you : >: maybe manipulating the sproc to select all Customers not just the active : >: ones... Do you have access to Query Analyzer? if so I would test the : >: sproc : >: in there to make sure it executes w/o errors. I have found certain : >: errors : >: to be Access Only. Such as selecting data from a linked table on : >: another : >: server. : >: : >: : >: -Francisco : >: http://rcm.netfirms.com : >: ----- Original Message ----- : >: From: "Djabarov, Robert" : >: To: : >: Sent: Wednesday, March 05, 2003 7:13 AM : >: Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter : >: : >: : >: I will have to respectfully disagree with the previous recommendations. : >: LIKE will prevent your sp from compiling in the first place, while the : >: usage : >: of EXEC is very proper in the original code. Although the suggested : >: form is : >: still valid, specifying named parameters is actually encouraged for the : >: clarity of the code, and MS fully supports EXEC sp_PROC : >: @Parm1='', : >: @Parm2=, etc. : >: : >: Robert Djabarov : >: Senior SQL Server DBA : >: USAA IT/DBMS : >: * (210) 913-3148 - phone : >: * (210) 753-3148 - pager : >: : >: -----Original Message----- : >: From: Mike and Doris Manning [ mailto:mikedorism at ntelos.net : >: ] : >: Sent: Wednesday, March 05, 2003 7:25 AM : >: To: dba-sqlserver at databaseadvisors.com : >: Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter : >: : >: Two things. : >: : >: 1) Make sure your sproc is looking for LIKE @AccStatus and not = : >: @AccStatus : >: : >: 2) When you use EXEC, you don't add the name of the parameter. : >: "EXEC spfrmCustomers 'Active'" : >: : >: Doris Manning : >: Database Administrator : >: Hargrove Inc. : >: www.hargroveinc.com : >: -----Original Message----- : >: From: dba-sqlserver-admin at databaseadvisors.com : >: [ mailto:dba-sqlserver-admin at databaseadvisors.com : >: ] On Behalf Of David : >: Emerson : >: Sent: Tuesday, March 04, 2003 07:01 PM : >: To: dba-SQLServer at databaseadvisors.com : >: Subject: [dba-SQLServer]Calling a Sproc with Parameter : >: I have a button on a form which is used to filter the records. The code : >: is - : >: : >: Private Sub cmdCustomerFilter_Click() : >: : >: On Error GoTo Err_cmdCustomerFilter_Click : >: : >: If Me!cmdCustomerFilter.Caption = "Show Active" Then : >: Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" : >: <- : >: Problem line : >: Me!cmdCustomerFilter.Caption = "Show All" : >: Else : >: Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" : >: Me!cmdCustomerFilter.Caption = "Show Active" : >: End If : >: ..... : >: : >: End Sub : >: : >: In the sproc the parameter is - : >: : >: @AccStatus varchar(20) = '%' : >: : >: When I click on the button I get error 2353 - Bad query parameter. I : >: can : >: run the query in Query analyser and it runs ok. : >: : >: If I leave the @AccStatus = 'Active' off then a message appears telling : >: me : >: that the procedure expects the parameter (so this tells me it is calling : >: the : >: correct sproc) : >: : >: I think the problem is in the call but can't put my finger on it. Any : >: help? : >: : >: : >: : >: 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 szeller at cce.umn.edu Thu Mar 6 09:29:56 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Thu, 6 Mar 2003 09:29:56 -0600 Subject: [dba-SQLServer]Calling a Sproc with Parameter Message-ID: FYI, if you are going to use a variable, the correct syntax is the first one you tried: Me.RecordSource = "EXEC spfrmCustomers @AccStatus='" & strAccStatus & "'" I've had this happen to me before now that I think of it. It's not a bad idea ot wipe out whatever is in the property box for input parameters before you save a form. Sounds like you did some good detective work. --Susan -----Original Message----- From: David Emerson [mailto:davide at dalyn.co.nz] Sent: Wednesday, March 05, 2003 5:02 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Calling a Sproc with Parameter Thanks for your suggestions Susan and Francisco, The sproc works if I open it from Access and manually enter the parameter. Tried all suggestions below - no difference. Tried changing the name of the parameter - same result. Tried (with same result) - Me.RecordSource = "EXEC spfrmCustomers @AccStatus='" & strAccStatus & "'" Me.RecordSource = "EXEC spfrmCustomers @AccStatus='" strAccStatus Me.RecordSource = "EXEC spfrmCustomers strAccStatus" Finally, tried clearing the InputParameter property on the form (was @AccStatus='%') and bingo! One happy-chappy :) Seemed to be some conflict with this but I don't understand why. David At 5/03/2003, you wrote: >Since it works in QA, now try executing it from the stored procedure >tab in your ADP, look for spfrmCustomers and double click it, then >enter the parameter manually (into the input box)... If this works >fine, then the error lies in the call > >Modify for grins... >Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" to >Me.RecordSource = "EXEC spfrmCustomers 'Active'" >OR >Me.RecordSource = "EXEC spfrmCustomers @AccStatus = "& chr(39) & "Active" & >chr(39) > > > > > >-Francisco >http://rcm.netfirms.com >----- Original Message ----- >From: "David Emerson" >To: >Sent: Wednesday, March 05, 2003 10:43 AM >Subject: Re: [dba-SQLServer]Calling a Sproc with Parameter > > >: I have used query analyser and run the sproc both with entering % and >: Active as the parameter. Both work OK. >: >: I can't seem to find any information on "error 2353 - Bad query >: parameter." Anyone know of a source that will explain this? (I >tried >: Access help, BOL, Google). >: >: Here is the sproc in case I have missed something - >: >: ALTER PROCEDURE spfrmCustomers >: >: ( >: @AccStatus varchar(20) = '%' >: ) >: >: AS >: SET NOCOUNT ON >: >: SELECT dbo.tblCustomers.*, >: case >: when [Residential]=1 >: then CSurname + C1stName >: else TradingName >: end >: as SortOrder >: FROM dbo.tblCustomers >: WHERE AccStatus like @AccStatus >: ORDER BY SortOrder >: >: If @@Error <> 0 >: Begin >: Select 'Unexpected error occurred: ', @@Error >: Return @@Error >: End >: else >: return 0 >: >: >: >: David >: >: At 5/03/2003, you wrote: >: >: >: Both points are valid, but in this case the Sproc must be able to handle >: the >: '%'. Assuming that you are not executing Dynamic Sql in your sproc you >: maybe manipulating the sproc to select all Customers not just the active >: ones... Do you have access to Query Analyzer? if so I would test the >: sproc >: in there to make sure it executes w/o errors. I have found certain >: errors >: to be Access Only. Such as selecting data from a linked table on >: another >: server. >: >: >: -Francisco >: http://rcm.netfirms.com >: ----- Original Message ----- >: From: "Djabarov, Robert" >: To: >: Sent: Wednesday, March 05, 2003 7:13 AM >: Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter >: >: >: I will have to respectfully disagree with the previous recommendations. >: LIKE will prevent your sp from compiling in the first place, while the >: usage >: of EXEC is very proper in the original code. Although the suggested >: form is >: still valid, specifying named parameters is actually encouraged for the >: clarity of the code, and MS fully supports EXEC sp_PROC >: @Parm1='', >: @Parm2=, etc. >: >: Robert Djabarov >: Senior SQL Server DBA >: USAA IT/DBMS >: * (210) 913-3148 - phone >: * (210) 753-3148 - pager >: >: -----Original Message----- >: From: Mike and Doris Manning [ mailto:mikedorism at ntelos.net >: ] >: Sent: Wednesday, March 05, 2003 7:25 AM >: To: dba-sqlserver at databaseadvisors.com >: Subject: RE: [dba-SQLServer]Calling a Sproc with Parameter >: >: Two things. >: >: 1) Make sure your sproc is looking for LIKE @AccStatus and not = >: @AccStatus >: >: 2) When you use EXEC, you don't add the name of the parameter. >: "EXEC spfrmCustomers 'Active'" >: >: Doris Manning >: Database Administrator >: Hargrove Inc. >: www.hargroveinc.com >: -----Original Message----- >: From: dba-sqlserver-admin at databaseadvisors.com >: [ mailto:dba-sqlserver-admin at databaseadvisors.com >: ] On Behalf Of David >: Emerson >: Sent: Tuesday, March 04, 2003 07:01 PM >: To: dba-SQLServer at databaseadvisors.com >: Subject: [dba-SQLServer]Calling a Sproc with Parameter >: I have a button on a form which is used to filter the records. The code >: is - >: >: Private Sub cmdCustomerFilter_Click() >: >: On Error GoTo Err_cmdCustomerFilter_Click >: >: If Me!cmdCustomerFilter.Caption = "Show Active" Then >: Me.RecordSource = "EXEC spfrmCustomers @AccStatus = 'Active'" >: <- >: Problem line >: Me!cmdCustomerFilter.Caption = "Show All" >: Else >: Me.RecordSource = "EXEC spfrmCustomers @AccStatus='%'" >: Me!cmdCustomerFilter.Caption = "Show Active" >: End If >: ..... >: >: End Sub >: >: In the sproc the parameter is - >: >: @AccStatus varchar(20) = '%' >: >: When I click on the button I get error 2353 - Bad query parameter. I >: can >: run the query in Query analyser and it runs ok. >: >: If I leave the @AccStatus = 'Active' off then a message appears telling >: me >: that the procedure expects the parameter (so this tells me it is calling >: the >: correct sproc) >: >: I think the problem is in the call but can't put my finger on it. Any >: help? >: >: >: >: 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 harkins at iglou.com Thu Mar 6 19:57:08 2003 From: harkins at iglou.com (Susan Harkins) Date: Thu, 6 Mar 2003 20:57:08 -0500 Subject: [dba-SQLServer]* in field name? Message-ID: <03f801c2e44c$df757720$f4ecffcc@SusanOne> where bc.carrera=a.carrera and bc.plan_estud=a.plan_estud and a.boleta*=k.boleta =======Ran across what appears to be an unusual syntax -- the use of * in a field name? Is that what this is? What does this mean or am I misunderstanding what I'm seeing? Susan H. From chris at denverdb.com Thu Mar 6 20:05:06 2003 From: chris at denverdb.com (Chris Mackin) Date: Thu, 6 Mar 2003 19:05:06 -0700 Subject: [dba-SQLServer]* in field name? In-Reply-To: <03f801c2e44c$df757720$f4ecffcc@SusanOne> Message-ID: No that's actually multiplying the value and setting it eqaal to the left side of the equation. Var1 *= Var2 is the equivalent of Var1 = Var1 * Var2 Works in VB but not VBA (There are others like +=, /=, etc....) Chris Mackin www.denverdb.com Denver Database Consulting, LLC -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan Harkins Sent: Thursday, March 06, 2003 6:57 PM To: SQLList Subject: [dba-SQLServer]* in field name? where bc.carrera=a.carrera and bc.plan_estud=a.plan_estud and a.boleta*=k.boleta =======Ran across what appears to be an unusual syntax -- the use of * in a field name? Is that what this is? What does this mean or am I misunderstanding what I'm seeing? Susan H. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Mar 6 21:54:32 2003 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 07 Mar 2003 13:54:32 +1000 Subject: [dba-SQLServer]* in field name? In-Reply-To: References: <03f801c2e44c$df757720$f4ecffcc@SusanOne> Message-ID: <3E68A498.15394.238C8B@localhost> What version of VB? I've never seen it in any earlier versions and it doesn't work in VB6. In this case *= is specifying a left outer join. From artful at rogers.com Fri Mar 7 06:49:32 2003 From: artful at rogers.com (Arthur Fuller) Date: Fri, 7 Mar 2003 07:49:32 -0500 Subject: [dba-SQLServer]* in field name? In-Reply-To: <3E68A498.15394.238C8B@localhost> Message-ID: <002801c2e4a8$004a6770$8e01a8c0@Rock> AFAIK this c-style syntax was introduced in .Net. It's about time too, IMO! -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: March 6, 2003 10:55 PM To: Chris Mackin; dba-sqlserver at databaseadvisors.com; Susan Harkins Subject: RE: [dba-SQLServer]* in field name? What version of VB? I've never seen it in any earlier versions and it doesn't work in VB6. In this case *= is specifying a left outer join. From chris at denverdb.com Fri Mar 7 10:24:03 2003 From: chris at denverdb.com (Chris Mackin) Date: Fri, 7 Mar 2003 09:24:03 -0700 Subject: [dba-SQLServer]* in field name? In-Reply-To: <002801c2e4a8$004a6770$8e01a8c0@Rock> Message-ID: Stuart, I read about it the other day on MSDN and in trying to find it again I'm at a loss, but will let you know if it does turn up. I hadn't looked at the specifics, but yes it does appear to Join related. I think I was perusing the .Net information when I saw the other way of using it. Chris Mackin www.denverdb.com Denver Database Consulting, LLC -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Arthur Fuller Sent: Friday, March 07, 2003 5:50 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]* in field name? AFAIK this c-style syntax was introduced in .Net. It's about time too, IMO! -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: March 6, 2003 10:55 PM To: Chris Mackin; dba-sqlserver at databaseadvisors.com; Susan Harkins Subject: RE: [dba-SQLServer]* in field name? What version of VB? I've never seen it in any earlier versions and it doesn't work in VB6. In this case *= is specifying a left outer join. From stuart at lexacorp.com.pg Fri Mar 7 18:03:01 2003 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 08 Mar 2003 10:03:01 +1000 Subject: [dba-SQLServer]* in field name? In-Reply-To: <002801c2e4a8$004a6770$8e01a8c0@Rock> References: <3E68A498.15394.238C8B@localhost> Message-ID: <3E69BFD5.29365.54E3B7@localhost> > AFAIK this c-style syntax was introduced in .Net. It's about time too, IMO! > Why is it about time? If you want c-style syntax, write it in C. IMHO, It doesn't add anything to a BASIC language other than a giving you a more cryptic alternative to a simple existing structure. I prefer my code to be easily decypherable when I go back to support it a year or two later. That's the main reason I stick to BASICs and have never bothered to get seriously into C. -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. From harkins at iglou.com Thu Mar 6 22:05:38 2003 From: harkins at iglou.com (Susan Harkins) Date: Thu, 6 Mar 2003 23:05:38 -0500 Subject: [dba-SQLServer]* in field name? References: Message-ID: <049801c2e460$76cf0fb0$f4ecffcc@SusanOne> Thank you. :) Susan H. > No that's actually multiplying the value and setting it eqaal to the left > side of the equation. > > Var1 *= Var2 is the equivalent of Var1 = Var1 * Var2 > > Works in VB but not VBA (There are others like +=, /=, etc....) > > Chris Mackin > www.denverdb.com > Denver Database Consulting, LLC > > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan > Harkins > Sent: Thursday, March 06, 2003 6:57 PM > To: SQLList > Subject: [dba-SQLServer]* in field name? > > > where bc.carrera=a.carrera > and bc.plan_estud=a.plan_estud > and a.boleta*=k.boleta > > =======Ran across what appears to be an unusual syntax -- the use of * in a > field name? Is that what this is? What does this mean or am I > misunderstanding what I'm seeing? > > Susan H. > > _______________________________________________ > 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 Mon Mar 10 17:57:45 2003 From: harkins at iglou.com (Susan Harkins) Date: Mon, 10 Mar 2003 18:57:45 -0500 Subject: [dba-SQLServer]some fixes Message-ID: <065f01c2e761$143f1e40$f0e6ffcc@SusanOne> http://www.databasejournal.com/news/article.php/2106241 From davide at dalyn.co.nz Mon Mar 10 22:04:21 2003 From: davide at dalyn.co.nz (David Emerson) Date: Tue, 11 Mar 2003 17:04:21 +1300 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) Message-ID: <5.2.0.9.0.20030311165505.00bbe308@mail.dalyn.co.nz> AXP/SQL2K I have a subform which causes an error message when I delete a record from it - DELETE statement conflicted with COLUMN REFERENCE constraint 'tblCustInvoiceMeter_FK00'. BOL doesn't seem to help. There are no related records to the one I am deleting. Can anyone enlighten me on the problem? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 From my.lists at verizon.net Wed Mar 12 09:36:42 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 12 Mar 2003 07:36:42 -0800 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) References: <5.2.0.9.0.20030311165505.00bbe308@mail.dalyn.co.nz> Message-ID: <001201c2e8ad$2f2ade40$b615010a@FHTAPIA> The only time I've seen this type of error is when a related record is going to be deleted. What is the defenition reference for tblCustInvoiceMeter_FK00? -Francisco http://rcm.netfirms.com David Emerson wrote: : AXP/SQL2K : : I have a subform which causes an error message when I delete a record : from it - : : DELETE statement conflicted with COLUMN REFERENCE constraint : 'tblCustInvoiceMeter_FK00'. : : BOL doesn't seem to help. : : There are no related records to the one I am deleting. Can anyone : enlighten me on the problem? : : : Regards From szeller at cce.umn.edu Wed Mar 12 09:37:09 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Wed, 12 Mar 2003 09:37:09 -0600 Subject: [dba-SQLServer]Creating views from an adp -- permissions Message-ID: I am building an application as an ADP (Access 2002) and the application will be completely locked down to the users. They'll enter using an Application Role. I also want users to be able to do their own ad-hoc querying and reporting off of the data in the database. I plan to give them a separate ADP file that connects to the SQL Server database. I tried giving them Data Writer permissions but that apparently is not enough to save a view. I don't want to make them dbo's. I just want them to be able to create select views on the data. How do I set up permissions for this? --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 my.lists at verizon.net Wed Mar 12 09:56:13 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 12 Mar 2003 07:56:13 -0800 Subject: [dba-SQLServer]Creating views from an adp -- permissions References: Message-ID: <002c01c2e8af$e933eb90$b615010a@FHTAPIA> :O ad-hoc against a SQL Server?!?!? :O I don't recommend you allowing your users save a VIEW on your server, they can seriously mis-write one and cause serious performance problems on your server. Instead if ad-hoc is really something you're looking into, why not give them an MDB w/ Read-only snapshot views access so they can build their personal queries there. If you want to keep the entire system in the ADP then I recommend that you take a look at QBF (Queries by Form) and saving the settings to a .dat or .ini of some sort, this is the road we're going to take for our system. -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 7:37 AM [GMT-8], Susan Zeller wrote: : I am building an application as an ADP (Access 2002) and the : application will be completely locked down to the users. They'll : enter using an Application Role. : : I also want users to be able to do their own ad-hoc querying and : reporting off of the data in the database. I plan to give them a : separate ADP file that connects to the SQL Server database. I tried : giving them Data Writer permissions but that apparently is not enough : to save a view. I don't want to make them dbo's. I just want them : to be able to create select views on the data. How do I set up : permissions for this? From harkins at iglou.com Wed Mar 12 10:00:56 2003 From: harkins at iglou.com (Susan Harkins) Date: Wed, 12 Mar 2003 11:00:56 -0500 Subject: [dba-SQLServer]Creating views from an adp -- permissions References: <002c01c2e8af$e933eb90$b615010a@FHTAPIA> Message-ID: <00e901c2e8b0$93a94f70$0100007f@SusanOne> Are you just wanting to save their preferences? I realize this is SQL Server, but Doris and I just put together an article on this for Access. The form itself offers all the "options" and the necessary SQL code that puts them together, and the user can save those settings if they want -- the code behind the form uses the FileSystemObject and a TextStream -- couldn't be simplier. I don't know whether this could be adapted or not. Susan H. ----- Original Message ----- From: "Francisco H Tapia" To: Sent: Wednesday, March 12, 2003 10:56 AM Subject: Re: [dba-SQLServer]Creating views from an adp -- permissions > :O ad-hoc against a SQL Server?!?!? :O I don't recommend you allowing your > users save a VIEW on your server, they can seriously mis-write one and cause > serious performance problems on your server. Instead if ad-hoc is really > something you're looking into, why not give them an MDB w/ Read-only > snapshot views access so they can build their personal queries there. If > you want to keep the entire system in the ADP then I recommend that you take > a look at QBF (Queries by Form) and saving the settings to a .dat or .ini of > some sort, this is the road we're going to take for our system. > > -Francisco > http://rcm.netfirms.com > > On Wednesday, March 12, 2003 7:37 AM [GMT-8], > Susan Zeller wrote: > > : I am building an application as an ADP (Access 2002) and the > : application will be completely locked down to the users. They'll > : enter using an Application Role. > : > : I also want users to be able to do their own ad-hoc querying and > : reporting off of the data in the database. I plan to give them a > : separate ADP file that connects to the SQL Server database. I tried > : giving them Data Writer permissions but that apparently is not enough > : to save a view. I don't want to make them dbo's. I just want them > : to be able to create select views on the data. How do I set up > : permissions for this? > > > _______________________________________________ > 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 Wed Mar 12 10:21:52 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Wed, 12 Mar 2003 10:21:52 -0600 Subject: [dba-SQLServer]Creating views from an adp -- permissions Message-ID: Hmmm.... I'm confused by both Susan's and Francisco's comments. The application I'm building is a student tracking database. The users are constently needing to do different administrative things with students like send out a letter to some subset of students about X or create a list of students for Y. They are good Access users and know how to to write queries and create reports. I don't want them to have to come to me every time they need to send out a letter and I don't want to invest a lot of time in developing a front end tool for this when they are capable of doing it themselves. I hear the concern about them writing bad queries and bogging down the database and I hadn't thought of that. --Susan -----Original Message----- From: Susan Harkins [mailto:harkins at iglou.com] Sent: Wednesday, March 12, 2003 10:01 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Creating views from an adp -- permissions Are you just wanting to save their preferences? I realize this is SQL Server, but Doris and I just put together an article on this for Access. The form itself offers all the "options" and the necessary SQL code that puts them together, and the user can save those settings if they want -- the code behind the form uses the FileSystemObject and a TextStream -- couldn't be simplier. I don't know whether this could be adapted or not. Susan H. ----- Original Message ----- From: "Francisco H Tapia" To: Sent: Wednesday, March 12, 2003 10:56 AM Subject: Re: [dba-SQLServer]Creating views from an adp -- permissions > :O ad-hoc against a SQL Server?!?!? :O I don't recommend you allowing > your users save a VIEW on your server, they can seriously mis-write > one and cause > serious performance problems on your server. Instead if ad-hoc is > really something you're looking into, why not give them an MDB w/ > Read-only snapshot views access so they can build their personal > queries there. If you want to keep the entire system in the ADP then > I recommend that you take > a look at QBF (Queries by Form) and saving the settings to a .dat or > .ini of > some sort, this is the road we're going to take for our system. > > -Francisco > http://rcm.netfirms.com > > On Wednesday, March 12, 2003 7:37 AM [GMT-8], > Susan Zeller wrote: > > : I am building an application as an ADP (Access 2002) and the > : application will be completely locked down to the users. They'll > : enter using an Application Role. > : > : I also want users to be able to do their own ad-hoc querying and > : reporting off of the data in the database. I plan to give them a > : separate ADP file that connects to the SQL Server database. I tried > : giving them Data Writer permissions but that apparently is not > enough > : to save a view. I don't want to make them dbo's. I just want them > : to be able to create select views on the data. How do I set up > : permissions for this? > > > _______________________________________________ > 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 Mar 12 10:37:16 2003 From: harkins at iglou.com (Susan Harkins) Date: Wed, 12 Mar 2003 11:37:16 -0500 Subject: [dba-SQLServer]Creating views from an adp -- permissions References: Message-ID: <015601c2e8b5$c4658f70$0100007f@SusanOne> I guess I misunderstood -- I thought you were wanting to let them create views and then save them for later use. Disregard! ;) Susan H. > Hmmm.... I'm confused by both Susan's and Francisco's comments. The > application I'm building is a student tracking database. The users are > constently needing to do different administrative things with students > like send out a letter to some subset of students about X or create a > list of students for Y. They are good Access users and know how to to > write queries and create reports. I don't want them to have to come to > me every time they need to send out a letter and I don't want to invest > a lot of time in developing a front end tool for this when they are > capable of doing it themselves. I hear the concern about them writing > bad queries and bogging down the database and I hadn't thought of that. > > > --Susan > > > -----Original Message----- > From: Susan Harkins [mailto:harkins at iglou.com] > Sent: Wednesday, March 12, 2003 10:01 AM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer]Creating views from an adp -- permissions > > > Are you just wanting to save their preferences? I realize this is SQL > Server, but Doris and I just put together an article on this for Access. > The form itself offers all the "options" and the necessary SQL code that > puts them together, and the user can save those settings if they want -- > the code behind the form uses the FileSystemObject and a TextStream -- > couldn't be simplier. I don't know whether this could be adapted or not. > > Susan H. > > ----- Original Message ----- > From: "Francisco H Tapia" > To: > Sent: Wednesday, March 12, 2003 10:56 AM > Subject: Re: [dba-SQLServer]Creating views from an adp -- permissions > > > > :O ad-hoc against a SQL Server?!?!? :O I don't recommend you allowing > > your users save a VIEW on your server, they can seriously mis-write > > one and > cause > > serious performance problems on your server. Instead if ad-hoc is > > really something you're looking into, why not give them an MDB w/ > > Read-only snapshot views access so they can build their personal > > queries there. If you want to keep the entire system in the ADP then > > I recommend that you > take > > a look at QBF (Queries by Form) and saving the settings to a .dat or > > .ini > of > > some sort, this is the road we're going to take for our system. > > > > -Francisco > > http://rcm.netfirms.com > > > > On Wednesday, March 12, 2003 7:37 AM [GMT-8], > > Susan Zeller wrote: > > > > : I am building an application as an ADP (Access 2002) and the > > : application will be completely locked down to the users. They'll > > : enter using an Application Role. > > : > > : I also want users to be able to do their own ad-hoc querying and > > : reporting off of the data in the database. I plan to give them a > > : separate ADP file that connects to the SQL Server database. I tried > > : giving them Data Writer permissions but that apparently is not > > enough > > : to save a view. I don't want to make them dbo's. I just want them > > : to be able to create select views on the data. How do I set up > > : permissions for this? > > > > > > _______________________________________________ > > 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 CWortz at tea.state.tx.us Wed Mar 12 10:42:34 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Wed, 12 Mar 2003 10:42:34 -0600 Subject: [dba-SQLServer]Creating views from an adp -- permissions Message-ID: Susan, I think Francisco's suggestion is appropriate for your situation. I have a similar situation where there is one secured FE that links to the SQL Server db for those that need to update the data. And another secured FE that downloads a snapshot of the data into a secured MDB for those that only need to read, query and report on the data. Charles Wortz Software Development Division Texas Education Agency 1701 N. Congress Ave Austin, TX 78701-1494 512-463-9493 CWortz at tea.state.tx.us -----Original Message----- From: Susan Zeller [mailto:szeller at cce.umn.edu] Sent: Wednesday 2003 Mar 12 10:22 To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Creating views from an adp -- permissions Hmmm.... I'm confused by both Susan's and Francisco's comments. The application I'm building is a student tracking database. The users are constently needing to do different administrative things with students like send out a letter to some subset of students about X or create a list of students for Y. They are good Access users and know how to to write queries and create reports. I don't want them to have to come to me every time they need to send out a letter and I don't want to invest a lot of time in developing a front end tool for this when they are capable of doing it themselves. I hear the concern about them writing bad queries and bogging down the database and I hadn't thought of that. --Susan -----Original Message----- From: Susan Harkins [mailto:harkins at iglou.com] Sent: Wednesday, March 12, 2003 10:01 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Creating views from an adp -- permissions Are you just wanting to save their preferences? I realize this is SQL Server, but Doris and I just put together an article on this for Access. The form itself offers all the "options" and the necessary SQL code that puts them together, and the user can save those settings if they want -- the code behind the form uses the FileSystemObject and a TextStream -- couldn't be simplier. I don't know whether this could be adapted or not. Susan H. ----- Original Message ----- From: "Francisco H Tapia" To: Sent: Wednesday, March 12, 2003 10:56 AM Subject: Re: [dba-SQLServer]Creating views from an adp -- permissions > :O ad-hoc against a SQL Server?!?!? :O I don't recommend you allowing > your users save a VIEW on your server, they can seriously mis-write > one and cause > serious performance problems on your server. Instead if ad-hoc is > really something you're looking into, why not give them an MDB w/ > Read-only snapshot views access so they can build their personal > queries there. If you want to keep the entire system in the ADP then > I recommend that you take > a look at QBF (Queries by Form) and saving the settings to a .dat or > .ini of > some sort, this is the road we're going to take for our system. > > -Francisco > http://rcm.netfirms.com From artful at rogers.com Wed Mar 12 12:05:34 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 12 Mar 2003 13:05:34 -0500 Subject: [dba-SQLServer]Creating views from an adp -- permissions In-Reply-To: <002c01c2e8af$e933eb90$b615010a@FHTAPIA> Message-ID: <002601c2e8c1$faa9cf40$8e01a8c0@Rock> I second that emotion. Suppose a user creates the following view: Create View vMyDumbAss AS SELECT * FROM Customers, SalesOrders, SalesDetails, Products With no WHERE or JOIN clauses. The rows returned = Count(Customers.*) * Count(SalesOrders.*) * Count(SalesDetails.*) * Count(Products.*). That's enough to bring almost any server to its knees. Mere mortals saving views? Something is wrong with your conception, methinks. If you must implement this, pull out the resume and freshen it. This is not a place you want to be. Get out before the fit hits the shan. A. -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: March 12, 2003 10:56 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Creating views from an adp -- permissions :O ad-hoc against a SQL Server?!?!? :O I don't recommend you allowing your users save a VIEW on your server, they can seriously mis-write one and cause serious performance problems on your server. Instead if ad-hoc is really something you're looking into, why not give them an MDB w/ Read-only snapshot views access so they can build their personal queries there. If you want to keep the entire system in the ADP then I recommend that you take a look at QBF (Queries by Form) and saving the settings to a .dat or .ini of some sort, this is the road we're going to take for our system. -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 7:37 AM [GMT-8], Susan Zeller wrote: : I am building an application as an ADP (Access 2002) and the : application will be completely locked down to the users. They'll : enter using an Application Role. : : I also want users to be able to do their own ad-hoc querying and : reporting off of the data in the database. I plan to give them a : separate ADP file that connects to the SQL Server database. I tried : giving them Data Writer permissions but that apparently is not enough : to save a view. I don't want to make them dbo's. I just want them : to be able to create select views on the data. How do I set up : permissions for this? _______________________________________________ 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 Wed Mar 12 12:28:49 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Wed, 12 Mar 2003 12:28:49 -0600 Subject: [dba-SQLServer]Not allowing users to create views -- onto an alternative Message-ID: Okay, well the jury's verdict is clear on the issue of letting users create views in my db -- I've lost my marbles. So, now that I've been set back on the right track.... So, I think I'll follow what Charles outlined and create an mdb for them to play around in. Can I create a DTS in SQL Server that will refresh the data I want into the access file? Is that how you go about keeping a fresh copy for your users? Can I execute the DTS from within Access? The users may need to have refreshed data several times a day. --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 Robert.Djabarov at usaa.com Wed Mar 12 12:58:00 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 12 Mar 2003 12:58:00 -0600 Subject: [dba-SQLServer]Not allowing users to create views -- onto an alternative Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABE75@ex02.eagle.usaa.com> Actually, allowing users to create queries in Access against the base tables is as dangerous as allowing them to create views. Why can't you set a rule that users must submit specs to you for desired views and then you create them, using best practices of course? Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Susan Zeller [mailto:szeller at cce.umn.edu] Sent: Wednesday, March 12, 2003 12:29 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Not allowing users to create views -- onto an alternative Okay, well the jury's verdict is clear on the issue of letting users create views in my db -- I've lost my marbles. So, now that I've been set back on the right track.... So, I think I'll follow what Charles outlined and create an mdb for them to play around in. Can I create a DTS in SQL Server that will refresh the data I want into the access file? Is that how you go about keeping a fresh copy for your users? Can I execute the DTS from within Access? The users may need to have refreshed data several times a day. --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 CWortz at tea.state.tx.us Wed Mar 12 13:01:20 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Wed, 12 Mar 2003 13:01:20 -0600 Subject: [dba-SQLServer]Not allowing users to create views -- onto an alternative Message-ID: Susan, It my situation, the app reloads the data whenever it is opened. My users normally only open the app once in the morning and stay in it until quitting time when they close it. Now, when they want to get any updates made since the morning, they close the app and reopen it. I could have put a Refresh button on the main form, but that would have consumed precious screen space for a rarely used feature. Charles Wortz Software Development Division Texas Education Agency 1701 N. Congress Ave Austin, TX 78701-1494 512-463-9493 CWortz at tea.state.tx.us -----Original Message----- From: Susan Zeller [mailto:szeller at cce.umn.edu] Sent: Wednesday 2003 Mar 12 12:29 To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Not allowing users to create views -- onto an alternative Okay, well the jury's verdict is clear on the issue of letting users create views in my db -- I've lost my marbles. So, now that I've been set back on the right track.... So, I think I'll follow what Charles outlined and create an mdb for them to play around in. Can I create a DTS in SQL Server that will refresh the data I want into the access file? Is that how you go about keeping a fresh copy for your users? Can I execute the DTS from within Access? The users may need to have refreshed data several times a day. --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 szeller at cce.umn.edu Wed Mar 12 13:03:29 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Wed, 12 Mar 2003 13:03:29 -0600 Subject: [dba-SQLServer]Not allowing users to create views -- onto an alternative Message-ID: They will be creating queries in access against COPIES of base tables that I'll refresh regularly. They won't be working against the live database at all, at least that's how I understand the suggestion on the table. I don't want them to have to submit specs to me. The nature of the work makes that not a very good option. --Susan -----Original Message----- From: Djabarov, Robert [mailto:Robert.Djabarov at usaa.com] Sent: Wednesday, March 12, 2003 12:58 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Not allowing users to create views -- onto an alternative Actually, allowing users to create queries in Access against the base tables is as dangerous as allowing them to create views. Why can't you set a rule that users must submit specs to you for desired views and then you create them, using best practices of course? Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Susan Zeller [mailto:szeller at cce.umn.edu] Sent: Wednesday, March 12, 2003 12:29 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Not allowing users to create views -- onto an alternative Okay, well the jury's verdict is clear on the issue of letting users create views in my db -- I've lost my marbles. So, now that I've been set back on the right track.... So, I think I'll follow what Charles outlined and create an mdb for them to play around in. Can I create a DTS in SQL Server that will refresh the data I want into the access file? Is that how you go about keeping a fresh copy for your users? Can I execute the DTS from within Access? The users may need to have refreshed data several times a day. --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 my.lists at verizon.net Wed Mar 12 13:17:40 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 12 Mar 2003 11:17:40 -0800 Subject: [dba-SQLServer]Not allowing users to create views -- onto an alternative References: Message-ID: <007501c2e8cc$0d9b7720$b615010a@FHTAPIA> Susan, I think what Robert is saying is that users creating queries against *base* tables could pose a security risk of your database. I suggested getting copies of Views (not tables) so that you could control fields, and amount of data that such queries can look against. -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 11:03 AM [GMT-8], Susan Zeller wrote: : They will be creating queries in access against COPIES of base tables : that I'll refresh regularly. They won't be working against the live : database at all, at least that's how I understand the suggestion on : the table. : : I don't want them to have to submit specs to me. The nature of the : work makes that not a very good option. : : --Susan : : -----Original Message----- : From: Djabarov, Robert [mailto:Robert.Djabarov at usaa.com] : Sent: Wednesday, March 12, 2003 12:58 PM : To: dba-sqlserver at databaseadvisors.com : Subject: RE: [dba-SQLServer]Not allowing users to create views -- onto : an alternative : : : Actually, allowing users to create queries in Access against the base : tables is as dangerous as allowing them to create views. Why can't : you set a rule that users must submit specs to you for desired views : and then you create them, using best practices of course? : : Robert Djabarov : Senior SQL Server DBA : USAA IT/DBMS : ? (210) 913-3148 - phone : ? (210) 753-3148 - pager : : -----Original Message----- : From: Susan Zeller [mailto:szeller at cce.umn.edu] : Sent: Wednesday, March 12, 2003 12:29 PM : To: dba-SQLServer at databaseadvisors.com : Subject: [dba-SQLServer]Not allowing users to create views -- : onto an alternative : : Okay, well the jury's verdict is clear on the issue of letting users : create views in my db -- I've lost my marbles. So, now that I've been : set back on the right track.... : : So, I think I'll follow what Charles outlined and create an mdb for : them to play around in. Can I create a DTS in SQL Server that will : refresh the data I want into the access file? Is that how you go : about keeping a fresh copy for your users? Can I execute the DTS : from within Access? The users may need to have refreshed data several : times a day. : : --Susan : : Susan B. Zeller From davide at dalyn.co.nz Wed Mar 12 14:30:36 2003 From: davide at dalyn.co.nz (David Emerson) Date: Thu, 13 Mar 2003 09:30:36 +1300 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) In-Reply-To: <001201c2e8ad$2f2ade40$b615010a@FHTAPIA> References: <5.2.0.9.0.20030311165505.00bbe308@mail.dalyn.co.nz> Message-ID: <5.2.0.9.0.20030313092441.00bc9b68@mail.dalyn.co.nz> Thanks for your reply. Where do I find the definition reference? At 12/03/2003, you wrote: >The only time I've seen this type of error is when a related record is going >to be deleted. What is the defenition reference for >tblCustInvoiceMeter_FK00? > >-Francisco >http://rcm.netfirms.com > >David Emerson wrote: >: AXP/SQL2K >: >: I have a subform which causes an error message when I delete a record >: from it - >: >: DELETE statement conflicted with COLUMN REFERENCE constraint >: 'tblCustInvoiceMeter_FK00'. >: >: BOL doesn't seem to help. >: >: There are no related records to the one I am deleting. Can anyone >: enlighten me on the problem? >: >: >: Regards > > >_______________________________________________ >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 my.lists at verizon.net Wed Mar 12 15:18:05 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 12 Mar 2003 13:18:05 -0800 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) References: <5.2.0.9.0.20030311165505.00bbe308@mail.dalyn.co.nz> <5.2.0.9.0.20030313092441.00bc9b68@mail.dalyn.co.nz> Message-ID: <00a701c2e8dc$dfd1c130$b615010a@FHTAPIA> In QA, I use this script to find constraints on my tables USE YOURDBNAMEHERE Declare @Var as varchar(100) SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' SELECT constraint_name, column_name, Table_Name, ordinal_position FROM information_schema.key_column_usage WHERE constraint_catalog = db_name() AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + @Var +'%') AND LEFT(CONSTRAINT_NAME,2) = 'FK' ORDER BY constraint_name, ordinal_position -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 12:30 PM [GMT-8], David Emerson wrote: : Thanks for your reply. Where do I find the definition reference? : : At 12/03/2003, you wrote: :: The only time I've seen this type of error is when a related record :: is going to be deleted. What is the defenition reference for :: tblCustInvoiceMeter_FK00? :: :: -Francisco :: http://rcm.netfirms.com :: :: David Emerson wrote: ::: AXP/SQL2K ::: ::: I have a subform which causes an error message when I delete a ::: record from it - ::: ::: DELETE statement conflicted with COLUMN REFERENCE constraint ::: 'tblCustInvoiceMeter_FK00'. ::: ::: BOL doesn't seem to help. ::: ::: There are no related records to the one I am deleting. Can anyone ::: enlighten me on the problem? ::: ::: ::: Regards :: :: :: _______________________________________________ :: 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 : : _______________________________________________ : 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 Mar 12 15:35:30 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 12 Mar 2003 15:35:30 -0600 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABE76@ex02.eagle.usaa.com> sp_fkeys 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, March 12, 2003 3:18 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Deleting record (Column Reference Constraint) In QA, I use this script to find constraints on my tables USE YOURDBNAMEHERE Declare @Var as varchar(100) SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' SELECT constraint_name, column_name, Table_Name, ordinal_position FROM information_schema.key_column_usage WHERE constraint_catalog = db_name() AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + @Var +'%') AND LEFT(CONSTRAINT_NAME,2) = 'FK' ORDER BY constraint_name, ordinal_position -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 12:30 PM [GMT-8], David Emerson wrote: : Thanks for your reply. Where do I find the definition reference? : : At 12/03/2003, you wrote: :: The only time I've seen this type of error is when a related record :: is going to be deleted. What is the defenition reference for :: tblCustInvoiceMeter_FK00? :: :: -Francisco :: http://rcm.netfirms.com :: :: David Emerson wrote: ::: AXP/SQL2K ::: ::: I have a subform which causes an error message when I delete a ::: record from it - ::: ::: DELETE statement conflicted with COLUMN REFERENCE constraint ::: 'tblCustInvoiceMeter_FK00'. ::: ::: BOL doesn't seem to help. ::: ::: There are no related records to the one I am deleting. Can anyone ::: enlighten me on the problem? ::: ::: ::: Regards :: :: :: _______________________________________________ :: 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 : : _______________________________________________ : 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 Mar 12 16:03:43 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 12 Mar 2003 14:03:43 -0800 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) References: <5A31F89EC4C79B49B5030FF2EF58E9D202DABE76@ex02.eagle.usaa.com> Message-ID: <00d501c2e8e3$3fd4dc10$b615010a@FHTAPIA> I don't get back any data with this sp....(on SQL7) but I do get data for the script I'm using.. and it works on both 7 and 2k :S -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 1:35 PM [GMT-8], Djabarov, Robert wrote: : sp_fkeys : : 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, March 12, 2003 3:18 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Deleting record (Column Reference : Constraint) : : In QA, I use this script to find constraints on my tables : : USE YOURDBNAMEHERE : Declare @Var as varchar(100) : SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' : : SELECT constraint_name, : column_name, : Table_Name, : ordinal_position : FROM information_schema.key_column_usage : WHERE constraint_catalog = db_name() : AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + : @Var +'%') : AND LEFT(CONSTRAINT_NAME,2) = 'FK' : ORDER BY constraint_name, ordinal_position : : -Francisco : http://rcm.netfirms.com : : On Wednesday, March 12, 2003 12:30 PM [GMT-8], : David Emerson wrote: : :: Thanks for your reply. Where do I find the definition reference? :: :: At 12/03/2003, you wrote: ::: The only time I've seen this type of error is when a related record ::: is going to be deleted. What is the defenition reference for ::: tblCustInvoiceMeter_FK00? ::: ::: -Francisco ::: http://rcm.netfirms.com ::: ::: David Emerson wrote: :::: AXP/SQL2K :::: :::: I have a subform which causes an error message when I delete a :::: record from it - :::: :::: DELETE statement conflicted with COLUMN REFERENCE constraint :::: 'tblCustInvoiceMeter_FK00'. :::: :::: BOL doesn't seem to help. :::: :::: There are no related records to the one I am deleting. Can anyone :::: enlighten me on the problem? :::: :::: :::: Regards ::: ::: ::: _______________________________________________ ::: 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 :: :: _______________________________________________ :: 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 Mar 12 16:21:53 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 12 Mar 2003 16:21:53 -0600 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABE78@ex02.eagle.usaa.com> Sp_fkeys is available for 6.5, 7.0, and 2K and works in all three versions. 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, March 12, 2003 4:04 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Deleting record (Column Reference Constraint) I don't get back any data with this sp....(on SQL7) but I do get data for the script I'm using.. and it works on both 7 and 2k :S -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 1:35 PM [GMT-8], Djabarov, Robert wrote: : sp_fkeys : : 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, March 12, 2003 3:18 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Deleting record (Column Reference : Constraint) : : In QA, I use this script to find constraints on my tables : : USE YOURDBNAMEHERE : Declare @Var as varchar(100) : SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' : : SELECT constraint_name, : column_name, : Table_Name, : ordinal_position : FROM information_schema.key_column_usage : WHERE constraint_catalog = db_name() : AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + : @Var +'%') : AND LEFT(CONSTRAINT_NAME,2) = 'FK' : ORDER BY constraint_name, ordinal_position : : -Francisco : http://rcm.netfirms.com : : On Wednesday, March 12, 2003 12:30 PM [GMT-8], : David Emerson wrote: : :: Thanks for your reply. Where do I find the definition reference? :: :: At 12/03/2003, you wrote: ::: The only time I've seen this type of error is when a related record ::: is going to be deleted. What is the defenition reference for ::: tblCustInvoiceMeter_FK00? ::: ::: -Francisco ::: http://rcm.netfirms.com ::: ::: David Emerson wrote: :::: AXP/SQL2K :::: :::: I have a subform which causes an error message when I delete a :::: record from it - :::: :::: DELETE statement conflicted with COLUMN REFERENCE constraint :::: 'tblCustInvoiceMeter_FK00'. :::: :::: BOL doesn't seem to help. :::: :::: There are no related records to the one I am deleting. Can anyone :::: enlighten me on the problem? :::: :::: :::: Regards ::: ::: ::: _______________________________________________ ::: 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 :: :: _______________________________________________ :: 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 davide at dalyn.co.nz Wed Mar 12 16:23:03 2003 From: davide at dalyn.co.nz (David Emerson) Date: Thu, 13 Mar 2003 11:23:03 +1300 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) In-Reply-To: <00a701c2e8dc$dfd1c130$b615010a@FHTAPIA> References: <5.2.0.9.0.20030311165505.00bbe308@mail.dalyn.co.nz> <5.2.0.9.0.20030313092441.00bc9b68@mail.dalyn.co.nz> Message-ID: <5.2.0.9.0.20030313111845.023009c0@mail.dalyn.co.nz> When I run this the results grid show 0 rows affected. This matches with the table properties in Access which show no check constraints in the properties window. David At 12/03/2003, you wrote: >In QA, I use this script to find constraints on my tables > >USE YOURDBNAMEHERE >Declare @Var as varchar(100) >SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' > >SELECT constraint_name, > column_name, > Table_Name, > ordinal_position >FROM information_schema.key_column_usage >WHERE constraint_catalog = db_name() > AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + @Var >+'%') > AND LEFT(CONSTRAINT_NAME,2) = 'FK' >ORDER BY constraint_name, ordinal_position > >-Francisco >http://rcm.netfirms.com > >On Wednesday, March 12, 2003 12:30 PM [GMT-8], >David Emerson wrote: > >: Thanks for your reply. Where do I find the definition reference? >: >: At 12/03/2003, you wrote: >:: The only time I've seen this type of error is when a related record >:: is going to be deleted. What is the defenition reference for >:: tblCustInvoiceMeter_FK00? >:: >:: -Francisco >:: http://rcm.netfirms.com >:: >:: David Emerson wrote: >::: AXP/SQL2K >::: >::: I have a subform which causes an error message when I delete a >::: record from it - >::: >::: DELETE statement conflicted with COLUMN REFERENCE constraint >::: 'tblCustInvoiceMeter_FK00'. >::: >::: BOL doesn't seem to help. >::: >::: There are no related records to the one I am deleting. Can anyone >::: enlighten me on the problem? >::: >::: >::: Regards >:: >:: >:: _______________________________________________ >:: 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 >: >: _______________________________________________ >: 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 my.lists at verizon.net Wed Mar 12 16:41:30 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 12 Mar 2003 14:41:30 -0800 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) References: <5A31F89EC4C79B49B5030FF2EF58E9D202DABE78@ex02.eagle.usaa.com> Message-ID: <00df01c2e8e8$86f75cd0$b615010a@FHTAPIA> is this the right syntax?, or should I use the EXEC before it? sp_fkeys @fktable_name = 'tbl_ccStatus' Simple but I still like my script better as I don't have to give it an @pktable_name, just a single table name and it goes out and finds all related FK's for it.. -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 2:21 PM [GMT-8], Djabarov, Robert wrote: : Sp_fkeys is available for 6.5, 7.0, and 2K and works in all three : versions. : : 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, March 12, 2003 4:04 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Deleting record (Column Reference : Constraint) : : I don't get back any data with this sp....(on SQL7) but I do get data : for the script I'm using.. and it works on both 7 and 2k :S : : -Francisco : http://rcm.netfirms.com : : On Wednesday, March 12, 2003 1:35 PM [GMT-8], : Djabarov, Robert wrote: : :: sp_fkeys :: :: 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, March 12, 2003 3:18 PM :: To: dba-sqlserver at databaseadvisors.com :: Subject: Re: [dba-SQLServer]Deleting record (Column Reference :: Constraint) :: :: In QA, I use this script to find constraints on my tables :: :: USE YOURDBNAMEHERE :: Declare @Var as varchar(100) :: SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' :: :: SELECT constraint_name, :: column_name, :: Table_Name, :: ordinal_position :: FROM information_schema.key_column_usage :: WHERE constraint_catalog = db_name() :: AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + :: @Var +'%') :: AND LEFT(CONSTRAINT_NAME,2) = 'FK' :: ORDER BY constraint_name, ordinal_position :: :: -Francisco :: http://rcm.netfirms.com :: :: On Wednesday, March 12, 2003 12:30 PM [GMT-8], :: David Emerson wrote: :: ::: Thanks for your reply. Where do I find the definition reference? ::: ::: At 12/03/2003, you wrote: :::: The only time I've seen this type of error is when a related record :::: is going to be deleted. What is the defenition reference for :::: tblCustInvoiceMeter_FK00? :::: :::: -Francisco :::: http://rcm.netfirms.com :::: :::: David Emerson wrote: ::::: AXP/SQL2K ::::: ::::: I have a subform which causes an error message when I delete a ::::: record from it - ::::: ::::: DELETE statement conflicted with COLUMN REFERENCE constraint ::::: 'tblCustInvoiceMeter_FK00'. ::::: ::::: BOL doesn't seem to help. ::::: ::::: There are no related records to the one I am deleting. Can anyone ::::: enlighten me on the problem? ::::: ::::: ::::: Regards :::: :::: :::: _______________________________________________ :::: 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 ::: ::: _______________________________________________ ::: dba-SQLServer mailing list ::: dba-SQLServer at databaseadvisors.com ::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver ::: http://www.databaseadvisors.com :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com :: :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From Robert.Djabarov at usaa.com Wed Mar 12 16:46:21 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 12 Mar 2003 16:46:21 -0600 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABE79@ex02.eagle.usaa.com> Sp_fkeys authors will return PK and FK information on authors 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, March 12, 2003 4:42 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Deleting record (Column Reference Constraint) is this the right syntax?, or should I use the EXEC before it? sp_fkeys @fktable_name = 'tbl_ccStatus' Simple but I still like my script better as I don't have to give it an @pktable_name, just a single table name and it goes out and finds all related FK's for it.. -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 2:21 PM [GMT-8], Djabarov, Robert wrote: : Sp_fkeys is available for 6.5, 7.0, and 2K and works in all three : versions. : : 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, March 12, 2003 4:04 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Deleting record (Column Reference : Constraint) : : I don't get back any data with this sp....(on SQL7) but I do get data : for the script I'm using.. and it works on both 7 and 2k :S : : -Francisco : http://rcm.netfirms.com : : On Wednesday, March 12, 2003 1:35 PM [GMT-8], : Djabarov, Robert wrote: : :: sp_fkeys :: :: 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, March 12, 2003 3:18 PM :: To: dba-sqlserver at databaseadvisors.com :: Subject: Re: [dba-SQLServer]Deleting record (Column Reference :: Constraint) :: :: In QA, I use this script to find constraints on my tables :: :: USE YOURDBNAMEHERE :: Declare @Var as varchar(100) :: SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' :: :: SELECT constraint_name, :: column_name, :: Table_Name, :: ordinal_position :: FROM information_schema.key_column_usage :: WHERE constraint_catalog = db_name() :: AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + :: @Var +'%') :: AND LEFT(CONSTRAINT_NAME,2) = 'FK' :: ORDER BY constraint_name, ordinal_position :: :: -Francisco :: http://rcm.netfirms.com :: :: On Wednesday, March 12, 2003 12:30 PM [GMT-8], :: David Emerson wrote: :: ::: Thanks for your reply. Where do I find the definition reference? ::: ::: At 12/03/2003, you wrote: :::: The only time I've seen this type of error is when a related record :::: is going to be deleted. What is the defenition reference for :::: tblCustInvoiceMeter_FK00? :::: :::: -Francisco :::: http://rcm.netfirms.com :::: :::: David Emerson wrote: ::::: AXP/SQL2K ::::: ::::: I have a subform which causes an error message when I delete a ::::: record from it - ::::: ::::: DELETE statement conflicted with COLUMN REFERENCE constraint ::::: 'tblCustInvoiceMeter_FK00'. ::::: ::::: BOL doesn't seem to help. ::::: ::::: There are no related records to the one I am deleting. Can anyone ::::: enlighten me on the problem? ::::: ::::: ::::: Regards :::: :::: :::: _______________________________________________ :::: 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 ::: ::: _______________________________________________ ::: dba-SQLServer mailing list ::: dba-SQLServer at databaseadvisors.com ::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver ::: http://www.databaseadvisors.com :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com :: :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Robert.Djabarov at usaa.com Wed Mar 12 16:55:46 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 12 Mar 2003 16:55:46 -0600 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBE1@ex02.eagle.usaa.com> ...besides, in your script you assume that FK name will contain the name of the table, which may not necessarily be true. 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, March 12, 2003 4:42 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Deleting record (Column Reference Constraint) is this the right syntax?, or should I use the EXEC before it? sp_fkeys @fktable_name = 'tbl_ccStatus' Simple but I still like my script better as I don't have to give it an @pktable_name, just a single table name and it goes out and finds all related FK's for it.. -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 2:21 PM [GMT-8], Djabarov, Robert wrote: : Sp_fkeys is available for 6.5, 7.0, and 2K and works in all three : versions. : : 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, March 12, 2003 4:04 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Deleting record (Column Reference : Constraint) : : I don't get back any data with this sp....(on SQL7) but I do get data : for the script I'm using.. and it works on both 7 and 2k :S : : -Francisco : http://rcm.netfirms.com : : On Wednesday, March 12, 2003 1:35 PM [GMT-8], : Djabarov, Robert wrote: : :: sp_fkeys :: :: 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, March 12, 2003 3:18 PM :: To: dba-sqlserver at databaseadvisors.com :: Subject: Re: [dba-SQLServer]Deleting record (Column Reference :: Constraint) :: :: In QA, I use this script to find constraints on my tables :: :: USE YOURDBNAMEHERE :: Declare @Var as varchar(100) :: SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' :: :: SELECT constraint_name, :: column_name, :: Table_Name, :: ordinal_position :: FROM information_schema.key_column_usage :: WHERE constraint_catalog = db_name() :: AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + :: @Var +'%') :: AND LEFT(CONSTRAINT_NAME,2) = 'FK' :: ORDER BY constraint_name, ordinal_position :: :: -Francisco :: http://rcm.netfirms.com :: :: On Wednesday, March 12, 2003 12:30 PM [GMT-8], :: David Emerson wrote: :: ::: Thanks for your reply. Where do I find the definition reference? ::: ::: At 12/03/2003, you wrote: :::: The only time I've seen this type of error is when a related record :::: is going to be deleted. What is the defenition reference for :::: tblCustInvoiceMeter_FK00? :::: :::: -Francisco :::: http://rcm.netfirms.com :::: :::: David Emerson wrote: ::::: AXP/SQL2K ::::: ::::: I have a subform which causes an error message when I delete a ::::: record from it - ::::: ::::: DELETE statement conflicted with COLUMN REFERENCE constraint ::::: 'tblCustInvoiceMeter_FK00'. ::::: ::::: BOL doesn't seem to help. ::::: ::::: There are no related records to the one I am deleting. Can anyone ::::: enlighten me on the problem? ::::: ::::: ::::: Regards :::: :::: :::: _______________________________________________ :::: 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 ::: ::: _______________________________________________ ::: dba-SQLServer mailing list ::: dba-SQLServer at databaseadvisors.com ::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver ::: http://www.databaseadvisors.com :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com :: :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From my.lists at verizon.net Wed Mar 12 17:56:59 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 12 Mar 2003 15:56:59 -0800 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) References: <5A31F89EC4C79B49B5030FF2EF58E9D202DABE79@ex02.eagle.usaa.com> Message-ID: <010701c2e8f3$12cbd380$b615010a@FHTAPIA> Did not know that... because if I run it as sp_fkeys @fktable_name = 'tbl_ccStatus' It is using the @fktable_name variable. it is implying by definition (@fktable) that only the Fk are to be brought over and that the table defined is the FK table, whereas if I run it as sp_fkeys tbl_ccStatus I then get nothing back... just my 2 cents. I like the shorter syntax... and I'm going to keep working with it to maximize it's use but I haven't chewed through that chapter in BOL yet. -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 2:46 PM [GMT-8], Djabarov, Robert wrote: : Sp_fkeys authors : will return PK and FK information on authors : : Robert Djabarov : : -----Original Message----- : From: Francisco H Tapia [mailto:my.lists at verizon.net] : Sent: Wednesday, March 12, 2003 4:42 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Deleting record (Column Reference : Constraint) : : is this the right syntax?, or should I use the EXEC before it? : : sp_fkeys @fktable_name = 'tbl_ccStatus' : : Simple but I still like my script better as I don't have to give it an : @pktable_name, just a single table name and it goes out and finds all : related FK's for it.. : : : : -Francisco : http://rcm.netfirms.com : : On Wednesday, March 12, 2003 2:21 PM [GMT-8], : Djabarov, Robert wrote: : :: Sp_fkeys is available for 6.5, 7.0, and 2K and works in all three :: versions. :: :: 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, March 12, 2003 4:04 PM :: To: dba-sqlserver at databaseadvisors.com :: Subject: Re: [dba-SQLServer]Deleting record (Column Reference :: Constraint) :: :: I don't get back any data with this sp....(on SQL7) but I do get data :: for the script I'm using.. and it works on both 7 and 2k :S :: :: -Francisco :: http://rcm.netfirms.com :: :: On Wednesday, March 12, 2003 1:35 PM [GMT-8], :: Djabarov, Robert wrote: :: ::: sp_fkeys ::: ::: 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, March 12, 2003 3:18 PM ::: To: dba-sqlserver at databaseadvisors.com ::: Subject: Re: [dba-SQLServer]Deleting record (Column Reference ::: Constraint) ::: ::: In QA, I use this script to find constraints on my tables ::: ::: USE YOURDBNAMEHERE ::: Declare @Var as varchar(100) ::: SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' ::: ::: SELECT constraint_name, ::: column_name, ::: Table_Name, ::: ordinal_position ::: FROM information_schema.key_column_usage ::: WHERE constraint_catalog = db_name() ::: AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' ::: + @Var +'%') ::: AND LEFT(CONSTRAINT_NAME,2) = 'FK' ::: ORDER BY constraint_name, ordinal_position ::: ::: -Francisco ::: http://rcm.netfirms.com ::: ::: On Wednesday, March 12, 2003 12:30 PM [GMT-8], ::: David Emerson wrote: ::: :::: Thanks for your reply. Where do I find the definition reference? :::: :::: At 12/03/2003, you wrote: ::::: The only time I've seen this type of error is when a related ::::: record is going to be deleted. What is the defenition reference ::::: for tblCustInvoiceMeter_FK00? ::::: ::::: -Francisco ::::: http://rcm.netfirms.com ::::: ::::: David Emerson wrote: :::::: AXP/SQL2K :::::: :::::: I have a subform which causes an error message when I delete a :::::: record from it - :::::: :::::: DELETE statement conflicted with COLUMN REFERENCE constraint :::::: 'tblCustInvoiceMeter_FK00'. :::::: :::::: BOL doesn't seem to help. :::::: :::::: There are no related records to the one I am deleting. Can :::::: anyone enlighten me on the problem? :::::: :::::: :::::: Regards ::::: ::::: ::::: _______________________________________________ ::::: 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 :::: :::: _______________________________________________ :::: dba-SQLServer mailing list :::: dba-SQLServer at databaseadvisors.com :::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :::: http://www.databaseadvisors.com ::: ::: ::: _______________________________________________ ::: dba-SQLServer mailing list ::: dba-SQLServer at databaseadvisors.com ::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver ::: http://www.databaseadvisors.com ::: ::: ::: ::: _______________________________________________ ::: dba-SQLServer mailing list ::: dba-SQLServer at databaseadvisors.com ::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver ::: http://www.databaseadvisors.com :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com :: :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From my.lists at verizon.net Wed Mar 12 17:57:47 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 12 Mar 2003 15:57:47 -0800 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) References: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBE1@ex02.eagle.usaa.com> Message-ID: <011101c2e8f3$2f59b3a0$b615010a@FHTAPIA> true, but I don't rename my constraints to other names, I much rather leave them like the system (EM) creates them. This way I can tell by reading the name which tables I'm joining. -Francisco http://rcm.netfirms.com On Wednesday, March 12, 2003 2:55 PM [GMT-8], Djabarov, Robert wrote: : ...besides, in your script you assume that FK name will contain the : name of the table, which may not necessarily be true. : : 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, March 12, 2003 4:42 PM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Deleting record (Column Reference : Constraint) : : is this the right syntax?, or should I use the EXEC before it? : : sp_fkeys @fktable_name = 'tbl_ccStatus' : : Simple but I still like my script better as I don't have to give it an : @pktable_name, just a single table name and it goes out and finds all : related FK's for it.. : : : : -Francisco : http://rcm.netfirms.com : : On Wednesday, March 12, 2003 2:21 PM [GMT-8], : Djabarov, Robert wrote: : :: Sp_fkeys is available for 6.5, 7.0, and 2K and works in all three :: versions. :: :: 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, March 12, 2003 4:04 PM :: To: dba-sqlserver at databaseadvisors.com :: Subject: Re: [dba-SQLServer]Deleting record (Column Reference :: Constraint) :: :: I don't get back any data with this sp....(on SQL7) but I do get data :: for the script I'm using.. and it works on both 7 and 2k :S :: :: -Francisco :: http://rcm.netfirms.com :: :: On Wednesday, March 12, 2003 1:35 PM [GMT-8], :: Djabarov, Robert wrote: :: ::: sp_fkeys ::: ::: 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, March 12, 2003 3:18 PM ::: To: dba-sqlserver at databaseadvisors.com ::: Subject: Re: [dba-SQLServer]Deleting record (Column Reference ::: Constraint) ::: ::: In QA, I use this script to find constraints on my tables ::: ::: USE YOURDBNAMEHERE ::: Declare @Var as varchar(100) ::: SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' ::: ::: SELECT constraint_name, ::: column_name, ::: Table_Name, ::: ordinal_position ::: FROM information_schema.key_column_usage ::: WHERE constraint_catalog = db_name() ::: AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' ::: + @Var +'%') ::: AND LEFT(CONSTRAINT_NAME,2) = 'FK' ::: ORDER BY constraint_name, ordinal_position ::: ::: -Francisco ::: http://rcm.netfirms.com ::: ::: On Wednesday, March 12, 2003 12:30 PM [GMT-8], ::: David Emerson wrote: ::: :::: Thanks for your reply. Where do I find the definition reference? :::: :::: At 12/03/2003, you wrote: ::::: The only time I've seen this type of error is when a related ::::: record ::::: is going to be deleted. What is the defenition reference for ::::: tblCustInvoiceMeter_FK00? ::::: ::::: -Francisco ::::: http://rcm.netfirms.com ::::: ::::: David Emerson wrote: :::::: AXP/SQL2K :::::: :::::: I have a subform which causes an error message when I delete a :::::: record from it - :::::: :::::: DELETE statement conflicted with COLUMN REFERENCE constraint :::::: 'tblCustInvoiceMeter_FK00'. :::::: :::::: BOL doesn't seem to help. :::::: :::::: There are no related records to the one I am deleting. Can :::::: anyone :::::: enlighten me on the problem? :::::: :::::: :::::: Regards ::::: ::::: ::::: _______________________________________________ ::::: 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 :::: :::: _______________________________________________ :::: dba-SQLServer mailing list :::: dba-SQLServer at databaseadvisors.com :::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :::: http://www.databaseadvisors.com ::: ::: ::: _______________________________________________ ::: dba-SQLServer mailing list ::: dba-SQLServer at databaseadvisors.com ::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver ::: http://www.databaseadvisors.com ::: ::: ::: ::: _______________________________________________ ::: dba-SQLServer mailing list ::: dba-SQLServer at databaseadvisors.com ::: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver ::: http://www.databaseadvisors.com :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com :: :: :: :: _______________________________________________ :: dba-SQLServer mailing list :: dba-SQLServer at databaseadvisors.com :: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver :: http://www.databaseadvisors.com : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com : : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From tuxedo_man at hotmail.com Thu Mar 13 12:45:55 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Thu, 13 Mar 2003 18:45:55 +0000 Subject: [dba-SQLServer]Removing the BUILTIN\Administrators Login Message-ID: In the SS2K, has anybody removed the BUILTIN\Administrators Login? Does anyone recommended? Does anyone recommended against it? _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From MarkBoyd at McBeeAssociates.com Fri Mar 14 09:48:47 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Fri, 14 Mar 2003 10:48:47 -0500 Subject: [dba-SQLServer]Cannot connect to repository Message-ID: <42DE35C7D61279419C166543CD42F405EDA7@mail2k.mcbassoc.com> I am using Analysis Services with SQL2000. When attempting to connect to a registered server, I receive the message: "Cannot connect to repository. Error: Disk or network error". All service packs have been updated. Has anyone experienced this error? TIA, Mark Boyd Sr. Systems Analyst McBee Associates, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From my.lists at verizon.net Fri Mar 14 10:37:32 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Fri, 14 Mar 2003 08:37:32 -0800 Subject: [dba-SQLServer]Cannot connect to repository References: <657FB70438B7D311AF320090279C180103C5E48C@EXCHMAIL> Message-ID: <002d01c2ea48$03a33e10$b615010a@FHTAPIA> I've never used Analysis Services (yet) but just a wag, Did you double check that the service is running?, I am guessing that it can use either NT authentication or SQL authentication, What method are you using and have you tried the other as a check? -Francisco http://rcm.netfirms.com On Friday, March 14, 2003 7:48 AM [GMT-8], Mark Boyd wrote: : I am using Analysis Services with SQL2000. : : When attempting to connect to a registered server, I receive the : message: "Cannot connect to repository. Error: Disk or network : error". : : All service packs have been updated. : : Has anyone experienced this error? : : : : TIA, : : Mark Boyd From MarkBoyd at McBeeAssociates.com Fri Mar 14 10:47:37 2003 From: MarkBoyd at McBeeAssociates.com (Mark Boyd) Date: Fri, 14 Mar 2003 11:47:37 -0500 Subject: [dba-SQLServer]Cannot connect to repository Message-ID: <42DE35C7D61279419C166543CD42F405EDA8@mail2k.mcbassoc.com> Francisco - Thanks for the reply. I believe we found a solution. If you right-click on the registered server and click 'Edit Repository Connection String', you can manipulate the repository mdb location. We had to change these strings to point in the correct location. Mark -----Original Message----- From: Francisco H Tapia [mailto:my.lists at verizon.net] Sent: Friday, March 14, 2003 11:38 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Cannot connect to repository I've never used Analysis Services (yet) but just a wag, Did you double check that the service is running?, I am guessing that it can use either NT authentication or SQL authentication, What method are you using and have you tried the other as a check? -Francisco http://rcm.netfirms.com On Friday, March 14, 2003 7:48 AM [GMT-8], Mark Boyd wrote: : I am using Analysis Services with SQL2000. : : When attempting to connect to a registered server, I receive the : message: "Cannot connect to repository. Error: Disk or network : error". : : All service packs have been updated. : : Has anyone experienced this error? : : : : TIA, : : Mark Boyd _______________________________________________ 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 Mar 14 11:17:58 2003 From: artful at rogers.com (Arthur Fuller) Date: Fri, 14 Mar 2003 12:17:58 -0500 Subject: [dba-SQLServer]SQL-DMO question In-Reply-To: <42DE35C7D61279419C166543CD42F405EDA8@mail2k.mcbassoc.com> Message-ID: <008201c2ea4d$a8aa0010$8e01a8c0@Rock> I have to provide a no-brainer solution to the following problem. The user will receive a CD containing a backup of the network database, a snapshot of some point in time. This backup must be restored to a new database, whose names indicates the snapshot date. It's possible though unlikely that said database already exists (i.e. dumb-ass user modified some data, changed his mind, and now wants to restore the original). EM will not be installed, only MSDE on (local). MSDE is guaranteed to be installed and running. I'm looking at the sample SQL-DMO vb project called BackRestEvents, trying to glean ideas from it. So far I have SQL-DMO code that successfully opens a connection to (local) or any other available server. The vb sample app has two problems: 1. Unlike EM, it bitches when you type in a new database name. Within EM, you can select any database, choose Restore, and enter a new database name, resulting in a copy of some existing database. 2. The code supplied doesn't deal with the possibility that the db already exists. You get a message saying that you should use the "force restore" argument(s) to achieve this. I'm new to the Restore object (and in fact to this whole hierarchy). Can you tell me how to code these arguments to force restore if the db exists? Advice, URLs, etc. gratefully appreciated. TIA, Arthur From my.lists at verizon.net Fri Mar 14 11:58:59 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Fri, 14 Mar 2003 09:58:59 -0800 Subject: [dba-SQLServer]SQL-DMO question References: <008201c2ea4d$a8aa0010$8e01a8c0@Rock> Message-ID: <007701c2ea53$64358750$b615010a@FHTAPIA> Arthur, Check BOL under the RESTORE keyword... I think you should be able to use this command in conjuction to SQL-DMO or the Command Object from ADO. Sample: RESTORE Restores backups taken using the BACKUP command. For more information about database back up and restore operations, see Backing Up and Restoring Databases. Syntax Restore an entire database: RESTORE DATABASE { database_name | @database_name_var } [ FROM < backup_device > [ ,...n ] ] [ WITH [ RESTRICTED_USER ] [ [ , ] FILE = { file_number | @file_number } ] [ [ , ] PASSWORD = { password | @password_variable } ] [ [ , ] MEDIANAME = { media_name | @media_name_variable } ] [ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ] [ [ , ] MOVE 'logical_file_name' TO 'operating_system_file_name' ] [ ,...n ] [ [ , ] KEEP_REPLICATION ] [ [ , ] { NORECOVERY | RECOVERY | STANDBY = {undo_file_name|@undo_file_name_var} } ] [ [ , ] { NOREWIND | REWIND } ] [ [ , ] { NOUNLOAD | UNLOAD } ] [ [ , ] REPLACE ] [ [ , ] RESTART ] [ [ , ] STATS [ = percentage ] ] ] -Francisco http://rcm.netfirms.com On Friday, March 14, 2003 9:17 AM [GMT-8], Arthur Fuller wrote: : I have to provide a no-brainer solution to the following problem. The : user will receive a CD containing a backup of the network database, a : snapshot of some point in time. This backup must be restored to a new : database, whose names indicates the snapshot date. It's possible : though unlikely that said database already exists (i.e. dumb-ass user : modified some data, changed his mind, and now wants to restore the : original). EM will not be installed, only MSDE on (local). MSDE is : guaranteed to be installed and running. : : I'm looking at the sample SQL-DMO vb project called BackRestEvents, : trying to glean ideas from it. So far I have SQL-DMO code that : successfully opens a connection to (local) or any other available : server. The vb sample app has two problems: : : 1. Unlike EM, it bitches when you type in a new database name. Within : EM, you can select any database, choose Restore, and enter a new : database name, resulting in a copy of some existing database. : : 2. The code supplied doesn't deal with the possibility that the db : already exists. You get a message saying that you should use the : "force restore" argument(s) to achieve this. I'm new to the Restore : object (and in fact to this whole hierarchy). Can you tell me how to : code these arguments to force restore if the db exists? : : Advice, URLs, etc. gratefully appreciated. : : TIA, : Arthur : : _______________________________________________ : 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 Mar 14 12:07:49 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Fri, 14 Mar 2003 10:07:49 -0800 Subject: [dba-SQLServer]SQL-DMO question References: <008201c2ea4d$a8aa0010$8e01a8c0@Rock> Message-ID: <007b01c2ea54$a02b7430$b615010a@FHTAPIA> For better tips on managing SQL-DMO, why not observer the source code for the dbaMGR, alternative EM manager that can be used w/MSDE http://www.asql.biz/DbaMgr.shtm -Francisco http://rcm.netfirms.com On Friday, March 14, 2003 9:17 AM [GMT-8], Arthur Fuller wrote: : I have to provide a no-brainer solution to the following problem. The : user will receive a CD containing a backup of the network database, a : snapshot of some point in time. This backup must be restored to a new : database, whose names indicates the snapshot date. It's possible : though unlikely that said database already exists (i.e. dumb-ass user : modified some data, changed his mind, and now wants to restore the : original). EM will not be installed, only MSDE on (local). MSDE is : guaranteed to be installed and running. : : I'm looking at the sample SQL-DMO vb project called BackRestEvents, : trying to glean ideas from it. So far I have SQL-DMO code that : successfully opens a connection to (local) or any other available : server. The vb sample app has two problems: : : 1. Unlike EM, it bitches when you type in a new database name. Within : EM, you can select any database, choose Restore, and enter a new : database name, resulting in a copy of some existing database. : : 2. The code supplied doesn't deal with the possibility that the db : already exists. You get a message saying that you should use the : "force restore" argument(s) to achieve this. I'm new to the Restore : object (and in fact to this whole hierarchy). Can you tell me how to : code these arguments to force restore if the db exists? : : Advice, URLs, etc. gratefully appreciated. : : TIA, : Arthur : : _______________________________________________ : 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 Sun Mar 16 11:37:19 2003 From: harkins at iglou.com (Susan Harkins) Date: Sun, 16 Mar 2003 12:37:19 -0500 Subject: [dba-SQLServer]opinions Message-ID: <002c01c2ebe2$c85fc110$ece6ffcc@SusanOne> I'd like some opinions on using an Insert Trigger to insert a GUID value to a new record. Good idea or bad? Susan H. From harkins at iglou.com Sun Mar 16 11:39:13 2003 From: harkins at iglou.com (Susan Harkins) Date: Sun, 16 Mar 2003 12:39:13 -0500 Subject: [dba-SQLServer]Northwind Message-ID: <003201c2ebe2$f76590c0$ece6ffcc@SusanOne> Northwind shows up on my list of SQL Server sample databases -- I also have Access and MSDE installed on the same system. Is this really a SQL Server database or is it the MSDE sample database? I'm guessing the latter. Susan H. From artful at rogers.com Sun Mar 16 12:13:32 2003 From: artful at rogers.com (Arthur Fuller) Date: Sun, 16 Mar 2003 13:13:32 -0500 Subject: [dba-SQLServer]opinions In-Reply-To: <002c01c2ebe2$c85fc110$ece6ffcc@SusanOne> Message-ID: <012101c2ebe7$c0dbacb0$8e01a8c0@Rock> I'm not sure why you would want to do this, Susan, but assuming that you want to, a trigger would do it. Do something like this in your trigger (caution: written in Outlook :-). DECLARE @myGUID as GUID SET @myGUID = NewID() -- do something with the new GUID ... Since you could export this logic to the db rather than contain it in the FE, I'm not sure why you'd want to do it. This comes from a perspective which says, "Anything MS will do for me free is code I don't have to write." IOW I'd create a default value for the column (=NewID()) and be done with it. The Front End would receive the new value just like an ANPK, so why bother writing code to create it? A. -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins Sent: March 16, 2003 12:37 PM To: SQLList Subject: [dba-SQLServer]opinions I'd like some opinions on using an Insert Trigger to insert a GUID value to a new record. Good idea or bad? Susan H. _______________________________________________ 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 Sun Mar 16 12:14:57 2003 From: artful at rogers.com (Arthur Fuller) Date: Sun, 16 Mar 2003 13:14:57 -0500 Subject: [dba-SQLServer]Northwind In-Reply-To: <003201c2ebe2$f76590c0$ece6ffcc@SusanOne> Message-ID: <012201c2ebe7$f3774d50$8e01a8c0@Rock> Northwind is installed (with pubs) in any MSDE or SQL 2000 instance. You will also find a NorthwindCS.adp (IIRC) that connects to the Northwind database. -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins Sent: March 16, 2003 12:39 PM To: SQLList Subject: [dba-SQLServer]Northwind Northwind shows up on my list of SQL Server sample databases -- I also have Access and MSDE installed on the same system. Is this really a SQL Server database or is it the MSDE sample database? I'm guessing the latter. Susan H. _______________________________________________ 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 Sun Mar 16 12:39:13 2003 From: harkins at iglou.com (Susan Harkins) Date: Sun, 16 Mar 2003 13:39:13 -0500 Subject: [dba-SQLServer]opinions References: <012101c2ebe7$c0dbacb0$8e01a8c0@Rock> Message-ID: <007a01c2ebeb$726dde00$ece6ffcc@SusanOne> The Front End would receive the new value just like an ANPK, so why > bother writing code to create it? ==========I don't want to, but a publisher wants to. :) Susan H. From harkins at iglou.com Sun Mar 16 12:39:56 2003 From: harkins at iglou.com (Susan Harkins) Date: Sun, 16 Mar 2003 13:39:56 -0500 Subject: [dba-SQLServer]Northwind References: <012201c2ebe7$f3774d50$8e01a8c0@Rock> Message-ID: <007b01c2ebeb$733d6300$ece6ffcc@SusanOne> I did notice that I actually have two Northwid databases showing up -- so I figured that was it. Thanks Arthur. Susan H. > Northwind is installed (with pubs) in any MSDE or SQL 2000 instance. You > will also find a NorthwindCS.adp (IIRC) that connects to the Northwind > database. > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins > Sent: March 16, 2003 12:39 PM > To: SQLList > Subject: [dba-SQLServer]Northwind > > > Northwind shows up on my list of SQL Server sample databases -- I also have > Access and MSDE installed on the same system. Is this really a SQL Server > database or is it the MSDE sample database? I'm guessing the latter. > > Susan H. > > _______________________________________________ > 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 j.frederick at att.net Sun Mar 16 14:56:50 2003 From: j.frederick at att.net (John Frederick) Date: Sun, 16 Mar 2003 15:56:50 -0500 Subject: [dba-SQLServer]Northwind In-Reply-To: <007b01c2ebeb$733d6300$ece6ffcc@SusanOne> Message-ID: The SQL Server versions will have file names Northwnd.mdf and pubs.mdf. The default location on my installation is c:\MSSQL7\Data\ (yes, for SQL 2000, they use directory MSSQL7). Enterprise Manager will see them. For Access, the files are Northwind.mdb and pubs.mdb. The default directory in down in the Office tree. -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Susan Harkins Sent: Sunday, March 16, 2003 1:40 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Northwind I did notice that I actually have two Northwid databases showing up -- so I figured that was it. Thanks Arthur. Susan H. > Northwind is installed (with pubs) in any MSDE or SQL 2000 instance. You > will also find a NorthwindCS.adp (IIRC) that connects to the Northwind > database. > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins > Sent: March 16, 2003 12:39 PM > To: SQLList > Subject: [dba-SQLServer]Northwind > > > Northwind shows up on my list of SQL Server sample databases -- I also have > Access and MSDE installed on the same system. Is this really a SQL Server > database or is it the MSDE sample database? I'm guessing the latter. > > Susan H. > > _______________________________________________ > 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 harkins at iglou.com Sun Mar 16 16:12:05 2003 From: harkins at iglou.com (Susan Harkins) Date: Sun, 16 Mar 2003 17:12:05 -0500 Subject: [dba-SQLServer]opinions References: <012101c2ebe7$c0dbacb0$8e01a8c0@Rock> Message-ID: <01a601c2ec09$3082e260$ece6ffcc@SusanOne> I should just go to bed before I do any real damage. Although, I did sleep well last night in NyQuil la la land. :) I did say insert, but that isn't what I meant. Basically, I'm just trying to return the new identity value after saving a new record. The publisher seems to think that an INSERT TRIGGER could be used to grab a new record's GUID, since @@Identity or SCOPE_IDENTIY can't. But I don't think it's programmatically sound. I can return the values using other methods -- I was just wondering if anyone had used INSERT TRIGGER for this purpose. Susan H. ----- Original Message ----- From: "Arthur Fuller" To: Sent: Sunday, March 16, 2003 1:13 PM Subject: RE: [dba-SQLServer]opinions > I'm not sure why you would want to do this, Susan, but assuming that you > want to, a trigger would do it. Do something like this in your trigger > (caution: written in Outlook :-). > > DECLARE @myGUID as GUID > SET @myGUID = NewID() > -- do something with the new GUID > ... > > Since you could export this logic to the db rather than contain it in the > FE, I'm not sure why you'd want to do it. This comes from a perspective > which says, "Anything MS will do for me free is code I don't have to write." > IOW I'd create a default value for the column (=NewID()) and be done with > it. The Front End would receive the new value just like an ANPK, so why > bother writing code to create it? > > A. > > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins > Sent: March 16, 2003 12:37 PM > To: SQLList > Subject: [dba-SQLServer]opinions > > > I'd like some opinions on using an Insert Trigger to insert a GUID value to > a new record. Good idea or bad? > > Susan H. > > > _______________________________________________ > 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 Sun Mar 16 17:09:38 2003 From: artful at rogers.com (Arthur Fuller) Date: Sun, 16 Mar 2003 18:09:38 -0500 Subject: [dba-SQLServer]opinions In-Reply-To: <01a601c2ec09$3082e260$ece6ffcc@SusanOne> Message-ID: <001101c2ec11$1e7023a0$8e01a8c0@Rock> What is wrong with SELECT @@Identity? -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins Sent: March 16, 2003 5:12 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]opinions I should just go to bed before I do any real damage. Although, I did sleep well last night in NyQuil la la land. :) I did say insert, but that isn't what I meant. Basically, I'm just trying to return the new identity value after saving a new record. The publisher seems to think that an INSERT TRIGGER could be used to grab a new record's GUID, since @@Identity or SCOPE_IDENTIY can't. But I don't think it's programmatically sound. I can return the values using other methods -- I was just wondering if anyone had used INSERT TRIGGER for this purpose. Susan H. ----- Original Message ----- From: "Arthur Fuller" To: Sent: Sunday, March 16, 2003 1:13 PM Subject: RE: [dba-SQLServer]opinions > I'm not sure why you would want to do this, Susan, but assuming that > you want to, a trigger would do it. Do something like this in your > trigger > (caution: written in Outlook :-). > > DECLARE @myGUID as GUID > SET @myGUID = NewID() > -- do something with the new GUID > ... > > Since you could export this logic to the db rather than contain it in > the FE, I'm not sure why you'd want to do it. This comes from a > perspective which says, "Anything MS will do for me free is code I > don't have to write." > IOW I'd create a default value for the column (=NewID()) and be done > with it. The Front End would receive the new value just like an ANPK, > so why bother writing code to create it? > > A. > > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins > Sent: March 16, 2003 12:37 PM > To: SQLList > Subject: [dba-SQLServer]opinions > > > I'd like some opinions on using an Insert Trigger to insert a GUID > value to > a new record. Good idea or bad? > > Susan H. > > > _______________________________________________ > 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 harkins at iglou.com Sun Mar 16 17:17:31 2003 From: harkins at iglou.com (Susan Harkins) Date: Sun, 16 Mar 2003 18:17:31 -0500 Subject: [dba-SQLServer]opinions References: <001101c2ec11$1e7023a0$8e01a8c0@Rock> Message-ID: <01ca01c2ec12$39e9df30$ece6ffcc@SusanOne> Well, I tried that one too. It was my first choice really -- I think I must just be calling it incorrectly or something. Susan H. > What is wrong with SELECT @@Identity? From dmcafee at pacbell.net Mon Mar 17 01:05:31 2003 From: dmcafee at pacbell.net (David McAFee (Home)) Date: Sun, 16 Mar 2003 23:05:31 -0800 Subject: [dba-SQLServer]opinions In-Reply-To: <001101c2ec11$1e7023a0$8e01a8c0@Rock> Message-ID: You can't use @@Identity to return a newly inserted GUID (@@Identity only works with Integer PKs) You have to create the new GUID as a variable then insert it, using NEWID(): IF @contactAddrID IS NULL BEGIN DECLARE @ctcID AS UNIQUEIDENTIFIER SET @ctcID = NEWID() INSERT INTO tbl_Contacts (ContactID, ContactName, entryTIME, entryUSER) VALUES (@ctcID, @CtcName, getUTCdate() , at UserGuid) END SELECT @CtcID -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Arthur Fuller Sent: Sunday, March 16, 2003 3:10 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]opinions What is wrong with SELECT @@Identity? -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins Sent: March 16, 2003 5:12 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]opinions I should just go to bed before I do any real damage. Although, I did sleep well last night in NyQuil la la land. :) I did say insert, but that isn't what I meant. Basically, I'm just trying to return the new identity value after saving a new record. The publisher seems to think that an INSERT TRIGGER could be used to grab a new record's GUID, since @@Identity or SCOPE_IDENTIY can't. But I don't think it's programmatically sound. I can return the values using other methods -- I was just wondering if anyone had used INSERT TRIGGER for this purpose. Susan H. ----- Original Message ----- From: "Arthur Fuller" To: Sent: Sunday, March 16, 2003 1:13 PM Subject: RE: [dba-SQLServer]opinions > I'm not sure why you would want to do this, Susan, but assuming that > you want to, a trigger would do it. Do something like this in your > trigger > (caution: written in Outlook :-). > > DECLARE @myGUID as GUID > SET @myGUID = NewID() > -- do something with the new GUID > ... > > Since you could export this logic to the db rather than contain it in > the FE, I'm not sure why you'd want to do it. This comes from a > perspective which says, "Anything MS will do for me free is code I > don't have to write." > IOW I'd create a default value for the column (=NewID()) and be done > with it. The Front End would receive the new value just like an ANPK, > so why bother writing code to create it? > > A. > > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins > Sent: March 16, 2003 12:37 PM > To: SQLList > Subject: [dba-SQLServer]opinions > > > I'd like some opinions on using an Insert Trigger to insert a GUID > value to > a new record. Good idea or bad? > > Susan H. From mmmtbig at bellsouth.net Mon Mar 17 09:03:21 2003 From: mmmtbig at bellsouth.net (Myke Myers) Date: Mon, 17 Mar 2003 10:03:21 -0500 Subject: [dba-SQLServer]Problem with Sql Server 2000 Stored Procs in ADP Forms after Upgrade Message-ID: <001601c2ec96$59bc08e0$6501a8c0@tbig3> Over the weekend migrated an Access ADP system from Sql Server 7 to Sql Server 2000. Testing went fine. Now the users are getting errors because a ';1' (semicolon one) is being added to the name of stored procedures the forms use as a recordsource. Any suggestions? TIA, Myke -------------- next part -------------- An HTML attachment was scrubbed... URL: From my.lists at verizon.net Mon Mar 17 09:46:32 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 17 Mar 2003 07:46:32 -0800 Subject: [dba-SQLServer]Northwind References: <012201c2ebe7$f3774d50$8e01a8c0@Rock> Message-ID: <001001c2ec9c$62a159f0$b615010a@FHTAPIA> how did you install MSDE as an instance w/ Sql Server 2000 already installed? I have not been able to do that ever, in fact the install just quits :S -Francisco http://rcm.netfirms.com On Sunday, March 16, 2003 10:14 AM [GMT-8], Arthur Fuller wrote: : Northwind is installed (with pubs) in any MSDE or SQL 2000 instance. : You will also find a NorthwindCS.adp (IIRC) that connects to the : Northwind database. : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan : Harkins Sent: March 16, 2003 12:39 PM : To: SQLList : Subject: [dba-SQLServer]Northwind : : : Northwind shows up on my list of SQL Server sample databases -- I : also have Access and MSDE installed on the same system. Is this : really a SQL Server database or is it the MSDE sample database? I'm : guessing the latter. : : Susan H. From harkins at iglou.com Mon Mar 17 13:29:27 2003 From: harkins at iglou.com (Susan Harkins) Date: Mon, 17 Mar 2003 14:29:27 -0500 Subject: [dba-SQLServer]opinions References: Message-ID: <046c01c2ecbb$8baf82d0$ece6ffcc@SusanOne> Right -- but originally, I was talking about PK's. Susan H. > You can't use @@Identity to return a newly inserted GUID (@@Identity only > works with Integer PKs) > > You have to create the new GUID as a variable then insert it, using NEWID(): > > IF @contactAddrID IS NULL BEGIN > DECLARE @ctcID AS UNIQUEIDENTIFIER > SET @ctcID = NEWID() > INSERT INTO tbl_Contacts (ContactID, ContactName, entryTIME, > entryUSER) > VALUES (@ctcID, @CtcName, getUTCdate() , at UserGuid) > END > > SELECT @CtcID > > > > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Arthur > Fuller > Sent: Sunday, March 16, 2003 3:10 PM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]opinions > > > What is wrong with SELECT @@Identity? > > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins > Sent: March 16, 2003 5:12 PM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer]opinions > > > I should just go to bed before I do any real damage. Although, I did sleep > well last night in NyQuil la la land. :) > > I did say insert, but that isn't what I meant. > > Basically, I'm just trying to return the new identity value after saving a > new record. The publisher seems to think that an INSERT TRIGGER could be > used to grab a new record's GUID, since @@Identity or SCOPE_IDENTIY can't. > But I don't think it's programmatically sound. > > I can return the values using other methods -- I was just wondering if > anyone had used INSERT TRIGGER for this purpose. > > Susan H. > > > ----- Original Message ----- > From: "Arthur Fuller" > To: > Sent: Sunday, March 16, 2003 1:13 PM > Subject: RE: [dba-SQLServer]opinions > > > > I'm not sure why you would want to do this, Susan, but assuming that > > you want to, a trigger would do it. Do something like this in your > > trigger > > (caution: written in Outlook :-). > > > > DECLARE @myGUID as GUID > > SET @myGUID = NewID() > > -- do something with the new GUID > > ... > > > > Since you could export this logic to the db rather than contain it in > > the FE, I'm not sure why you'd want to do it. This comes from a > > perspective which says, "Anything MS will do for me free is code I > > don't have to > write." > > IOW I'd create a default value for the column (=NewID()) and be done > > with it. The Front End would receive the new value just like an ANPK, > > so why bother writing code to create it? > > > > A. > > > > > > -----Original Message----- > > From: dba-sqlserver-admin at databaseadvisors.com > > [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan > Harkins > > Sent: March 16, 2003 12:37 PM > > To: SQLList > > Subject: [dba-SQLServer]opinions > > > > > > I'd like some opinions on using an Insert Trigger to insert a GUID > > value > to > > a new record. Good idea or bad? > > > > Susan H. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > From fahooper at trapo.com Mon Mar 17 15:08:24 2003 From: fahooper at trapo.com (Fred Hooper) Date: Mon, 17 Mar 2003 16:08:24 -0500 Subject: [dba-SQLServer]Union query disk space In-Reply-To: <046c01c2ecbb$8baf82d0$ece6ffcc@SusanOne> Message-ID: <002201c2ecc9$5948a570$60a90944@fred> I need to combine data sources that feed a BI program (Cognos). The equivalent process with pure SQL Server would be to have a view that SELECTs from another view containing multiple UNIONs. My question is: Will this result in a table in TempDb representing the UNION'd tables? If so, I don't have enough disk space. I'd rather not try it out blind, do I'm grateful for any ideas. From my.lists at verizon.net Mon Mar 17 15:24:32 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 17 Mar 2003 13:24:32 -0800 Subject: [dba-SQLServer]Union query disk space References: <002201c2ecc9$5948a570$60a90944@fred> Message-ID: <013901c2eccb$9aaf6f60$b615010a@FHTAPIA> ouch that is a problem, Do you have another disk on that server? if so maybe try moving the tempdb over to that disk in order to enable your query to run. -Francisco http://rcm.netfirms.com On Monday, March 17, 2003 1:08 PM [GMT-8], Fred Hooper wrote: : I need to combine data sources that feed a BI program (Cognos). The : equivalent process with pure SQL Server would be to have a view that : SELECTs from another view containing multiple UNIONs. My question is: : Will this result in a table in TempDb representing the UNION'd tables? : : If so, I don't have enough disk space. I'd rather not try it out : blind, do I'm grateful for any ideas. : From j.frederick at att.net Mon Mar 17 15:35:57 2003 From: j.frederick at att.net (John Frederick) Date: Mon, 17 Mar 2003 16:35:57 -0500 Subject: [dba-SQLServer]Northwind In-Reply-To: <001001c2ec9c$62a159f0$b615010a@FHTAPIA> Message-ID: I never had a full SQL Server 2000 and it seemed to me that uninstalling an Evaluation copy didn't remove it completely. I finally gen'ed a new W2k Prof, installed VS .NET Prof, and then ran the MSDE Setup to install MSDE 2. The setup.ini specifies a named instance with name: VSdotNET. Then I used the Evaluation cdrom to install ONLY the Client Tools. I asked the local gurus if I could somehow convert the named instance to the default. The answer was no. As it is, it doesn't respond to Server=localhost and I'm in for a lot of connect string editing when I deploy. I think I've explored all the wrong ways to do this. You're invited to email to j.frederick at att.net or phone (212) 595-2599 if you want a faster cycle time on this dialog. We can post the solution in the forum. -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Francisco H Tapia Sent: Monday, March 17, 2003 10:47 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Northwind how did you install MSDE as an instance w/ Sql Server 2000 already installed? I have not been able to do that ever, in fact the install just quits :S -Francisco http://rcm.netfirms.com On Sunday, March 16, 2003 10:14 AM [GMT-8], Arthur Fuller wrote: : Northwind is installed (with pubs) in any MSDE or SQL 2000 instance. : You will also find a NorthwindCS.adp (IIRC) that connects to the : Northwind database. : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan : Harkins Sent: March 16, 2003 12:39 PM : To: SQLList : Subject: [dba-SQLServer]Northwind : : : Northwind shows up on my list of SQL Server sample databases -- I : also have Access and MSDE installed on the same system. Is this : really a SQL Server database or is it the MSDE sample database? I'm : guessing the latter. : : Susan H. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fahooper at trapo.com Mon Mar 17 15:57:19 2003 From: fahooper at trapo.com (Fred Hooper) Date: Mon, 17 Mar 2003 16:57:19 -0500 Subject: [dba-SQLServer]Union query disk space In-Reply-To: <013901c2eccb$9aaf6f60$b615010a@FHTAPIA> Message-ID: <003401c2ecd0$2e833a60$60a90944@fred> Unfortunately, no. Our best guess at the size is 200Gb. Only in the past week were we able to reconfigure enough to do a backup -- after 6 weeks. Unfortunately, the data reads for the BI build from that query take 4 days, so we can't even reconfigure temporarily unless we forego backing up for that period. Still, if we could exist for six weeks, how about another 4-5 days? Maybe that's our answer. Thanks Francisco. Fred |-----Original Message----- |From: dba-sqlserver-admin at databaseadvisors.com |[mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of |Francisco H Tapia |Sent: Monday, March 17, 2003 4:25 PM |To: dba-sqlserver at databaseadvisors.com |Subject: Re: [dba-SQLServer]Union query disk space | | |ouch that is a problem, Do you have another disk on that |server? if so maybe try moving the tempdb over to that disk |in order to enable your query to run. | |-Francisco |http://rcm.netfirms.com | |On Monday, March 17, 2003 1:08 PM [GMT-8], |Fred Hooper wrote: | |: I need to combine data sources that feed a BI program (Cognos). The |: equivalent process with pure SQL Server would be to have a view that |: SELECTs from another view containing multiple UNIONs. My question is: |: Will this result in a table in TempDb representing the |UNION'd tables? |: |: If so, I don't have enough disk space. I'd rather not try it out |: blind, do I'm grateful for any ideas. |: | | |_______________________________________________ |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 Mon Mar 17 20:06:44 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Mon, 17 Mar 2003 18:06:44 -0800 Subject: [dba-SQLServer]Union query disk space In-Reply-To: <003401c2ecd0$2e833a60$60a90944@fred> Message-ID: Just a comment; remove all your keys and FK before importing. Imports fast then add them back. A similar import/export project, according to a friend, was reduced from 3 days to two hours... Jim -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Fred Hooper Sent: Monday, March 17, 2003 1:57 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Union query disk space Unfortunately, no. Our best guess at the size is 200Gb. Only in the past week were we able to reconfigure enough to do a backup -- after 6 weeks. Unfortunately, the data reads for the BI build from that query take 4 days, so we can't even reconfigure temporarily unless we forego backing up for that period. Still, if we could exist for six weeks, how about another 4-5 days? Maybe that's our answer. Thanks Francisco. Fred |-----Original Message----- |From: dba-sqlserver-admin at databaseadvisors.com |[mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of |Francisco H Tapia |Sent: Monday, March 17, 2003 4:25 PM |To: dba-sqlserver at databaseadvisors.com |Subject: Re: [dba-SQLServer]Union query disk space | | |ouch that is a problem, Do you have another disk on that |server? if so maybe try moving the tempdb over to that disk |in order to enable your query to run. | |-Francisco |http://rcm.netfirms.com | |On Monday, March 17, 2003 1:08 PM [GMT-8], |Fred Hooper wrote: | |: I need to combine data sources that feed a BI program (Cognos). The |: equivalent process with pure SQL Server would be to have a view that |: SELECTs from another view containing multiple UNIONs. My question is: |: Will this result in a table in TempDb representing the |UNION'd tables? |: |: If so, I don't have enough disk space. I'd rather not try it out |: blind, do I'm grateful for any ideas. |: | | |_______________________________________________ |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 Tue Mar 18 10:08:48 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 18 Mar 2003 08:08:48 -0800 Subject: [dba-SQLServer]Northwind References: Message-ID: <001f01c2ed68$a9cef6d0$b615010a@FHTAPIA> Thanks John, (I'll cc you directly in order to speed up response time). While altho server=localhost is not valid, server=VSdotNET will be, which IMHO is much much better,... in an alpha version of some software that we are woring on we went with the localhost and I had some code to auto-start the MSDE instance of localhost, but was not for the life of me able to connect to it. This happend because of the way that the install was deployed I know know as the default installsheild version that MS put out was buggy especially in WindowsNT... go figure.. In the next deployment we are going to attempt a wise scripted install to help us along... :D -Francisco http://rcm.netfirms.com On Monday, March 17, 2003 1:35 PM [GMT-8], John Frederick wrote: : I never had a full SQL Server 2000 and it seemed to me that : uninstalling an Evaluation copy didn't remove it completely. I : finally gen'ed a new W2k Prof, installed VS .NET Prof, and then ran : the MSDE Setup to install MSDE 2. The setup.ini specifies a named : instance with name: VSdotNET. Then I used the Evaluation cdrom to : install ONLY the Client Tools. I asked the local gurus if I could : somehow convert the named instance to the default. The answer was : no. As it is, it doesn't respond to Server=localhost and I'm in for : a lot of connect string editing when I deploy. I think I've explored : all the wrong ways to do this. You're invited to email to : j.frederick at att.net or phone if you want a faster : cycle time on this dialog. We can post the solution in the forum. : : -----Original Message----- : From: dba-sqlserver-admin at databaseadvisors.com : [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of : Francisco : H Tapia : Sent: Monday, March 17, 2003 10:47 AM : To: dba-sqlserver at databaseadvisors.com : Subject: Re: [dba-SQLServer]Northwind : : : how did you install MSDE as an instance w/ Sql Server 2000 already : installed? I have not been able to do that ever, in fact the install : just quits :S : : -Francisco : http://rcm.netfirms.com : : On Sunday, March 16, 2003 10:14 AM [GMT-8], : Arthur Fuller wrote: : :: Northwind is installed (with pubs) in any MSDE or SQL 2000 instance. :: You will also find a NorthwindCS.adp (IIRC) that connects to the :: Northwind database. :: :: -----Original Message----- :: From: dba-sqlserver-admin at databaseadvisors.com :: [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan :: Harkins Sent: March 16, 2003 12:39 PM :: To: SQLList :: Subject: [dba-SQLServer]Northwind :: :: :: Northwind shows up on my list of SQL Server sample databases -- I :: also have Access and MSDE installed on the same system. Is this :: really a SQL Server database or is it the MSDE sample database? I'm :: guessing the latter. :: :: Susan H. : : : _______________________________________________ : 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 Tue Mar 18 13:05:58 2003 From: MPorter at acsalaska.com (Porter, Mark) Date: Tue, 18 Mar 2003 10:05:58 -0900 Subject: [dba-SQLServer]Accessing a local file with Query Analyzer Message-ID: Is there a method of accessing a local CSV file and including it in a query in SQL Analyzer? I've done the routine of trying to import the CSV file into the database and linking to the database with Access to perform the query there and have failed. I do not have the access to create tables, and there are too many indexes on the linked tables for Access (dumping them temporarially is not an option). Or, any other ideas? 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 CWortz at tea.state.tx.us Tue Mar 18 13:14:32 2003 From: CWortz at tea.state.tx.us (Wortz, Charles) Date: Tue, 18 Mar 2003 13:14:32 -0600 Subject: [dba-SQLServer]Accessing a local file with Query Analyzer Message-ID: Mark, If this is a one-time-only thing, then try importing the tables from SS into Access and running your query with the CSV file either linked or imported. If this is an on-going operation, then this is not a good way to go, but it will work. I have one app that once a day downloads tables from SS into Access and then runs independently of SS for the rest of the day. Charles Wortz Software Development Division Texas Education Agency 1701 N. Congress Ave Austin, TX 78701-1494 512-463-9493 CWortz at tea.state.tx.us -----Original Message----- From: Porter, Mark [mailto:MPorter at acsalaska.com] Sent: Tuesday 2003 Mar 18 13:06 To: 'dba-SQLServer at databaseadvisors.com' Subject: [dba-SQLServer]Accessing a local file with Query Analyzer Is there a method of accessing a local CSV file and including it in a query in SQL Analyzer? I've done the routine of trying to import the CSV file into the database and linking to the database with Access to perform the query there and have failed. I do not have the access to create tables, and there are too many indexes on the linked tables for Access (dumping them temporarially is not an option). Or, any other ideas? Thanks, Mark From MPorter at acsalaska.com Tue Mar 18 13:24:26 2003 From: MPorter at acsalaska.com (Porter, Mark) Date: Tue, 18 Mar 2003 10:24:26 -0900 Subject: [dba-SQLServer]Accessing a local file with Query Analyzer Message-ID: Just tried that - too many indexes on the SS table for either a link or an import :( Mark -----Original Message----- From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] Sent: Tuesday, March 18, 2003 10:15 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Accessing a local file with Query Analyzer Mark, If this is a one-time-only thing, then try importing the tables from SS into Access and running your query with the CSV file either linked or imported. If this is an on-going operation, then this is not a good way to go, but it will work. I have one app that once a day downloads tables from SS into Access and then runs independently of SS for the rest of the day. Charles Wortz Software Development Division Texas Education Agency 1701 N. Congress Ave Austin, TX 78701-1494 512-463-9493 CWortz at tea.state.tx.us -----Original Message----- From: Porter, Mark [mailto:MPorter at acsalaska.com] Sent: Tuesday 2003 Mar 18 13:06 To: 'dba-SQLServer at databaseadvisors.com' Subject: [dba-SQLServer]Accessing a local file with Query Analyzer Is there a method of accessing a local CSV file and including it in a query in SQL Analyzer? I've done the routine of trying to import the CSV file into the database and linking to the database with Access to perform the query there and have failed. I do not have the access to create tables, and there are too many indexes on the linked tables for Access (dumping them temporarially is not an option). Or, any other ideas? Thanks, Mark _______________________________________________ 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 mmmtbig at bellsouth.net Tue Mar 18 14:14:58 2003 From: mmmtbig at bellsouth.net (mmmtbig at bellsouth.net) Date: Tue, 18 Mar 2003 15:14:58 -0500 Subject: [dba-SQLServer]FYI -- ACC2000: Incompatibility Issues Between Access 2000 Projects and SQL Server 2000 (Microsoft Fix) Message-ID: ACC2000: Incompatibility Issues Between Access 2000 Projects and SQL Server 2000 The information in this article applies to: * Microsoft Access 2000 This article was previously published under Q269824 Advanced: Requires expert coding, interoperability, and multiuser skills. This article applies only to a Microsoft Access project (.adp). SYMPTOMS If you have an Access project (*.adp) that was created with Microsoft Access 2000 with no service releases applied, and the project is based on a Microsoft SQL Server 2000 database, you may notice several incompatibility issues, the most obvious being the following: * All existing stored procedure names are displayed with ";1" at the end. For example "CustOrderHist" is displayed as "CustOrderHist;1". * You cannot run existing stored procedures. Instead, you receive the following error: Could not find stored procedure ;1. * You cannot manage security against a Microsoft SQL Server 2000 server. If you try to open the SQL Server Security dialog box, you receive the following error: The Database administrative components failed to load or initialize. Verify that the components are installed and registered locally. * You cannot create or design tables, database diagrams, or stored procedures. Attempting to create any of these objects, such as clicking New in the Database window or clicking a command on the Insert menu, results in one of the following behaviors: New Table The Access 2000 Table designer does not load. Briefly, a dimmed window appears and then closes with no error message as to why the designer failed to load. New Database Diagram You receive the following error: Cannot create objects of type 'Diagram' against current SQL backend. Please check your permissions and server setup. New Stored Procedure You receive the following error: Microsoft Access can't find the object 'Microsoft Access can't find the object 'StoredProcedure1.'.' *You misspelled the object name. Check for missing underscores(_) or other punctuation, and make sure you didn't enter leading spaces. *You tried to open a linked table, but the file containing the table isn't on the path you specified. Use the Linked Table Manager to update the link and oint to the correct path. CAUSE SQL Server 2000 was released over a year after Access 2000; consequently, Access 2000 does not support all of the new features of SQL Server 2000, and incompatibilities exist. RESOLUTION Update the designer tools. The following two updates are available. Microsoft Office 2000 Service Release 1/1a Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a) includes updated Visual Database Tools for Access projects. Office 2000 SR-1/SR-1a addresses most of the issues described in the "Symptoms" section. IMPORTANT NOTE: Office 2000 SR-1/SR-1a also sets the table, view, and database diagram designers to read-only. These designers are read-only to prevent the possibility of losing data and meta-data in tables and views. You can, however, create stored procedures. In Access 2000 SR-1/SR-1a, if you try to create a table, view, or database diagram, you see the following alert: You do not have exclusive access to the database at this time. Your design changes will not be saved. NOTE: If you want to install Office 2000 SR-1/SR-1a, you should do so before installing the Client Tools. If you install Office 2000 SR-1/SR-1a after installing the Client Tools, you should reinstall the Client Tools. Security Management Microsoft Office SR-1/SR-1a does not address the inability to manage SQL Server 2000 Security from within an Access project. If you try to open the Security dialog box, you receive the second error message described in the "Symptoms" section of this article, and in addition, the following error message: [Microsoft][ODBC SQL Server Driver][SQL Server]You must upgrade your SQL Enterprise Manager and SQL-DMO (SQLOLE) to SQL Server 2000(SQLDMO) to connect to this server. In order to manage SQL Server 2000 security from an Access project, you must install the SQL Server Client Tools (See the "SQL Server 2000 Client Tools" section later in this article). For additional information about obtaining Office 2000 SR-1/SR-1a, click the article number below to view the article in the Microsoft Knowledge Base: 245025 OFF2000: How to Obtain and Install Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a) SQL Server 2000 Client Tools/Files A more comprehensive update is the SQL Server 2000 Client Tools. The SQL Server 2000 Client Tools update addresses all of the issues in the "Symptoms" section and the "Microsoft Access 2000 SR-1/SR-1a" topic of the "Resolution" section of this article. Installing the tools updates a number of files essential to Access project design. These updated files give you the ability to design SQL Server 2000 databases in an Access project at a SQL Server 7.0 level of functionality. NOTE: The client tools must be installed on each development computer; in other words, on any computer on which someone may make design changes in an Access project to a SQL Server 2000 database. If you want to use all of the new features in SQL Server 2000, it is best, if possible, to design them in SQL Server Enterprise Manager, which is included in the SQL Server 2000 Client Tools. Goals of the Updated Files Included with the Client Tools * Assures that users of SQL Server 2000 databases that have not implemented any of the new features of SQL Server 2000 do not experience any degradation of functionality when designing SQL Server 2000 databases in an Access 2000 project. * Assures that designing a database object that takes advantage of SQL Server 2000-specific functionality will not cause data loss to occur. * Assures, in most cases, that designing a database object that takes advantage of SQL Server 2000-specific functionality does not result in the loss of meta-data. In the few cases that might result in meta-data loss, you are warned by means of a dialog box. Updating Client Tools Files Without Installing the Client Tools If you do not want to install the SQL Server 2000 Client Tools on your development computer, you can follow these steps to just update the files that address incompatibility issues: 1. Install the SQL Server 2000 Client Tools on a computer other than the development computer. 2. On that second computer, browse to the following folder: Program Files\Common Files\Microsoft Shared\MSDesigners98 3. Select all the files in the folder, and then on the Edit menu, click Copy. 4. While still at the second computer, browse to the development computer, and then browse to the following folder: Program Files\Common Files\Microsoft Shared\MSDesigners98 5. Paste the contents that you copied in step 3 into the folder by clicking Paste on the Edit menu. STATUS Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was corrected by Microsoft Office 2000 SR-1/SR-1a and the SQL Server 2000 Client Tools. MORE INFORMATION Steps to Reproduce the Behavior 1. Install Microsoft SQL Server 2000 on a Microsoft Windows NT 4.0 Server or a Microsoft Windows 2000 Server. 2. Install Access 2000 on another computer that has a clean installation of Microsoft Windows 98. 3. In Access 2000, click New on the File menu. 4. On the General Tab of the New dialog box, click Project (Existing Database). 5. Name the file Test, and then click Create. 6. In the Data Link Properties dialog box, for step 1, type the name of the SQL 2000 server. In the Database field, type Northwind. (This is the sample Northwind database included with SQL Server 2000.) Click OK. 7. In the new Access project, click Stored Procedures. Note that names are displayed with a ";1" at the end. 8. On the Tools menu, point to Security, and then click Database Security. Note that you receive an error stating that components failed to load or initialize (see the full error in the "Symptoms" section of this article). 9. Try to run an existing stored procedure. Note that you receive the following error: Could not find stored procedure ;1. 10. Try to create a new stored procedure. Note that you receive the error message with the repeated phrase "Microsoft Access can't find the object 'Microsoft Access can't find the object" as described in the "Symptoms" section of this article. 11. Try to create a new table. Note that there is a brief flash on the screen, but that the table designer does not appear. 12. Try to create a new database diagram. Note that you receive the following error message: Cannot create objects of type 'Diagram' against current SQL backend. Please check your permissions and server setup. REFERENCES For additional information on how the new features of SQL Server 2000 affect Access Projects, click the article number below to view the article in the Microsoft Knowledge Base: 266277 PRB: Using the Visual Studio 6.0 and Access 2000 Visual Database Tools with SQL Server 2000 For additional information on an error occurring during upsizing to SQL Server 2000, click the article number below to view the article in the Microsoft Knowledge Base: 272384 ACC2000: "Overflow" Error Message When You Try to Upsize to SQL Server 2000 -------------- next part -------------- An HTML attachment was scrubbed... URL: From harkins at iglou.com Tue Mar 18 18:39:37 2003 From: harkins at iglou.com (Susan Harkins) Date: Tue, 18 Mar 2003 19:39:37 -0500 Subject: [dba-SQLServer]basic question Message-ID: <001401c2edb0$0678c400$f8ecffcc@SusanOne> In Access, a compact will reset the AutoNumber seed value to one more than the largest AN value already in the table. Is there anyway to do this with an Identity column in SQL Server? Susan H. From harkins at iglou.com Tue Mar 18 20:26:02 2003 From: harkins at iglou.com (Susan Harkins) Date: Tue, 18 Mar 2003 21:26:02 -0500 Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY Message-ID: <009f01c2edbe$e43e4310$f8ecffcc@SusanOne> I have two questions about these two functions. 1.) BOL is really clear on inserting more than one record or triggers -- I understand the scope issues in those situations. What's not so clear is multiple users inserting one record at a time. If a stored procedure inserts a record and then grabs the newly inserted identity value using @@IDENTITY, is there any chance @@IDENTITY might return a value other than the right one? Say a number of users are updating the same table at the same time. UserA inserts identity value x but before the stored procedure can grab x, UserB inserts identity value y. Is there any possibility @@IDENTITY will return y to UserA instead of x? Or, does SQL Server resolve these conflicts internally? 2.) A single sp inserts two records. In this case, @@IDENTITY and SCOPE_IDENTITY return the same value -- always the last inserted value. Right? Susan H. From Fredrick_Antony at Dell.com Tue Mar 18 22:48:30 2003 From: Fredrick_Antony at Dell.com (Antony, Fredrick) Date: Tue, 18 Mar 2003 22:48:30 -0600 Subject: [dba-SQLServer]basic question Message-ID: No Identity is meant for identical value. There is no way of resetting it Regards Fred -----Original Message----- From: Susan Harkins [mailto:harkins at iglou.com] Sent: Wednesday, March 19, 2003 6:10 AM To: SQLList Subject: [dba-SQLServer]basic question In Access, a compact will reset the AutoNumber seed value to one more than the largest AN value already in the table. Is there anyway to do this with an Identity column in SQL Server? Susan H. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From stuart at lexacorp.com.pg Tue Mar 18 23:09:48 2003 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 19 Mar 2003 15:09:48 +1000 Subject: [dba-SQLServer]basic question In-Reply-To: Message-ID: <3E78883C.7578.124AF98@localhost> In Enterprise Manager, go into Design Table, deselect "Identity" and save the definition, then open it again and re-select it. Voila! Note that, unlike Access, you can also re-use deleted Identity values. From BOL: "By default, data cannot be inserted directly into an identity column. The identity column generates a unique, sequential number automatically for each new row inserted in the table. This default can be overridden using the following SET statement: SET IDENTITY_INSERT table_name ON With IDENTITY_INSERT set to ON, the user is allowed to insert any value into a new row with an identity column. To prevent the entry of duplicate numbers, a unique index must be created against the column. The purpose of this statement is to allow a user to re-create a value for a row that has been deleted accidentally. On 18 Mar 2003 at 22:48, Antony, Fredrick wrote: > No Identity is meant for identical value. There is no way of resetting it > > Regards > Fred > > -----Original Message----- > From: Susan Harkins [mailto:harkins at iglou.com] > Sent: Wednesday, March 19, 2003 6:10 AM > To: SQLList > Subject: [dba-SQLServer]basic question > > > In Access, a compact will reset the AutoNumber seed value to one more than > the largest AN value already in the table. Is there anyway to do this with > an Identity column in SQL Server? > > Susan H. > > _______________________________________________ > 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 > -- Stuart McLachlan Lexacorp Ltd Application Development, IT Consultancy http://www.lexacorp.com.pg -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikedorism at ntelos.net Wed Mar 19 07:40:15 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Wed, 19 Mar 2003 08:40:15 -0500 Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY In-Reply-To: <009f01c2edbe$e43e4310$f8ecffcc@SusanOne> Message-ID: <001d01c2ee1d$16529b90$fc340cd8@hargrove.internal> 1) I've never run across this and I've got 25+ users doing data entry at the same time. 2) You are correct Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Tuesday, March 18, 2003 09:26 PM To: SQLList Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY I have two questions about these two functions. 1.) BOL is really clear on inserting more than one record or triggers -- I understand the scope issues in those situations. What's not so clear is multiple users inserting one record at a time. If a stored procedure inserts a record and then grabs the newly inserted identity value using @@IDENTITY, is there any chance @@IDENTITY might return a value other than the right one? Say a number of users are updating the same table at the same time. UserA inserts identity value x but before the stored procedure can grab x, UserB inserts identity value y. Is there any possibility @@IDENTITY will return y to UserA instead of x? Or, does SQL Server resolve these conflicts internally? 2.) A single sp inserts two records. In this case, @@IDENTITY and SCOPE_IDENTITY return the same value -- always the last inserted value. Right? Susan H. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From j.frederick at att.net Wed Mar 19 08:10:20 2003 From: j.frederick at att.net (John Frederick) Date: Wed, 19 Mar 2003 09:10:20 -0500 Subject: [dba-SQLServer]basic question In-Reply-To: Message-ID: I'm don't know what automatic behaviors apply to in identity field, but in SQL Server, you have more control. In code, you can use "SET IDENTITY_INSERT ON" to completely turn off the constraints, enabling you to insert records with unused values corresponding to deleted records. I haven't tried it, but even without this, you might be able to plug new values into the IDENTITY SEED AND IDENTITY INCREMENT properties of the field as long as you didn't create values that violated constraints. -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Antony, Fredrick Sent: Tuesday, March 18, 2003 11:49 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]basic question No Identity is meant for identical value. There is no way of resetting it Regards Fred -----Original Message----- From: Susan Harkins [mailto:harkins at iglou.com] Sent: Wednesday, March 19, 2003 6:10 AM To: SQLList Subject: [dba-SQLServer]basic question In Access, a compact will reset the AutoNumber seed value to one more than the largest AN value already in the table. Is there anyway to do this with an Identity column in SQL Server? Susan H. _______________________________________________ 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 szeller at cce.umn.edu Wed Mar 19 08:15:25 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Wed, 19 Mar 2003 08:15:25 -0600 Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY Message-ID: 1. Yes, it is possible that you will get y value when you want x. I have never had this happen, but we now use a routine that generates our own primary key values. It essentially is a table in sql server where we store the last highest id used. A sproc evaluates that, increments one, returns the new id value as an output parameter and updates the table that stores the last highest id used. You can also use newid() which returns a unqiue value. --Susan -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Wednesday, March 19, 2003 7:40 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY 1) I've never run across this and I've got 25+ users doing data entry at the same time. 2) You are correct Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Tuesday, March 18, 2003 09:26 PM To: SQLList Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY I have two questions about these two functions. 1.) BOL is really clear on inserting more than one record or triggers -- I understand the scope issues in those situations. What's not so clear is multiple users inserting one record at a time. If a stored procedure inserts a record and then grabs the newly inserted identity value using @@IDENTITY, is there any chance @@IDENTITY might return a value other than the right one? Say a number of users are updating the same table at the same time. UserA inserts identity value x but before the stored procedure can grab x, UserB inserts identity value y. Is there any possibility @@IDENTITY will return y to UserA instead of x? Or, does SQL Server resolve these conflicts internally? 2.) A single sp inserts two records. In this case, @@IDENTITY and SCOPE_IDENTITY return the same value -- always the last inserted value. Right? Susan H. _______________________________________________ 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 Mar 19 09:16:28 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 19 Mar 2003 09:16:28 -0600 Subject: [dba-SQLServer]basic question Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABE90@ex02.eagle.usaa.com> Actually, truncating the table resets the identity column to start from the number specified in SEED. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Antony, Fredrick [mailto:Fredrick_Antony at dell.com] Sent: Tuesday, March 18, 2003 10:49 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]basic question No Identity is meant for identical value. There is no way of resetting it Regards Fred -----Original Message----- From: Susan Harkins [mailto:harkins at iglou.com] Sent: Wednesday, March 19, 2003 6:10 AM To: SQLList Subject: [dba-SQLServer]basic question In Access, a compact will reset the AutoNumber seed value to one more than the largest AN value already in the table. Is there anyway to do this with an Identity column in SQL Server? Susan H. _______________________________________________ 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 Mar 19 09:45:50 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 19 Mar 2003 09:45:50 -0600 Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABE91@ex02.eagle.usaa.com> I'd say it's impossible. However, in the situation where there is a trigger on the table you're inserting into, that in turn inserts a record into another table with IDENTITY column, - @@IDENTITY will contain the value of that other column's new identity value, while SCOPE_IDENTITY() will pertain to the first table. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Susan Zeller [mailto:szeller at cce.umn.edu] Sent: Wednesday, March 19, 2003 8:15 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY 1. Yes, it is possible that you will get y value when you want x. I have never had this happen, but we now use a routine that generates our own primary key values. It essentially is a table in sql server where we store the last highest id used. A sproc evaluates that, increments one, returns the new id value as an output parameter and updates the table that stores the last highest id used. You can also use newid() which returns a unqiue value. --Susan -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Wednesday, March 19, 2003 7:40 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY 1) I've never run across this and I've got 25+ users doing data entry at the same time. 2) You are correct Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Tuesday, March 18, 2003 09:26 PM To: SQLList Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY I have two questions about these two functions. 1.) BOL is really clear on inserting more than one record or triggers -- I understand the scope issues in those situations. What's not so clear is multiple users inserting one record at a time. If a stored procedure inserts a record and then grabs the newly inserted identity value using @@IDENTITY, is there any chance @@IDENTITY might return a value other than the right one? Say a number of users are updating the same table at the same time. UserA inserts identity value x but before the stored procedure can grab x, UserB inserts identity value y. Is there any possibility @@IDENTITY will return y to UserA instead of x? Or, does SQL Server resolve these conflicts internally? 2.) A single sp inserts two records. In this case, @@IDENTITY and SCOPE_IDENTITY return the same value -- always the last inserted value. Right? Susan H. _______________________________________________ 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 Mar 19 11:12:21 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 19 Mar 2003 11:12:21 -0600 Subject: [dba-SQLServer]basic question Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBE6@ex02.eagle.usaa.com> As far as I know, SET operations require a user to belong at a minimum to db_ddladmin database role, even when it is within the stored procedure that the user is allowed to execute. And also, I don't believe you can alter SEED and INCREMENT properties of an identity field without re-creating the table or removing IDENTITY all together and re-adding it with new values. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: John Frederick [mailto:j.frederick at att.net] Sent: Wednesday, March 19, 2003 8:10 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]basic question I'm don't know what automatic behaviors apply to in identity field, but in SQL Server, you have more control. In code, you can use "SET IDENTITY_INSERT ON" to completely turn off the constraints, enabling you to insert records with unused values corresponding to deleted records. I haven't tried it, but even without this, you might be able to plug new values into the IDENTITY SEED AND IDENTITY INCREMENT properties of the field as long as you didn't create values that violated constraints. -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Antony, Fredrick Sent: Tuesday, March 18, 2003 11:49 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]basic question No Identity is meant for identical value. There is no way of resetting it Regards Fred -----Original Message----- From: Susan Harkins [mailto:harkins at iglou.com] Sent: Wednesday, March 19, 2003 6:10 AM To: SQLList Subject: [dba-SQLServer]basic question In Access, a compact will reset the AutoNumber seed value to one more than the largest AN value already in the table. Is there anyway to do this with an Identity column in SQL Server? Susan H. _______________________________________________ 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 Mar 19 11:54:34 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 19 Mar 2003 09:54:34 -0800 Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY References: <009f01c2edbe$e43e4310$f8ecffcc@SusanOne> Message-ID: <003401c2ee40$9ad0fba0$b615010a@FHTAPIA> BOL: INDEX KEYWORD @@IDENTITY :What's not so clear is multiple users inserting one record at a time. 1) BOL: @@IDENTITY and SCOPE_IDENTITY will return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value only within the current scope; @@IDENTITY is not limited to a specific scope. That is to say current session = userA. UserB is in his OWN session so you could have Users A, B, C, D, E, F... insert records before user A can run the @@Idenity statement and UserA will still get their own Id back from their own session, not that of userZ. 2)YES -Francisco http://rcm.netfirms.com On Tuesday, March 18, 2003 6:26 PM [GMT-8], Susan Harkins wrote: : I have two questions about these two functions. : : 1.) BOL is really clear on inserting more than one record or triggers : -- I understand the scope issues in those situations. What's not so : clear is multiple users inserting one record at a time. If a stored : procedure inserts a record and then grabs the newly inserted identity : value using @@IDENTITY, is there any chance @@IDENTITY might return a : value other than the right one? Say a number of users are updating : the same table at the same time. UserA inserts identity value x but : before the stored procedure can grab x, UserB inserts identity value : y. Is there any possibility @@IDENTITY will return y to UserA instead : of x? Or, does SQL Server resolve these conflicts internally? : : 2.) A single sp inserts two records. In this case, @@IDENTITY and : SCOPE_IDENTITY return the same value -- always the last inserted : value. Right? : From tuxedo_man at hotmail.com Wed Mar 19 14:09:27 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 19 Mar 2003 20:09:27 +0000 Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY Message-ID: 2). Not necessarily true if you have triggers. /* -- cut here -- */ USE TEMPDB BEGIN TRAN SET NOCOUNT ON CREATE TABLE AAA(AAA_ID INT IDENTITY(1,1), AAA_VALUE CHAR(1)); CREATE TABLE BBB(BBB_ID INT IDENTITY(10,10), BBB_VALUE CHAR(1)); GO CREATE TRIGGER TR_AAA ON AAA AFTER INSERT AS BEGIN INSERT INTO BBB(BBB_VALUE) VALUES('x'); END GO INSERT INTO AAA(AAA_VALUE) VALUES('y'); /* Scope_identity() is one scope, one session, any table */ /* RETURNS 1 */ select SCOPE_IDENTITY() AS SCOPE_IDENTITY_VALUE /* @@identity is any scope, one session, any table */ /* RETURNS 10 */ select @@IDENTITY AS IDENTITY_VALUE SET NOCOUNT OFF ROLLBACK /* -- cut here -- */ >From: "Susan Zeller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: RE: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY >Date: Wed, 19 Mar 2003 08:15:25 -0600 > >1. Yes, it is possible that you will get y value when you want x. I >have never had this happen, but we now use a routine that generates our >own primary key values. It essentially is a table in sql server where >we store the last highest id used. A sproc evaluates that, increments >one, returns the new id value as an output parameter and updates the >table that stores the last highest id used. You can also use newid() >which returns a unqiue value. > >--Susan > >-----Original Message----- >From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] >Sent: Wednesday, March 19, 2003 7:40 AM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY > > >1) I've never run across this and I've got 25+ users doing data entry at >the same time. > >2) You are correct > >Doris Manning >Database Administrator >Hargrove Inc. >www.hargroveinc.com > > >-----Original Message----- >From: dba-sqlserver-admin at databaseadvisors.com >[mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Susan >Harkins >Sent: Tuesday, March 18, 2003 09:26 PM >To: SQLList >Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY > > >I have two questions about these two functions. > >1.) BOL is really clear on inserting more than one record or triggers -- >I understand the scope issues in those situations. What's not so clear >is multiple users inserting one record at a time. If a stored procedure >inserts a record and then grabs the newly inserted identity value using >@@IDENTITY, is there any chance @@IDENTITY might return a value other >than the right one? Say a number of users are updating the same table at >the same time. UserA inserts identity value x but before the stored >procedure can grab x, UserB inserts identity value y. Is there any >possibility @@IDENTITY will return y to UserA instead of x? Or, does SQL >Server resolve these conflicts internally? > >2.) A single sp inserts two records. In this case, @@IDENTITY and >SCOPE_IDENTITY return the same value -- always the last inserted value. >Right? > >Susan H. > >_______________________________________________ >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 > _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From tuxedo_man at hotmail.com Wed Mar 19 14:12:49 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 19 Mar 2003 20:12:49 +0000 Subject: [dba-SQLServer]Accessing a local file with Query Analyzer Message-ID: How about BULK INSERT? >From: "Porter, Mark" >Reply-To: dba-sqlserver at databaseadvisors.com >To: "'dba-sqlserver at databaseadvisors.com'" > >Subject: RE: [dba-SQLServer]Accessing a local file with Query Analyzer >Date: Tue, 18 Mar 2003 10:24:26 -0900 > >Just tried that - too many indexes on the SS table for either a link or an >import :( > >Mark > >-----Original Message----- >From: Wortz, Charles [mailto:CWortz at tea.state.tx.us] >Sent: Tuesday, March 18, 2003 10:15 AM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Accessing a local file with Query Analyzer > > >Mark, > >If this is a one-time-only thing, then try importing the tables from SS >into Access and running your query with the CSV file either linked or >imported. If this is an on-going operation, then this is not a good way >to go, but it will work. I have one app that once a day downloads >tables from SS into Access and then runs independently of SS for the >rest of the day. > >Charles Wortz >Software Development Division >Texas Education Agency >1701 N. Congress Ave >Austin, TX 78701-1494 >512-463-9493 >CWortz at tea.state.tx.us > > > >-----Original Message----- >From: Porter, Mark [mailto:MPorter at acsalaska.com] >Sent: Tuesday 2003 Mar 18 13:06 >To: 'dba-SQLServer at databaseadvisors.com' >Subject: [dba-SQLServer]Accessing a local file with Query Analyzer > > >Is there a method of accessing a local CSV file and including it in a >query in SQL Analyzer? > >I've done the routine of trying to import the CSV file into the database >and linking to the database with Access to perform the query there and >have failed. I do not have the access to create tables, and there are >too many indexes on the linked tables for Access (dumping them >temporarially is not an option). > >Or, any other ideas? > >Thanks, > >Mark >_______________________________________________ >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. >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From tuxedo_man at hotmail.com Wed Mar 19 14:14:30 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 19 Mar 2003 20:14:30 +0000 Subject: [dba-SQLServer]basic question Message-ID: Look up DBCC CHECKIDENT in BOL Billy >From: "Susan Harkins" >Reply-To: dba-sqlserver at databaseadvisors.com >To: "SQLList" >Subject: [dba-SQLServer]basic question >Date: Tue, 18 Mar 2003 19:39:37 -0500 > >In Access, a compact will reset the AutoNumber seed value to one more than >the largest AN value already in the table. Is there anyway to do this with >an Identity column in SQL Server? > >Susan H. > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From Robert.Djabarov at usaa.com Wed Mar 19 14:23:44 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 19 Mar 2003 14:23:44 -0600 Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBE7@ex02.eagle.usaa.com> @@IDENTITY will have the value of the new identity resulted from the INSERT into the last table affected by this operation initiated directly or indirectly by the current connection, thus - the scope of @@IDENTITY is the connection. SCOPE_IDENTITY() returns the new value of an identity field resulting from the last INSERT operation, thus - the scope of SCOPE_IDENTITY() is the last INSERT statement. This statement can be invoked from a script, stored procedure, trigger, or a function. Connection scope as well as the statement scope stay intact and are hierarchically dependent (statement scope is subordinate to the connection scope). No statement scope can depend on anything other than 1 and only 1 connection. At the same time, no connection can be initiated by anything other than 1 and only 1 login. If a table affected by INSERT statement has an INSERT trigger that in turn inserts into another table with a field defined as IDENTITY(...), @@IDENTITY will contain the last identity value resulted from the trigger execution, while SCOPE_IDENTITY() will still return the identity value of the first table affected by the INSERT statement before the trigger fired. BULK INSERT statement will be treated just like INSERT...SELECT FROM..., if KEEPIDENTITY is not specified. This means that if multiple rows are inserted at the same time, SCOPE_IDENTITY() will have the last identity value generated. So will @@IDENTITY, unless there is a trigger situation described above... I don't think there is anything else that one can say about this "mystery" with identity columns. Don't you think? 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, March 19, 2003 11:55 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY BOL: INDEX KEYWORD @@IDENTITY :What's not so clear is multiple users inserting one record at a time. 1) BOL: @@IDENTITY and SCOPE_IDENTITY will return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value only within the current scope; @@IDENTITY is not limited to a specific scope. That is to say current session = userA. UserB is in his OWN session so you could have Users A, B, C, D, E, F... insert records before user A can run the @@Idenity statement and UserA will still get their own Id back from their own session, not that of userZ. 2)YES -Francisco http://rcm.netfirms.com On Tuesday, March 18, 2003 6:26 PM [GMT-8], Susan Harkins wrote: : I have two questions about these two functions. : : 1.) BOL is really clear on inserting more than one record or triggers : -- I understand the scope issues in those situations. What's not so : clear is multiple users inserting one record at a time. If a stored : procedure inserts a record and then grabs the newly inserted identity : value using @@IDENTITY, is there any chance @@IDENTITY might return a : value other than the right one? Say a number of users are updating : the same table at the same time. UserA inserts identity value x but : before the stored procedure can grab x, UserB inserts identity value : y. Is there any possibility @@IDENTITY will return y to UserA instead : of x? Or, does SQL Server resolve these conflicts internally? : : 2.) A single sp inserts two records. In this case, @@IDENTITY and : SCOPE_IDENTITY return the same value -- always the last inserted : value. Right? : _______________________________________________ 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 Mar 19 14:25:28 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 19 Mar 2003 20:25:28 +0000 Subject: [dba-SQLServer]basic question Message-ID: For example: /* -- cut here -- */ use tempdb begin tran set nocount on create table aaa(aaa_id int identity(1,1), aaa_value char(1)); insert into aaa(aaa_value) values('x') insert into aaa(aaa_value) values('x') insert into aaa(aaa_value) values('x') go select * from aaa go delete from aaa where aaa_id = 3; go declare @i int select @i = max(aaa_id) from aaa DBCC CHECKIDENT(aaa, reseed, @i) go insert into aaa(aaa_value) values('x') insert into aaa(aaa_value) values('x') go select * from aaa set nocount off rollback /* -- cut here -- */ >From: "Billy Pang" >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer]basic question >Date: Wed, 19 Mar 2003 20:14:30 +0000 > >Look up DBCC CHECKIDENT in BOL > >Billy > > >>From: "Susan Harkins" >>Reply-To: dba-sqlserver at databaseadvisors.com >>To: "SQLList" >>Subject: [dba-SQLServer]basic question >>Date: Tue, 18 Mar 2003 19:39:37 -0500 >> >>In Access, a compact will reset the AutoNumber seed value to one more than >>the largest AN value already in the table. Is there anyway to do this with >>an Identity column in SQL Server? >> >>Susan H. >> >>_______________________________________________ >>dba-SQLServer mailing list >>dba-SQLServer at databaseadvisors.com >>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>http://www.databaseadvisors.com >> > > >_________________________________________________________________ >Add photos to your e-mail with MSN 8. Get 2 months FREE*. >http://join.msn.com/?page=features/featuredemail > >_______________________________________________ >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 tuxedo_man at hotmail.com Wed Mar 19 14:39:14 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Wed, 19 Mar 2003 20:39:14 +0000 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) Message-ID: just wondering, this database, did you upsize it from Access using upsizing wizard? also, try running the following in QA: EXEC SP_fkeys @pktable_name = 'THE_TABLE_YOU_ARE_TRYING_TO_DELETE_RECORDS_FROM' Look in the FKTABLE_NAME column for the child tables related to the parent table. HTH Billy >From: David Emerson >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer]Deleting record (Column Reference Constraint) >Date: Thu, 13 Mar 2003 11:23:03 +1300 > >When I run this the results grid show 0 rows affected. This matches with >the table properties in Access which show no check constraints in the >properties window. > >David > >At 12/03/2003, you wrote: >>In QA, I use this script to find constraints on my tables >> >>USE YOURDBNAMEHERE >>Declare @Var as varchar(100) >>SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE' >> >>SELECT constraint_name, >> column_name, >> Table_Name, >> ordinal_position >>FROM information_schema.key_column_usage >>WHERE constraint_catalog = db_name() >> AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + >>@Var >>+'%') >> AND LEFT(CONSTRAINT_NAME,2) = 'FK' >>ORDER BY constraint_name, ordinal_position >> >>-Francisco >>http://rcm.netfirms.com >> >>On Wednesday, March 12, 2003 12:30 PM [GMT-8], >>David Emerson wrote: >> >>: Thanks for your reply. Where do I find the definition reference? >>: >>: At 12/03/2003, you wrote: >>:: The only time I've seen this type of error is when a related record >>:: is going to be deleted. What is the defenition reference for >>:: tblCustInvoiceMeter_FK00? >>:: >>:: -Francisco >>:: http://rcm.netfirms.com >>:: >>:: David Emerson wrote: >>::: AXP/SQL2K >>::: >>::: I have a subform which causes an error message when I delete a >>::: record from it - >>::: >>::: DELETE statement conflicted with COLUMN REFERENCE constraint >>::: 'tblCustInvoiceMeter_FK00'. >>::: >>::: BOL doesn't seem to help. >>::: >>::: There are no related records to the one I am deleting. Can anyone >>::: enlighten me on the problem? >>::: >>::: >>::: Regards >>:: >>:: >>:: _______________________________________________ >>:: 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 >>: >>: _______________________________________________ >>: 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 > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From harkins at iglou.com Wed Mar 19 14:40:35 2003 From: harkins at iglou.com (Susan Harkins) Date: Wed, 19 Mar 2003 15:40:35 -0500 Subject: [dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY References: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBE7@ex02.eagle.usaa.com> Message-ID: <03c001c2ee58$2f94d150$f8ecffcc@SusanOne> > @@IDENTITY will have the value of the new identity resulted from the INSERT into the last table affected by this operation initiated directly or indirectly by the current connection, thus - the scope of @@IDENTITY is the connection. =============Reading BOL, the phrase "the statement" is what I finally went with -- meaning the function won't grab any other identity value outside the statement that created it. Thanks everyone. Susan H. From Robert.Djabarov at usaa.com Wed Mar 19 14:48:46 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 19 Mar 2003 14:48:46 -0600 Subject: [dba-SQLServer]basic question Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBE9@ex02.eagle.usaa.com> I'd have to take back a part of my previous statement about not being able to assign a new SEED number for an identity field. As Billy Pang correctly pointed out, - DBCC CHECKIDENT(...) allows you to reseed the value for the SEED parameter. Thanks Billy. However, INCREMENT parameter cannot be changed without recreating the table. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Djabarov, Robert Sent: Wednesday, March 19, 2003 11:12 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]basic question As far as I know, SET operations require a user to belong at a minimum to db_ddladmin database role, even when it is within the stored procedure that the user is allowed to execute. And also, I don't believe you can alter SEED and INCREMENT properties of an identity field without re-creating the table or removing IDENTITY all together and re-adding it with new values. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: John Frederick [mailto:j.frederick at att.net] Sent: Wednesday, March 19, 2003 8:10 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]basic question I'm don't know what automatic behaviors apply to in identity field, but in SQL Server, you have more control. In code, you can use "SET IDENTITY_INSERT ON" to completely turn off the constraints, enabling you to insert records with unused values corresponding to deleted records. I haven't tried it, but even without this, you might be able to plug new values into the IDENTITY SEED AND IDENTITY INCREMENT properties of the field as long as you didn't create values that violated constraints. -----Original Message----- From: dba-sqlserver-admin at databaseadvisors.com [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Antony, Fredrick Sent: Tuesday, March 18, 2003 11:49 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]basic question No Identity is meant for identical value. There is no way of resetting it Regards Fred -----Original Message----- From: Susan Harkins [mailto:harkins at iglou.com] Sent: Wednesday, March 19, 2003 6:10 AM To: SQLList Subject: [dba-SQLServer]basic question In Access, a compact will reset the AutoNumber seed value to one more than the largest AN value already in the table. Is there anyway to do this with an Identity column in SQL Server? Susan H. _______________________________________________ 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 harkins at iglou.com Wed Mar 19 14:55:17 2003 From: harkins at iglou.com (Susan Harkins) Date: Wed, 19 Mar 2003 15:55:17 -0500 Subject: [dba-SQLServer]basic question References: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBE9@ex02.eagle.usaa.com> Message-ID: <03de01c2ee59$dafe63c0$f8ecffcc@SusanOne> Did you see the response about changing the identity value to no, saving, and then resetting -- worked like a charm. Susan H. > I'd have to take back a part of my previous statement about not being able to assign a new SEED number for an identity field. As Billy Pang correctly pointed out, - DBCC CHECKIDENT(...) allows you to reseed the value for the SEED parameter. Thanks Billy. > > However, INCREMENT parameter cannot be changed without recreating the table. > > Robert Djabarov > Senior SQL Server DBA > USAA IT/DBMS > ? (210) 913-3148 - phone > ? (210) 753-3148 - pager > > -----Original Message----- > From: Djabarov, Robert > Sent: Wednesday, March 19, 2003 11:12 AM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]basic question > > As far as I know, SET operations require a user to belong at a minimum to db_ddladmin database role, even when it is within the stored procedure that the user is allowed to execute. And also, I don't believe you can alter SEED and INCREMENT properties of an identity field without re-creating the table or removing IDENTITY all together and re-adding it with new values. > > Robert Djabarov > Senior SQL Server DBA > USAA IT/DBMS > ? (210) 913-3148 - phone > ? (210) 753-3148 - pager > > -----Original Message----- > From: John Frederick [mailto:j.frederick at att.net] > Sent: Wednesday, March 19, 2003 8:10 AM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]basic question > > I'm don't know what automatic behaviors apply to in identity field, but in > SQL Server, you have more control. In code, you can use "SET > IDENTITY_INSERT ON" to completely turn off the constraints, enabling you to > insert records with unused values corresponding to deleted records. I > haven't tried it, but even without this, you might be able to plug new > values into the IDENTITY SEED AND IDENTITY INCREMENT properties of the field > as long as you didn't create values that violated constraints. > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Antony, > Fredrick > Sent: Tuesday, March 18, 2003 11:49 PM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]basic question > > > No Identity is meant for identical value. There is no way of resetting it > > Regards > Fred > > -----Original Message----- > From: Susan Harkins [mailto:harkins at iglou.com] > Sent: Wednesday, March 19, 2003 6:10 AM > To: SQLList > Subject: [dba-SQLServer]basic question > > > In Access, a compact will reset the AutoNumber seed value to one more than > the largest AN value already in the table. Is there anyway to do this with > an Identity column in SQL Server? > > Susan H. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > From Robert.Djabarov at usaa.com Wed Mar 19 15:29:31 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 19 Mar 2003 15:29:31 -0600 Subject: [dba-SQLServer]basic question Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D24EBBEA@ex02.eagle.usaa.com> Yup, I did, but I chose to ignore it because this answer does not take into account what is going on in the background. If anybody interested, run the Profiler while "resetting" the identity field through the GUI, and you will see what SQL Server actually does in order for you to "think" that it is resetting the field. In reality the server does the following: - creates a new table without the IDENTITY clause for the selected field; - generates all dependent tables, views, functions, stored procedures, and triggers; - inserts all records from the original table; - drops the original table; - renames the new table to the original name; - recompiles all dependent objects from the scripts generated earlier. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Susan Harkins [mailto:harkins at iglou.com] Sent: Wednesday, March 19, 2003 2:55 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]basic question Did you see the response about changing the identity value to no, saving, and then resetting -- worked like a charm. Susan H. > I'd have to take back a part of my previous statement about not being able to assign a new SEED number for an identity field. As Billy Pang correctly pointed out, - DBCC CHECKIDENT(...) allows you to reseed the value for the SEED parameter. Thanks Billy. > > However, INCREMENT parameter cannot be changed without recreating the table. > > Robert Djabarov > Senior SQL Server DBA > USAA IT/DBMS > ? (210) 913-3148 - phone > ? (210) 753-3148 - pager > > -----Original Message----- > From: Djabarov, Robert > Sent: Wednesday, March 19, 2003 11:12 AM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]basic question > > As far as I know, SET operations require a user to belong at a minimum to db_ddladmin database role, even when it is within the stored procedure that the user is allowed to execute. And also, I don't believe you can alter SEED and INCREMENT properties of an identity field without re-creating the table or removing IDENTITY all together and re-adding it with new values. > > Robert Djabarov > Senior SQL Server DBA > USAA IT/DBMS > ? (210) 913-3148 - phone > ? (210) 753-3148 - pager > > -----Original Message----- > From: John Frederick [mailto:j.frederick at att.net] > Sent: Wednesday, March 19, 2003 8:10 AM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]basic question > > I'm don't know what automatic behaviors apply to in identity field, but in > SQL Server, you have more control. In code, you can use "SET > IDENTITY_INSERT ON" to completely turn off the constraints, enabling you to > insert records with unused values corresponding to deleted records. I > haven't tried it, but even without this, you might be able to plug new > values into the IDENTITY SEED AND IDENTITY INCREMENT properties of the field > as long as you didn't create values that violated constraints. > > -----Original Message----- > From: dba-sqlserver-admin at databaseadvisors.com > [mailto:dba-sqlserver-admin at databaseadvisors.com]On Behalf Of Antony, > Fredrick > Sent: Tuesday, March 18, 2003 11:49 PM > To: dba-sqlserver at databaseadvisors.com > Subject: RE: [dba-SQLServer]basic question > > > No Identity is meant for identical value. There is no way of resetting it > > Regards > Fred > > -----Original Message----- > From: Susan Harkins [mailto:harkins at iglou.com] > Sent: Wednesday, March 19, 2003 6:10 AM > To: SQLList > Subject: [dba-SQLServer]basic question > > > In Access, a compact will reset the AutoNumber seed value to one more than > the largest AN value already in the table. Is there anyway to do this with > an Identity column in SQL Server? > > Susan H. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From davide at dalyn.co.nz Thu Mar 20 15:23:27 2003 From: davide at dalyn.co.nz (David Emerson) Date: Fri, 21 Mar 2003 09:23:27 +1200 Subject: [dba-SQLServer]Deleting record (Column Reference Constraint) In-Reply-To: Message-ID: <5.2.0.9.0.20030321091818.00b1c9c0@mail.dalyn.co.nz> I tried deleting a record from within the table itself and it deleted no problem. At 19/03/2003, you wrote: >just wondering, this database, did you upsize it from Access using >upsizing wizard? Yes - It was upsized from A97. >also, try running the following in QA: >EXEC SP_fkeys @pktable_name = >'THE_TABLE_YOU_ARE_TRYING_TO_DELETE_RECORDS_FROM' > >Look in the FKTABLE_NAME column for the child tables related to the parent >table. This shows 1 record (as expected). There are no records in the FKTable related to the record I am trying to delete. I finally solved the problem. I had a sproc as the recordsource. I changed it to a view and it worked. (Thanks for the previous tip Arthur) David Emerson From accessd at brougham.co.uk Sat Mar 22 13:18:26 2003 From: accessd at brougham.co.uk (brougham Baker) Date: Sat, 22 Mar 2003 19:18:26 -0000 Subject: [dba-SQLServer]LISTMASTER MESSAGE- Maintenance for 1 hour Message-ID: <02dc01c2f0a7$d0aeb370$253c98d5@brougham.info> LISTMASTER MESSAGE- Maintenance for 1 hour The Lists will be unavailable for a duration of approximately one hour to allow upgrading of the list software. During this time, the archives and list administration interfaces will be unavailable. Messages will be delayed but your ISP's will retry sending them when the server is available again. Thank you for your cooperation. Brougham From artful at rogers.com Sun Mar 23 17:39:58 2003 From: artful at rogers.com (Arthur Fuller) Date: Sun, 23 Mar 2003 18:39:58 -0500 Subject: [dba-SQLServer]Invoking sprocs with .Net winForms In-Reply-To: <5.2.0.9.0.20030321091818.00b1c9c0@mail.dalyn.co.nz> Message-ID: <006501c2f195$84900f90$8e01a8c0@Rock> I'm only now getting around to this subject, having hitherto used simple SELECTs while I was playing around. Now I want to use sprocs. It seems quite confusing to me. The connection is all set up, and the form with an OleDBDataAdapter, an OleDbConnection and a data set created. Whenever multiple tables are involved, it starts adding dots and an additional table name to various things. I can't make a sproc spit data at all, I just get a row of nulls. Any tips or tricks you can provide here? TIA, Arthur From szeller at cce.umn.edu Mon Mar 24 13:11:10 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Mon, 24 Mar 2003 13:11:10 -0600 Subject: [dba-SQLServer]Clear Selections in a ListBox Message-ID: In a multiselect listbox, what is the best way to clear selections user has made. The recordsource for the listbox is a stored procedure so what I have been doing is on click of a clear list button, I reset the rowsource of the listbox as in: Me.listbox.rowsource = "exec dbo.MySprocName '" & strMyParamter & "'" Is this the best way? Or, should I somehow be looping through the records to see which items are selected and then unselect them? --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 Mon Mar 24 13:22:43 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Mon, 24 Mar 2003 14:22:43 -0500 Subject: [dba-SQLServer]Clear Selections in a ListBox In-Reply-To: Message-ID: <001301c2f23a$c29513d0$73360cd8@hargrove.internal> If you want to save Server/Client resources, you could loop through the listbox and set the SELECTED property of each item to False. The example below will work in Access 2000. Dim lcv as Integer If Me.Listbox.ItemsSelected.Count > 0 Then For lcv = 0 to Me.Listbox.ListCount - 1 If Me.Listbox.Selected(lcv) = True then Me.Listbox.Selected(lcv) = False Next lcv End If Note: If you have header rows turned on, then you will need to start the count at 1. 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: Monday, March 24, 2003 02:11 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Clear Selections in a ListBox In a multiselect listbox, what is the best way to clear selections user has made. The recordsource for the listbox is a stored procedure so what I have been doing is on click of a clear list button, I reset the rowsource of the listbox as in: Me.listbox.rowsource = "exec dbo.MySprocName '" & strMyParamter & "'" Is this the best way? Or, should I somehow be looping through the records to see which items are selected and then unselect them? --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 Mon Mar 24 14:16:00 2003 From: szeller at cce.umn.edu (Susan Zeller) Date: Mon, 24 Mar 2003 14:16:00 -0600 Subject: [dba-SQLServer]Clear Selections in a ListBox Message-ID: Thanks. Just what I was looking for. -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Monday, March 24, 2003 1:23 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Clear Selections in a ListBox If you want to save Server/Client resources, you could loop through the listbox and set the SELECTED property of each item to False. The example below will work in Access 2000. Dim lcv as Integer If Me.Listbox.ItemsSelected.Count > 0 Then For lcv = 0 to Me.Listbox.ListCount - 1 If Me.Listbox.Selected(lcv) = True then Me.Listbox.Selected(lcv) = False Next lcv End If Note: If you have header rows turned on, then you will need to start the count at 1. 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: Monday, March 24, 2003 02:11 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Clear Selections in a ListBox In a multiselect listbox, what is the best way to clear selections user has made. The recordsource for the listbox is a stored procedure so what I have been doing is on click of a clear list button, I reset the rowsource of the listbox as in: Me.listbox.rowsource = "exec dbo.MySprocName '" & strMyParamter & "'" Is this the best way? Or, should I somehow be looping through the records to see which items are selected and then unselect them? --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 tuxedo_man at hotmail.com Mon Mar 24 17:40:00 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Mon, 24 Mar 2003 23:40:00 +0000 Subject: [dba-SQLServer]MSDE - server network library configuration Message-ID: Is it possible to edit the "server network library configuration" without going to "Start menu, point to Programs/Microsoft SQL Server, and then click Server Network Utility"? I am trying to change the port number from 1433 to something else. Thanks in advance Billy _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From artful at rogers.com Tue Mar 25 08:20:58 2003 From: artful at rogers.com (Arthur Fuller) Date: Tue, 25 Mar 2003 09:20:58 -0500 Subject: [dba-SQLServer]Open Letter to MS Help department In-Reply-To: Message-ID: <002801c2f2d9$c12be6a0$8e01a8c0@Rock> Lately I have been researching the SQL-DMO library, so that I can write a tool to backup and restore databases for MSDE installations where Enterprise Manager is not present. Not one of your MSDN examples is complete. You can't cut and paste any of them into a module. They all contain provisos such as ' creation of the oSQLServer object is not covered here oSQLServer.DoSomething Which means that you have to go look up the SQLServer object and find an example of how to create it, then copy and paste that into your current code. It's not that big a deal: one line to declare it and another to instantiate it -- but that's precisely the point! Are you so short of cash and/or time that you can't add a couple of lines to the examples so they work? And even these examples are not installed, unless you specifically install them -- which means go find the CD, navigate to the samples directory and copy the relevant subdirs. All is not lost, however. Turns out that google is the best way to search this stuff. Type a propertyname such as RelocateFiles into google and you get some meaningful and instructive hits -- unlike the MSDN docs or the "help" files. Your friend, Arthur "If you think education is expensive, try ignorance." -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Billy Pang Sent: March 24, 2003 6:40 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]MSDE - server network library configuration Is it possible to edit the "server network library configuration" without going to "Start menu, point to Programs/Microsoft SQL Server, and then click Server Network Utility"? I am trying to change the port number from 1433 to something else. Thanks in advance Billy _________________________________________________________________ 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 Robert.Djabarov at usaa.com Tue Mar 25 09:19:54 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 25 Mar 2003 09:19:54 -0600 Subject: [dba-SQLServer]MSDE - server network library configuration Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABEBF@ex02.eagle.usaa.com> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\\MSSQLServer\SuperSocketNetLib Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: Billy Pang [mailto:tuxedo_man at hotmail.com] Sent: Monday, March 24, 2003 5:40 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]MSDE - server network library configuration Is it possible to edit the "server network library configuration" without going to "Start menu, point to Programs/Microsoft SQL Server, and then click Server Network Utility"? I am trying to change the port number from 1433 to something else. Thanks in advance Billy _________________________________________________________________ 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 mikedorism at ntelos.net Tue Mar 25 13:40:05 2003 From: mikedorism at ntelos.net (Mike and Doris Manning) Date: Tue, 25 Mar 2003 14:40:05 -0500 Subject: [dba-SQLServer]Need to create PDF Print Server Message-ID: <00db01c2f306$60c34b00$493a0cd8@hargrove.internal> We would like to create our own version of a PDF Print Server. Basically, we want to pass information (report name, parameters, requestor name) to our SQL Server via a sproc. We then want SQL Server to generate a PDF file which will then be stored in a designated place on the network for pick up by the calling program. Getting the info to SQL and generating the PDF is already handled. Figuring out how to tell SQL Server when there is info to be processed is the issue we are trying to make a decision on. My thoughts so far are: 1) Create an Insert Trigger that fires a DTS ActiveX script to open an Access session (if not already open), process anything in the file and shut down when there are no requests. Question here is when control would return to calling program? 2) Create a DTS schedule to start up a "monitoring" database which would operate during normal business hours. Question here is how to handle after-hour needs. Does anybody have any thoughts or suggestions? Mike and Doris Manning mikedorism at ntelos.net manning7 at shentel.net -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3524 bytes Desc: not available URL: From tuxedo_man at hotmail.com Tue Mar 25 15:02:32 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Tue, 25 Mar 2003 21:02:32 +0000 Subject: [dba-SQLServer]International dates, dateformat, cast and convert Message-ID: Just thought I share a SS2K tip of the day for today with everybody: It is really important for text dates to be EXPLICITLY convert into datetime datatype when first concatenating dates in text (especially when working in international environment)... See below: /* -- cut here -- */ /* for example, display the first of next month */ SET NOCOUNT ON SET DATEFORMAT YMD -- returns 2003-04-01 (with no convert style) SELECT CAST(CONVERT(VARCHAR(7), DATEADD(m,1,GETDATE()), 111) + '/01' AS DATETIME) -- returns 2003-04-01 (with convert style) SELECT CONVERT(DATETIME, CONVERT(VARCHAR(7), DATEADD(m,1,GETDATE()), 111) + '/01', 111) SET DATEFORMAT YDM -- returns 2003-01-04 (again with no convert style) SELECT CAST(CONVERT(VARCHAR(7), DATEADD(m,1,GETDATE()), 111) + '/01' AS DATETIME) -- returns 2003-04-01 (with convert style) SELECT CONVERT(DATETIME, CONVERT(VARCHAR(7), DATEADD(m,1,GETDATE()), 111) + '/01', 111) SET NOCOUNT OFF /* -- cut here -- */ Billy _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From my.lists at verizon.net Tue Mar 25 17:53:11 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 25 Mar 2003 15:53:11 -0800 Subject: [dba-SQLServer]Open Letter to MS Help department References: <002801c2f2d9$c12be6a0$8e01a8c0@Rock> Message-ID: <00ce01c2f329$b1e2ba70$b615010a@FHTAPIA> Arthur, There is code that you can use by downloading all the source from the following link http://www.asql.biz/DbaMgr.shtm For those workstations w/ MSDE this is an alternative to using EM to manage the database :D there is more SQL-DMO info at http://www.sqldev.net/ http://www.sqlmag.com/Articles/Index.cfm?ArticleID=8804 HTHs -Francisco http://rcm.netfirms.com On Tuesday, March 25, 2003 6:20 AM [GMT-8], Arthur Fuller wrote: : Lately I have been researching the SQL-DMO library, so that I can : write a tool to backup and restore databases for MSDE installations : where Enterprise Manager is not present. Not one of your MSDN : examples is complete. You can't cut and paste any of them into a : module. They all contain provisos such as : : ' creation of the oSQLServer object is not covered here : oSQLServer.DoSomething : : Which means that you have to go look up the SQLServer object and find : an example of how to create it, then copy and paste that into your : current code. It's not that big a deal: one line to declare it and : another to instantiate it -- but that's precisely the point! Are you : so short of cash and/or time that you can't add a couple of lines to : the examples so they work? And even these examples are not installed, : unless you specifically install them -- which means go find the CD, : navigate to the samples directory and copy the relevant subdirs. : : All is not lost, however. Turns out that google is the best way to : search this stuff. Type a propertyname such as RelocateFiles into : google and you get some meaningful and instructive hits -- unlike the : MSDN docs or the "help" files. : : Your friend, : Arthur : : "If you think education is expensive, try ignorance." : : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Billy Pang Sent: March 24, 2003 6:40 PM : To: dba-SQLServer at databaseadvisors.com : Subject: [dba-SQLServer]MSDE - server network library configuration : : : Is it possible to edit the "server network library configuration" : without going to : "Start menu, point to Programs/Microsoft SQL Server, and then click : Server Network Utility"? : : I am trying to change the port number from 1433 to something else. : : Thanks in advance : Billy : : _________________________________________________________________ : 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 From jcolby at ColbyConsulting.com Wed Mar 26 13:13:48 2003 From: jcolby at ColbyConsulting.com (John W. Colby) Date: Wed, 26 Mar 2003 14:13:48 -0500 Subject: [dba-SQLServer]Upsizing just the FE Message-ID: Is there a way to upsize just the FE? IOW, convert the queries for the objects such as combos and forms to parameterized stored procedures? Any wizards to assist in that? I did not save my SQL strings in my forms and combos etc to saved queries, in fact I upsized the BE directly. I am now trying to upsize the FE and what PITA that is! There are probably over a hundred queries just in the combos and forms, never mind built up on the fly. I am nowhere close to fluent enough in the SQL syntax used in SQL Server to just type them back in into stored procedures, complete with parameters. John W. Colby Colby Consulting www.ColbyConsulting.com ---------------------------------------------------- Is email taking over your day? Manage your time with eMailBoss. Try it free! http://www.eMailBoss.com From Robert.Djabarov at usaa.com Wed Mar 26 13:42:16 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Wed, 26 Mar 2003 13:42:16 -0600 Subject: [dba-SQLServer]Upsizing just the FE Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABED4@ex02.eagle.usaa.com> Run Profiler and save output to a file. There will be a lot of copy/paste operations, but you'll have everything right there. Robert Djabarov Senior SQL Server DBA USAA IT/DBMS ? (210) 913-3148 - phone ? (210) 753-3148 - pager -----Original Message----- From: John W. Colby [mailto:jcolby at colbyconsulting.com] Sent: Wednesday, March 26, 2003 1:14 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Upsizing just the FE Is there a way to upsize just the FE? IOW, convert the queries for the objects such as combos and forms to parameterized stored procedures? Any wizards to assist in that? I did not save my SQL strings in my forms and combos etc to saved queries, in fact I upsized the BE directly. I am now trying to upsize the FE and what PITA that is! There are probably over a hundred queries just in the combos and forms, never mind built up on the fly. I am nowhere close to fluent enough in the SQL syntax used in SQL Server to just type them back in into stored procedures, complete with parameters. John W. Colby Colby Consulting www.ColbyConsulting.com ---------------------------------------------------- Is email taking over your day? Manage your time with eMailBoss. Try it free! http://www.eMailBoss.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jcolby at ColbyConsulting.com Thu Mar 27 20:57:59 2003 From: jcolby at ColbyConsulting.com (John W. Colby) Date: Thu, 27 Mar 2003 21:57:59 -0500 Subject: [dba-SQLServer]MSDE Replication - Crossposted Message-ID: On a related note... MDSE claims to support replication. I don't know enough about MDSE, never mind replication, to understand the issues - but... If each workstation ran MSDE and the server runs MSDE, then you have effectively created SQL Server for more than "5 simultaneous users". Since each user is now hitting a SQL Server Be on their own machine, with only replication data going to the main BE on the server, it certainly sounds like you could get fairly decent performance for 10 or 20 users. John W. Colby Colby Consulting www.ColbyConsulting.com ---------------------------------------------------- Is email taking over your day? Manage your time with eMailBoss. Try it free! http://www.eMailBoss.com From hagdb at hotmail.com Thu Mar 27 22:54:01 2003 From: hagdb at hotmail.com (howard gramer) Date: Thu, 27 Mar 2003 23:54:01 -0500 Subject: [dba-SQLServer]MSDE Replication - Crossposted References: Message-ID: For what it's worth..not sure what it means: A2KDH Volume 2: Enterprise Edition, pg.159 It states specifically about MSDE: "Can only be a replication subscriber, not a publisher" howard ----- Original Message ----- From: "John W. Colby" To: "AccessD" Cc: "SQLServer" Sent: Thursday, March 27, 2003 9:57 PM Subject: [dba-SQLServer]MSDE Replication - Crossposted > On a related note... > > MDSE claims to support replication. I don't know enough about MDSE, never > mind replication, to understand the issues - but... > > If each workstation ran MSDE and the server runs MSDE, then you have > effectively created SQL Server for more than "5 simultaneous users". Since > each user is now hitting a SQL Server Be on their own machine, with only > replication data going to the main BE on the server, it certainly sounds > like you could get fairly decent performance for 10 or 20 users. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com From my.lists at verizon.net Thu Mar 27 23:04:05 2003 From: my.lists at verizon.net (Francisco Tapia) Date: Thu, 27 Mar 2003 21:04:05 -0800 Subject: [dba-SQLServer]MSDE Replication - Crossposted References: Message-ID: <005301c2f4e7$75ebde10$0eb62904@amd2k> This is true, and in MSDE 2 (or sql server desktop) IIRC it 'can' be a publisher. Now if you are working w/ MSDE 1, I don't think the system can be a publisher then.... and you are not allowed to use transactional replication in MSDE's that I remember... but you still have merge and snapshot replication available to you... one thing I never liked about Sql Server replication is that having 2 pc's on the same network side be side, a merge replication transaction took over 2 minutes to replicate between the machines :O, not only that ALL of MS's documentation tells you that the processes of "when" the data gets there is not timmed that is to say the data gets there when it gets there, if the server is busy doing many other tasks it could be well over the two minutes before you see ANY data come accross... With my tests it ranged anywhere between 2 minutes up to 14 minutes, this of course was in a classroom setting but still the jist is the same in real life I'm sure. A thing about merge replication technique is that you must set up conflict resolution that is, if machine A is the publisher and Machine B is the subscriber and both have changes then the effective change that is kept is that of the publisher, NOT the one that made the change last. -Francisco http://rcm.netfirms.com/ On Thursday, March 27, 2003 6:57 PM [GMT -8], John W. Colby wrote: : On a related note... : : MDSE claims to support replication. I don't know enough about MDSE, : never mind replication, to understand the issues - but... : : If each workstation ran MSDE and the server runs MSDE, then you have : effectively created SQL Server for more than "5 simultaneous users". : Since each user is now hitting a SQL Server Be on their own machine, : with only replication data going to the main BE on the server, it : certainly sounds like you could get fairly decent performance for 10 : or 20 users. : : John W. Colby : Colby Consulting : www.ColbyConsulting.com : : ---------------------------------------------------- : Is email taking over your day? Manage your time with eMailBoss. : Try it free! http://www.eMailBoss.com : : : _______________________________________________ : dba-SQLServer mailing list : dba-SQLServer at databaseadvisors.com : http://databaseadvisors.com/mailman/listinfo/dba-sqlserver : http://www.databaseadvisors.com From jcolby at ColbyConsulting.com Fri Mar 28 10:11:04 2003 From: jcolby at ColbyConsulting.com (John W. Colby) Date: Fri, 28 Mar 2003 11:11:04 -0500 Subject: [dba-SQLServer] MDB Replication and Upsizing to SQL Server - Crossposted Message-ID: One question I forgot to ask. How does replication affect the upsizing to SQL Server? I tried replication once long ago and seem to remember being unable to directly upsize anymore due to the random autonumber PK. SQL Server (or the upsize wizard) didn't know how to handle that, so I had to build queries to get back a straight autonumber before upsizing. Does anyone know whether a random autonumber PK can be upsized to SQL Server now? John W. Colby Colby Consulting www.ColbyConsulting.com ---------------------------------------------------- Is email taking over your day? Manage your time with eMailBoss. Try it free! http://www.eMailBoss.com From accessd at shaw.ca Sat Mar 29 12:20:58 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Sat, 29 Mar 2003 10:20:58 -0800 Subject: [dba-SQLServer];OT log files In-Reply-To: <00ce01c2f329$b1e2ba70$b615010a@FHTAPIA> Message-ID: Hi All: This is a totally off topic question but I am sure a few individuals knows the good solutions. Is there any inexpensive solution to monitoring the log files on my server...these are the remote access log files not the log event files. TIA Jim From artful at rogers.com Sun Mar 30 13:22:32 2003 From: artful at rogers.com (Arthur Fuller) Date: Sun, 30 Mar 2003 14:22:32 -0500 Subject: [dba-SQLServer]Very odd problem In-Reply-To: Message-ID: <032701c2f6f1$b639d5b0$8e01a8c0@Rock> I have written a tool that assumes you do not have Enterprise Manager aboard. I run the following command from said tool: RESTORE DATABASE ETS_SQL_27Sep02 FROM DISK = 'E:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\ETS_SQL_27Sep02.bkp' WITH MOVE 'ETS_SQL_dat' TO 'f:\mssql7\data\ETS_SQL_27Sep02.mdf', MOVE 'ETS_SQL_log' TO 'f:\mssql7\data\ETS_SQL_27Sep02_log.ldf' Substitute into this your variables of choice. If I run this from Query Analyzer it works. If I run this from my ADP it fails on a timeout error. I don't get it. The bak file in question is > 300 MB. So what? Why would it work from QA and not from Access ADP? This is a crippler. Advice, suggestions, spare Euros gratefully accepted :-) Arthur From tuxedo_man at hotmail.com Sun Mar 30 14:14:03 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Sun, 30 Mar 2003 20:14:03 +0000 Subject: [dba-SQLServer]Very odd problem Message-ID: Do you have any other open connections to ETS_SQL_27Sep02? you cannot restore a db while it is still in use Billy >From: "Arthur Fuller" >Reply-To: artful at rogers.com, dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]Very odd problem >Date: Sun, 30 Mar 2003 14:22:32 -0500 > >I have written a tool that assumes you do not have Enterprise Manager >aboard. I run the following command from said tool: > >RESTORE DATABASE ETS_SQL_27Sep02 >FROM DISK = 'E:\Program Files\Microsoft SQL >Server\MSSQL\BACKUP\ETS_SQL_27Sep02.bkp' >WITH MOVE 'ETS_SQL_dat' TO 'f:\mssql7\data\ETS_SQL_27Sep02.mdf', >MOVE 'ETS_SQL_log' TO 'f:\mssql7\data\ETS_SQL_27Sep02_log.ldf' > >Substitute into this your variables of choice. > >If I run this from Query Analyzer it works. If I run this from my ADP it >fails on a timeout error. I don't get it. The bak file in question is > 300 >MB. So what? Why would it work from QA and not from Access ADP? > >This is a crippler. Advice, suggestions, spare Euros gratefully accepted >:-) > >Arthur > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From Robert.Djabarov at usaa.com Mon Mar 31 08:49:45 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Mon, 31 Mar 2003 08:49:45 -0600 Subject: [dba-SQLServer]Very odd problem Message-ID: <5A31F89EC4C79B49B5030FF2EF58E9D202DABEF7@ex02.eagle.usaa.com> Check QueryTimeout property of your connection object. 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: Sunday, March 30, 2003 1:23 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]Very odd problem I have written a tool that assumes you do not have Enterprise Manager aboard. I run the following command from said tool: RESTORE DATABASE ETS_SQL_27Sep02 FROM DISK = 'E:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\ETS_SQL_27Sep02.bkp' WITH MOVE 'ETS_SQL_dat' TO 'f:\mssql7\data\ETS_SQL_27Sep02.mdf', MOVE 'ETS_SQL_log' TO 'f:\mssql7\data\ETS_SQL_27Sep02_log.ldf' Substitute into this your variables of choice. If I run this from Query Analyzer it works. If I run this from my ADP it fails on a timeout error. I don't get it. The bak file in question is > 300 MB. So what? Why would it work from QA and not from Access ADP? This is a crippler. Advice, suggestions, spare Euros gratefully accepted :-) Arthur _______________________________________________ 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 Mar 31 10:12:45 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 31 Mar 2003 08:12:45 -0800 Subject: [dba-SQLServer];OT log files References: Message-ID: <002201c2f7a0$5deb87a0$b615010a@FHTAPIA> do you mean the .ldf files?, and are you trying to monitor how big they get? or ???, you can set an alert to fire off and send you email, net send you, page you or all 3. I have alerts set up on my production db's that when the log file reaches 60% it auto backs up and lets me know via netsend that this event happend. -Francisco http://rcm.netfirms.com On Saturday, March 29, 2003 10:20 AM [GMT-8], Jim Lawrence (AccessD) wrote: : Hi All: : : This is a totally off topic question but I am sure a few individuals : knows the good solutions. : : Is there any inexpensive solution to monitoring the log files on my : server...these are the remote access log files not the log event : files. : : TIA : Jim : _______________________________________________ : 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 Mar 31 10:55:02 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 31 Mar 2003 08:55:02 -0800 Subject: [dba-SQLServer] Fix what the wizards miss when you upsize Access apps to SQL Server Message-ID: <002e01c2f7a6$4622e900$b615010a@FHTAPIA> For those of you upsizing your Access Db's here is a great article to go by when you stick to the wizards... :D and it's written by none other than resident Arthur Fuller :D (watch for wrap) http://www.techrepublic.com/article.jhtml?id=r00720030331afu01.htm&fromtm=e0 19 tinyURL http://tinyurl.com/8iq7 -Francisco http://rcm.netfirms.com From artful at rogers.com Mon Mar 31 14:25:01 2003 From: artful at rogers.com (Arthur Fuller) Date: Mon, 31 Mar 2003 15:25:01 -0500 Subject: [dba-SQLServer]Fix what the wizards miss when you upsize Access apps to SQL Server In-Reply-To: <002e01c2f7a6$4622e900$b615010a@FHTAPIA> Message-ID: <00bd01c2f7c3$9b6fe440$8e01a8c0@Rock> Thanks for the PR! You are now officially in charge of finding my next gig. Arthur "Those who would sacrifice liberty for security deserve neither." -- Benjamin Franklin -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: March 31, 2003 11:55 AM To: AccessD; dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Fix what the wizards miss when you upsize Access apps to SQL Server For those of you upsizing your Access Db's here is a great article to go by when you stick to the wizards... :D and it's written by none other than resident Arthur Fuller :D (watch for wrap) http://www.techrepublic.com/article.jhtml?id=r00720030331afu01.htm&fromtm=e0 19 From my.lists at verizon.net Mon Mar 31 15:12:25 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 31 Mar 2003 13:12:25 -0800 Subject: [dba-SQLServer]Fix what the wizards miss when you upsize Accessapps to SQL Server References: <00bd01c2f7c3$9b6fe440$8e01a8c0@Rock> Message-ID: <00a601c2f7ca$3b1d5df0$b615010a@FHTAPIA> lets not be too hasty ;o), I'm only in charge of making 10% off the commission ;o) -Francisco http://rcm.netfirms.com On Monday, March 31, 2003 12:25 PM [GMT-8], Arthur Fuller wrote: : Thanks for the PR! You are now officially in charge of finding my : next gig. : : Arthur : : "Those who would sacrifice liberty for security deserve neither." : -- Benjamin Franklin : : -----Original Message----- : From: dba-sqlserver-bounces at databaseadvisors.com : [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of : Francisco H Tapia : Sent: March 31, 2003 11:55 AM : To: AccessD; dba-SQLServer at databaseadvisors.com : Subject: [dba-SQLServer]Fix what the wizards miss when you upsize : Access apps to SQL Server : : : For those of you upsizing your Access Db's here is a great article to : go by when you stick to the wizards... :D and it's written by none : other than resident Arthur Fuller :D : : (watch for wrap) : : http://www.techrepublic.com/article.jhtml?id=r00720030331afu01.htm&fromtm=e0 : 19 : From harkins at iglou.com Mon Mar 31 15:20:55 2003 From: harkins at iglou.com (Susan Harkins) Date: Mon, 31 Mar 2003 16:20:55 -0500 Subject: [dba-SQLServer]Fix what the wizards miss when you upsizeAccessapps to SQL Server References: <00bd01c2f7c3$9b6fe440$8e01a8c0@Rock> <00a601c2f7ca$3b1d5df0$b615010a@FHTAPIA> Message-ID: <016401c2f7cb$7b57f960$dae6ffcc@SusanOne> Agents! Who needs em! :) Susan H. > lets not be too hasty ;o), I'm only in charge of making 10% off the > commission ;o) > > -Francisco From artful at rogers.com Mon Mar 31 19:24:31 2003 From: artful at rogers.com (Arthur Fuller) Date: Mon, 31 Mar 2003 20:24:31 -0500 Subject: [dba-SQLServer]Fix what the wizards miss when youupsizeAccessapps to SQL Server In-Reply-To: <016401c2f7cb$7b57f960$dae6ffcc@SusanOne> Message-ID: <015d01c2f7ed$721f29f0$8e01a8c0@Rock> Raymond Chandler wrote a great piece (collected in several books) called "Ten Percent of Your Life." A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: March 31, 2003 4:21 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Fix what the wizards miss when youupsizeAccessapps to SQL Server Agents! Who needs em! :) Susan H. > lets not be too hasty ;o), I'm only in charge of making 10% off the > commission ;o) > > -Francisco _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com