From my.lists at verizon.net Mon Dec 1 12:35:57 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 01 Dec 2003 10:35:57 -0800 Subject: [dba-SQLServer]Slow Sproc execution In-Reply-To: <5.2.0.9.0.20031128191614.00b2f488@mail.dalyn.co.nz> References: <5.2.0.9.0.20031128191614.00b2f488@mail.dalyn.co.nz> Message-ID: <3FCB8A0D.3010907@verizon.net> try to use static sql instead of dynamic and you'll see the speed improve as well. Additionally what is your query execution time. -- -Francisco David Emerson wrote: > I have a sproc that has a couple of where statements in it. If I only > include 1 statement then the sproc runs within a second and returns > about 128 records. If I include both statements then it takes about 40 > seconds. Using the SQL Profiler the single statements record approx > 8950 reads but with both included the SQL Profiler records approx 136000 > reads. There seems to be a need for SQL to pass through the records > several times yet the comparisons are both in the same table. My > problem is how to reduce the time taken to run the sproc. Here is the > code - > > ALTER PROCEDURE sprptAgedDebtor > ( > @txtAged1Dte nvarchar(20), > @txtAged2Dte nvarchar(20), > @bitDD bit, > @bitDDFreq varchar(1) > ) > AS > SET NOCOUNT ON > > --The next line creates a view. The resulting view has about > 13000 records in it > exec spvwAgedDebtorGetLastStatDate @txtAged1Dte, @txtAged2Dte > > declare @qs varchar(8000) > > SELECT @qs = ' > SELECT dbo.vwAgedDebtorGet.CustomerID, > dbo.vwAgedDebtorGet.AccountNo, dbo.vwAgedDebtorGet.CustName, > dbo.vwAgedDebtorGet.StatementDate, > dbo.vwAgedDebtorGet.StatementNumber, > dbo.vwAgedDebtorGet.AccFreq, > dbo.vwAgedDebtorGet.CurrentMth, dbo.vwAgedDebtorGet.OneMonth, > dbo.vwAgedDebtorGet.TwoMonths, > dbo.vwAgedDebtorGet.ThreeMonths, > dbo.vwAgedDebtorReceipt.CNReceipts, > dbo.vwAgedDebtorReceipt.Receipts, dbo.vwAgedDebtorGet.MGrpIDNo, > dbo.vwAgedDebtorGet.DDRegistered, > dbo.vwAgedDebtorGet.DDFrequency > FROM dbo.vwAgedDebtorGet INNER JOIN > dbo.vwAgedDebtorGetLastStatDate ON dbo.vwAgedDebtorGet.CustomerID = > dbo.vwAgedDebtorGetLastStatDate.CustIDNo AND > dbo.vwAgedDebtorGet.StatementDate = > dbo.vwAgedDebtorGetLastStatDate.StatementDate LEFT OUTER > JOIN dbo.vwAgedDebtorReceipt ON > dbo.vwAgedDebtorGet.CustomerID = > dbo.vwAgedDebtorReceipt.CustIDNo AND > dbo.vwAgedDebtorGet.StatementNumber = > dbo.vwAgedDebtorReceipt.StatNum ' > IF @bitDD = 1 > BEGIN > SELECT @qs = @qs + 'WHERE > (dbo.vwAgedDebtorGet.DDFrequency = ' + @bitDDFreq + ')' > END > IF @bitDDFreq <> '0' > BEGIN -- @bitDD will always be 1 if @bitDDFreq <> '0' > SELECT @qs = @qs + ' AND > (dbo.vwAgedDebtorGet.DDRegistered = 1) ' > END > > EXEC (@qs) > > > > Regards > > David Emerson > Dalyn Software Ltd > 25 Cunliffe St, Churton Park > Wellington, New Zealand > Ph/Fax (877) 456-1205 _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From davide at dalyn.co.nz Mon Dec 1 12:41:13 2003 From: davide at dalyn.co.nz (David Emerson) Date: Tue, 02 Dec 2003 07:41:13 +1300 Subject: [dba-SQLServer]Slow Sproc execution In-Reply-To: <3FCB8A0D.3010907@verizon.net> References: <5.2.0.9.0.20031128191614.00b2f488@mail.dalyn.co.nz> <5.2.0.9.0.20031128191614.00b2f488@mail.dalyn.co.nz> Message-ID: <5.2.0.9.0.20031202073552.00b7fb10@mail.dalyn.co.nz> I ended up creating a temporary table for the first part and then creating a dynamic sql applying the where clause using the table. Changed the time from 40 sec to about 2. How could I create a static sql when the filters to be included depend on the parameters passed in. Regards David Emerson Dalyn Software Ltd 25 Cunliffe St, Churton Park Wellington, New Zealand Ph/Fax (877) 456-1205 At 1/12/2003, you wrote: >try to use static sql instead of dynamic and you'll see the speed improve >as well. Additionally what is your query execution time. > >-Francisco > >David Emerson wrote: > >>I have a sproc that has a couple of where statements in it. If I only >>include 1 statement then the sproc runs within a second and returns about >>128 records. If I include both statements then it takes about 40 >>seconds. Using the SQL Profiler the single statements record approx 8950 >>reads but with both included the SQL Profiler records approx 136000 >>reads. There seems to be a need for SQL to pass through the records >>several times yet the comparisons are both in the same table. My problem >>is how to reduce the time taken to run the sproc. Here is the code - >>ALTER PROCEDURE sprptAgedDebtor >> ( >> @txtAged1Dte nvarchar(20), >> @txtAged2Dte nvarchar(20), >> @bitDD bit, >> @bitDDFreq varchar(1) >> ) >>AS >> SET NOCOUNT ON >> --The next line creates a view. The resulting view has about >> 13000 records in it >> exec spvwAgedDebtorGetLastStatDate @txtAged1Dte, @txtAged2Dte >> declare @qs varchar(8000) >>SELECT @qs = ' >> SELECT dbo.vwAgedDebtorGet.CustomerID, >> dbo.vwAgedDebtorGet.AccountNo, dbo.vwAgedDebtorGet.CustName, >> dbo.vwAgedDebtorGet.StatementDate, >> dbo.vwAgedDebtorGet.StatementNumber, >> dbo.vwAgedDebtorGet.AccFreq, >> dbo.vwAgedDebtorGet.CurrentMth, dbo.vwAgedDebtorGet.OneMonth, >> dbo.vwAgedDebtorGet.TwoMonths, >> dbo.vwAgedDebtorGet.ThreeMonths, >> dbo.vwAgedDebtorReceipt.CNReceipts, >> dbo.vwAgedDebtorReceipt.Receipts, dbo.vwAgedDebtorGet.MGrpIDNo, >> dbo.vwAgedDebtorGet.DDRegistered, >> dbo.vwAgedDebtorGet.DDFrequency >> FROM dbo.vwAgedDebtorGet INNER JOIN >> dbo.vwAgedDebtorGetLastStatDate ON dbo.vwAgedDebtorGet.CustomerID = >> dbo.vwAgedDebtorGetLastStatDate.CustIDNo AND >> dbo.vwAgedDebtorGet.StatementDate = >> dbo.vwAgedDebtorGetLastStatDate.StatementDate LEFT OUTER >> JOIN dbo.vwAgedDebtorReceipt ON >> dbo.vwAgedDebtorGet.CustomerID = >> dbo.vwAgedDebtorReceipt.CustIDNo AND >> dbo.vwAgedDebtorGet.StatementNumber = >> dbo.vwAgedDebtorReceipt.StatNum ' >>IF @bitDD = 1 >> BEGIN >> SELECT @qs = @qs + 'WHERE >> (dbo.vwAgedDebtorGet.DDFrequency = ' + @bitDDFreq + ')' >> END >>IF @bitDDFreq <> '0' >> BEGIN -- @bitDD will always be 1 if @bitDDFreq <> '0' >> SELECT @qs = @qs + ' AND >> (dbo.vwAgedDebtorGet.DDRegistered = 1) ' >> END >>EXEC (@qs) >> >>Regards >>David Emerson >>Dalyn Software Ltd >>25 Cunliffe St, Churton Park >>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 my.lists at verizon.net Mon Dec 1 13:27:13 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 01 Dec 2003 11:27:13 -0800 Subject: [dba-SQLServer]Slow Sproc execution In-Reply-To: <5.2.0.9.0.20031202073552.00b7fb10@mail.dalyn.co.nz> References: <5.2.0.9.0.20031128191614.00b2f488@mail.dalyn.co.nz> <5.2.0.9.0.20031128191614.00b2f488@mail.dalyn.co.nz> <5.2.0.9.0.20031202073552.00b7fb10@mail.dalyn.co.nz> Message-ID: <3FCB9611.80504@verizon.net> This is one way, additionally looking at your sample code it looks like you're not really using temp tables at all, instead you've created a view to temporary use. why not use "real" temp tables, that way you don't have recreate views all the time w/ that sproc anymore... instead you create a temporary table with the subset of data you wanted, it gets stored for the duration of the sproc and you'd only be making the call once not twice to the source tables as your sample seems to indicate. ALTER PROCEDURE sprptAgedDebtor ( @txtAged1Dte nvarchar(20), @txtAged2Dte nvarchar(20), @bitDD bit, @bitDDFreq varchar(1) ) AS -- SET NOCOUNT ON -- --The next line creates a view. The resulting view has about 13000 records in it -- exec spvwAgedDebtorGetLastStatDate @txtAged1Dte, @txtAged2Dte -- declare @qs varchar(8000) CREATE TABLE #AgedDebtorGet (Column1 [int] Null, Column2 [int] Null, Column3 [varchar] (255) Null ) INSERT INTO #AgedDebtorGet --SELECT statement w/ Dates IF @bitDD = 1 AND @bitDDFreq <> '0' BEGIN SELECT * FROM #AgedDebtorGet WHERE (#vwAgedDebtorGet.DDFrequency = @bitDDFreq ) AND (#vwAgedDebtorGet.DDRegistered = 1) END ELSE IF @bitDD = 1 AND @bitDDFreq = '0' BEGIN SELECT * FROM #AgedDebtorGet WHERE (#vwAgedDebtorGet.DDFrequency = @bitDDFreq ) END They live for the duration of your sproc. Please note that you'll actually have to re-do the #TempTable to the appropriate columns -- -Francisco David Emerson wrote: > I ended up creating a temporary table for the first part and then > creating a dynamic sql applying the where clause using the table. > Changed the time from 40 sec to about 2. > > How could I create a static sql when the filters to be included depend > on the parameters passed in. > > Regards > > David Emerson > Dalyn Software Ltd > 25 Cunliffe St, Churton Park > Wellington, New Zealand > Ph/Fax (877) 456-1205 > > At 1/12/2003, you wrote: > >> try to use static sql instead of dynamic and you'll see the speed >> improve as well. Additionally what is your query execution time. >> >> -Francisco >> >> David Emerson wrote: >> >>> I have a sproc that has a couple of where statements in it. If I >>> only include 1 statement then the sproc runs within a second and >>> returns about 128 records. If I include both statements then it >>> takes about 40 seconds. Using the SQL Profiler the single statements >>> record approx 8950 reads but with both included the SQL Profiler >>> records approx 136000 reads. There seems to be a need for SQL to >>> pass through the records several times yet the comparisons are both >>> in the same table. My problem is how to reduce the time taken to run >>> the sproc. Here is the code - >>> ALTER PROCEDURE sprptAgedDebtor >>> ( >>> @txtAged1Dte nvarchar(20), >>> @txtAged2Dte nvarchar(20), >>> @bitDD bit, >>> @bitDDFreq varchar(1) >>> ) >>> AS >>> SET NOCOUNT ON >>> --The next line creates a view. The resulting view has about >>> 13000 records in it >>> exec spvwAgedDebtorGetLastStatDate @txtAged1Dte, @txtAged2Dte >>> declare @qs varchar(8000) >>> SELECT @qs = ' >>> SELECT dbo.vwAgedDebtorGet.CustomerID, >>> dbo.vwAgedDebtorGet.AccountNo, dbo.vwAgedDebtorGet.CustName, >>> dbo.vwAgedDebtorGet.StatementDate, >>> dbo.vwAgedDebtorGet.StatementNumber, >>> dbo.vwAgedDebtorGet.AccFreq, >>> dbo.vwAgedDebtorGet.CurrentMth, dbo.vwAgedDebtorGet.OneMonth, >>> dbo.vwAgedDebtorGet.TwoMonths, >>> dbo.vwAgedDebtorGet.ThreeMonths, >>> dbo.vwAgedDebtorReceipt.CNReceipts, >>> dbo.vwAgedDebtorReceipt.Receipts, dbo.vwAgedDebtorGet.MGrpIDNo, >>> dbo.vwAgedDebtorGet.DDRegistered, >>> dbo.vwAgedDebtorGet.DDFrequency >>> FROM dbo.vwAgedDebtorGet INNER JOIN >>> dbo.vwAgedDebtorGetLastStatDate ON dbo.vwAgedDebtorGet.CustomerID = >>> dbo.vwAgedDebtorGetLastStatDate.CustIDNo AND >>> dbo.vwAgedDebtorGet.StatementDate = >>> dbo.vwAgedDebtorGetLastStatDate.StatementDate LEFT >>> OUTER JOIN dbo.vwAgedDebtorReceipt ON >>> dbo.vwAgedDebtorGet.CustomerID = >>> dbo.vwAgedDebtorReceipt.CustIDNo AND >>> dbo.vwAgedDebtorGet.StatementNumber = >>> dbo.vwAgedDebtorReceipt.StatNum ' >>> IF @bitDD = 1 >>> BEGIN >>> SELECT @qs = @qs + 'WHERE >>> (dbo.vwAgedDebtorGet.DDFrequency = ' + @bitDDFreq + ')' >>> END >>> IF @bitDDFreq <> '0' >>> BEGIN -- @bitDD will always be 1 if @bitDDFreq <> '0' >>> SELECT @qs = @qs + ' AND >>> (dbo.vwAgedDebtorGet.DDRegistered = 1) ' >>> END >>> EXEC (@qs) >>> >>> Regards >>> David Emerson >>> Dalyn Software Ltd >>> 25 Cunliffe St, Churton Park >>> Wellington, New Zealand >>> Ph/Fax (877) 456-1205 _______________________________________________ >>> dba-SQLServer mailing list >>> dba-SQLServer at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>> http://www.databaseadvisors.com > > From davide at dalyn.co.nz Mon Dec 1 14:19:40 2003 From: davide at dalyn.co.nz (David Emerson) Date: Tue, 02 Dec 2003 09:19:40 +1300 Subject: [dba-SQLServer]Slow Sproc execution In-Reply-To: <3FCB9611.80504@verizon.net> References: <5.2.0.9.0.20031202073552.00b7fb10@mail.dalyn.co.nz> <5.2.0.9.0.20031128191614.00b2f488@mail.dalyn.co.nz> <5.2.0.9.0.20031128191614.00b2f488@mail.dalyn.co.nz> <5.2.0.9.0.20031202073552.00b7fb10@mail.dalyn.co.nz> Message-ID: <5.2.0.9.0.20031202091812.00b2c180@mail.dalyn.co.nz> Sorry to take up your time. The code in your message was from my original problem. I subsequently solved it by changing it to a 'real' temp table as you suggest. David At 1/12/2003, you wrote: >This is one way, additionally looking at your sample code it looks like >you're not really using temp tables at all, instead you've created a view >to temporary use. why not use "real" temp tables, that way you don't have >recreate views all the time w/ that sproc anymore... instead you create a >temporary table with the subset of data you wanted, it gets stored for the >duration of the sproc and you'd only be making the call once not twice to >the source tables as your sample seems to indicate. > >ALTER PROCEDURE sprptAgedDebtor > ( > @txtAged1Dte nvarchar(20), > @txtAged2Dte nvarchar(20), > @bitDD bit, > @bitDDFreq varchar(1) > ) >AS >-- SET NOCOUNT ON >-- --The next line creates a view. The resulting view has about >13000 records in it >-- exec spvwAgedDebtorGetLastStatDate @txtAged1Dte, @txtAged2Dte >-- declare @qs varchar(8000) > > CREATE TABLE #AgedDebtorGet > (Column1 [int] Null, > Column2 [int] Null, > Column3 [varchar] (255) Null > ) > > INSERT INTO #AgedDebtorGet > --SELECT statement w/ Dates > >IF @bitDD = 1 AND @bitDDFreq <> '0' > BEGIN > SELECT * FROM #AgedDebtorGet > WHERE (#vwAgedDebtorGet.DDFrequency = @bitDDFreq ) > AND (#vwAgedDebtorGet.DDRegistered = 1) > END >ELSE IF @bitDD = 1 AND @bitDDFreq = '0' > BEGIN > SELECT * FROM #AgedDebtorGet > WHERE (#vwAgedDebtorGet.DDFrequency = @bitDDFreq ) > END > > >They live for the duration of your sproc. Please note that you'll >actually have to re-do the #TempTable to the appropriate columns > > >-- >-Francisco > > >David Emerson wrote: > >>I ended up creating a temporary table for the first part and then >>creating a dynamic sql applying the where clause using the table. >>Changed the time from 40 sec to about 2. >>How could I create a static sql when the filters to be included depend on >>the parameters passed in. >>Regards >>David Emerson >>Dalyn Software Ltd >>25 Cunliffe St, Churton Park >>Wellington, New Zealand >>Ph/Fax (877) 456-1205 >>At 1/12/2003, you wrote: >> >>>try to use static sql instead of dynamic and you'll see the speed >>>improve as well. Additionally what is your query execution time. >>> >>>-Francisco >>> >>>David Emerson wrote: >>> >>>>I have a sproc that has a couple of where statements in it. If I only >>>>include 1 statement then the sproc runs within a second and returns >>>>about 128 records. If I include both statements then it takes about 40 >>>>seconds. Using the SQL Profiler the single statements record approx >>>>8950 reads but with both included the SQL Profiler records approx >>>>136000 reads. There seems to be a need for SQL to pass through the >>>>records several times yet the comparisons are both in the same >>>>table. My problem is how to reduce the time taken to run the >>>>sproc. Here is the code - >>>>ALTER PROCEDURE sprptAgedDebtor >>>> ( >>>> @txtAged1Dte nvarchar(20), >>>> @txtAged2Dte nvarchar(20), >>>> @bitDD bit, >>>> @bitDDFreq varchar(1) >>>> ) >>>>AS >>>> SET NOCOUNT ON >>>> --The next line creates a view. The resulting view has about >>>> 13000 records in it >>>> exec spvwAgedDebtorGetLastStatDate @txtAged1Dte, @txtAged2Dte >>>> declare @qs varchar(8000) >>>>SELECT @qs = ' >>>> SELECT dbo.vwAgedDebtorGet.CustomerID, >>>> dbo.vwAgedDebtorGet.AccountNo, dbo.vwAgedDebtorGet.CustName, >>>> dbo.vwAgedDebtorGet.StatementDate, >>>> dbo.vwAgedDebtorGet.StatementNumber, >>>> dbo.vwAgedDebtorGet.AccFreq, >>>> dbo.vwAgedDebtorGet.CurrentMth, dbo.vwAgedDebtorGet.OneMonth, >>>> dbo.vwAgedDebtorGet.TwoMonths, >>>> dbo.vwAgedDebtorGet.ThreeMonths, >>>> dbo.vwAgedDebtorReceipt.CNReceipts, >>>> dbo.vwAgedDebtorReceipt.Receipts, dbo.vwAgedDebtorGet.MGrpIDNo, >>>> dbo.vwAgedDebtorGet.DDRegistered, >>>> dbo.vwAgedDebtorGet.DDFrequency >>>> FROM dbo.vwAgedDebtorGet INNER JOIN >>>> dbo.vwAgedDebtorGetLastStatDate ON dbo.vwAgedDebtorGet.CustomerID = >>>> dbo.vwAgedDebtorGetLastStatDate.CustIDNo AND >>>> dbo.vwAgedDebtorGet.StatementDate = >>>> dbo.vwAgedDebtorGetLastStatDate.StatementDate LEFT >>>> OUTER JOIN dbo.vwAgedDebtorReceipt ON >>>> dbo.vwAgedDebtorGet.CustomerID = >>>> dbo.vwAgedDebtorReceipt.CustIDNo AND >>>> dbo.vwAgedDebtorGet.StatementNumber = >>>> dbo.vwAgedDebtorReceipt.StatNum ' >>>>IF @bitDD = 1 >>>> BEGIN >>>> SELECT @qs = @qs + 'WHERE >>>> (dbo.vwAgedDebtorGet.DDFrequency = ' + @bitDDFreq + ')' >>>> END >>>>IF @bitDDFreq <> '0' >>>> BEGIN -- @bitDD will always be 1 if @bitDDFreq <> '0' >>>> SELECT @qs = @qs + ' AND >>>> (dbo.vwAgedDebtorGet.DDRegistered = 1) ' >>>> END >>>>EXEC (@qs) >>>> >>>>Regards >>>>David Emerson >>>>Dalyn Software Ltd >>>>25 Cunliffe St, Churton Park >>>>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 scapistrant at symphonyinfo.com Mon Dec 1 14:39:47 2003 From: scapistrant at symphonyinfo.com (Steve Capistrant) Date: Mon, 1 Dec 2003 14:39:47 -0600 Subject: [dba-SQLServer]SQL expert In-Reply-To: <3FCB9611.80504@verizon.net> Message-ID: Hello group, This is a job-related post rather than a how-to post. I'm in search of a SQL Server guru in the Minneapolis/St.Paul metro area who's looking for extra contract work. We are a small shop of mostly Access developers who do moderate amounts of SQL Server work. When we hit the outer limits of our knowledge, we tap all the usual resources (books, discussion groups, knowledge bases, etc). But I want to handle some requests more quickly, and prefer having someone local to call on the phone or come in and do one-on-one trainings. Anyone interested? Steve Capistrant scapistrant at symphonyinfo.com Symphony Information Services www.symphonyinfo.com Phone: 763-391-7400 7308 Aspen Lane North, Suite 132, Brooklyn Park, MN 55428 From JRojas at tnco-inc.com Tue Dec 2 08:59:14 2003 From: JRojas at tnco-inc.com (Joe Rojas) Date: Tue, 2 Dec 2003 09:59:14 -0500 Subject: [dba-SQLServer]SS7 - 80040e09 permission denied (strange) - Take 2 Message-ID: <806536912C472E4A9D6515DF2E57261E239607@mercury.tnco-inc.com> Hi All, I am using SS7 with a couple of web based front ends (ASP). I have one database that I used to store information that all the other databases will use, e.g. login information. I only have one user in each database which is the IIS Webserver anonymous user. This user only has exec permissions on stored procedures, i.e. no direct access to tables. In the 'Global' DB this user has no permissions to anything and as of right now, this DB only has one table, tblLogins. DB1 has a stored procedure that accesses this 'Gobal' database to check if the user has given valid login credentials (see below) and everything works perfectly. DB2 has a stored procedure that does that same as above and the coding of the SP is identical to that of DB1. When run from DB2 I get an error message from the web page that reads: SELECT permission denied on object 'tblLogins', database 'TNCOGlobal', owner 'dbo'. I checked both databases, both web apps, and all folder permissions to find any differences and have come up with bunk! Any ideas as to why this works with one DB and not the other? Thanks, JR CREATE PROCEDURE dbo.sp_checklogin @user varchar(30), @pass varchar(20), @FL tinyint OUTPUT AS DECLARE @pass2 varchar(20) SET NOCOUNT ON SELECT @pass2 = Password, @FL = FirstLogin FROM TNCOGlobal.dbo.tblLogins WHERE UserName = @user SET NOCOUNT OFF IF (@pass2 Is NULL) BEGIN SET @FL = 3 RETURN END IF (@pass <> @pass2) BEGIN SET @FL = 2 END RETURN This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. From my.lists at verizon.net Tue Dec 2 11:28:08 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Tue, 02 Dec 2003 09:28:08 -0800 Subject: [dba-SQLServer]SS7 - 80040e09 permission denied (strange) - Take 2 In-Reply-To: <806536912C472E4A9D6515DF2E57261E239607@mercury.tnco-inc.com> References: <806536912C472E4A9D6515DF2E57261E239607@mercury.tnco-inc.com> Message-ID: <3FCCCBA8.9010809@verizon.net> I would double check the owner of the stored procedure. You might want to try and login as the dbo of the db2 and re-create the sproc if it is giving you problems. At first it seemed almost as if you were describing symptoms of dynamic sql behavior. but that is not the case here... generally if the creator of the sproc does not have rights to said table, then you will have this type of problem... btw.. you may also want to double check the rights for the login user on your 'linked server' or 'remote server' settings Joe Rojas wrote: >Hi All, > >I am using SS7 with a couple of web based front ends (ASP). > >I have one database that I used to store information that all the other >databases will use, e.g. login information. >I only have one user in each database which is the IIS Webserver anonymous >user. >This user only has exec permissions on stored procedures, i.e. no direct >access to tables. >In the 'Global' DB this user has no permissions to anything and as of right >now, this DB only has one table, tblLogins. > >DB1 has a stored procedure that accesses this 'Gobal' database to check if >the user has given valid login credentials (see below) and everything works >perfectly. > >DB2 has a stored procedure that does that same as above and the coding of >the SP is identical to that of DB1. When run from DB2 I get an error message >from the web page that reads: SELECT permission denied on object >'tblLogins', database 'TNCOGlobal', owner 'dbo'. > >I checked both databases, both web apps, and all folder permissions to find >any differences and have come up with bunk! Any ideas as to why this works >with one DB and not the other? > >Thanks, >JR > >CREATE PROCEDURE dbo.sp_checklogin >@user varchar(30), >@pass varchar(20), >@FL tinyint OUTPUT >AS >DECLARE @pass2 varchar(20) > >SET NOCOUNT ON >SELECT @pass2 = Password, @FL = FirstLogin FROM TNCOGlobal.dbo.tblLogins >WHERE UserName = @user >SET NOCOUNT OFF > >IF (@pass2 Is NULL) >BEGIN > SET @FL = 3 > RETURN >END > >IF (@pass <> @pass2) >BEGIN > SET @FL = 2 >END > >RETURN > > -- -Francisco From shait at mindspring.com Thu Dec 4 22:09:53 2003 From: shait at mindspring.com (Stephen Hait) Date: Thu, 4 Dec 2003 23:09:53 -0500 Subject: [dba-SQLServer]SQL 2K tools on Windows Server 2003 Web Edition? In-Reply-To: <3FCCCBA8.9010809@verizon.net> References: <806536912C472E4A9D6515DF2E57261E239607@mercury.tnco-inc.com> Message-ID: <3FCFBEC1.8214.1ACD668@localhost> I know that SQL2K is not supported on Windows Server 2003 Web Edition. However, is there a way to install SQL2K tools such as Query Analyzer and/or Enterprise Manager on this platform in order to allow access to a SQL2K installation on a Windows Server 2K box? Any help appreciated. Regards, Stephen From MPorter at acsalaska.com Fri Dec 5 12:52:25 2003 From: MPorter at acsalaska.com (Porter, Mark) Date: Fri, 5 Dec 2003 09:52:25 -0900 Subject: [dba-SQLServer]Querying on SQL trace log tables Message-ID: I'm trying to query on the query data provided by a SQL Trace, but SQL Trace saves this data as an nText field. Specifically, I'm monitoring the usage of an application, and am trying to pull out relevant join and where clause statements from the SQL which is hitting the database. So far, all attempts to change to a varchar and pull out information have failed or met with unexpected results. I've used CAST and CONVERT, combined with LEFT and RIGHT functions to pull data between keywords, but at best I'll pull data from a different part of the statement. Any ideas? *********************************************************************************** 5/12/2003 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. ACS From artful at rogers.com Fri Dec 5 16:04:33 2003 From: artful at rogers.com (Arthur Fuller) Date: Fri, 5 Dec 2003 14:04:33 -0800 Subject: [dba-SQLServer]World's Largest Databases In-Reply-To: <5.2.0.9.0.20031130092842.00b2ef48@mail.dalyn.co.nz> Message-ID: <00c901c3bb7b$cb55df80$6501a8c0@rock> I came across this URL and thought to share it. Now I feel that I have never even come close to a large database :-) Watch for wrap. http://databases.about.com/gi/dynamic/offsite.htm?site=http://wintercorp .com/VLDB/2003%5FTopTen%5FSurvey/TopTenProgram.html Arthur From Robert.Djabarov at usaa.com Fri Dec 5 13:49:28 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Fri, 5 Dec 2003 13:49:28 -0600 Subject: [dba-SQLServer]World's Largest Databases Message-ID: <3CCEA32DFF043C4CB99B835557E11B3002A2F41D@ex02.eagle.usaa.com> Interesting...I guess we don't advertise our sizes to this Winter Corp., because we'd have beaten everyone on the list on both OLTP and DSS implementations. Our average OLTP db size is 6.9GB and the largest OLTP db is 42.7GB, while the largest DSS db is 60.9GB and the average DSS is 20.47GB. Mind you that all these db's are on SQL Server and I am not even mentioning Oracle and DB2 installs that have much larger databases. We're currently working on taking 400GB+ Oracle db for a parallel implementation in SQL Server (don't ask why, many things are better be left unknown here :) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Friday, December 05, 2003 4:05 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]World's Largest Databases I came across this URL and thought to share it. Now I feel that I have never even come close to a large database :-) Watch for wrap. http://databases.about.com/gi/dynamic/offsite.htm?site=http://wintercorp .com/VLDB/2003%5FTopTen%5FSurvey/TopTenProgram.html Arthur _______________________________________________ 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 Dec 5 21:41:31 2003 From: artful at rogers.com (Arthur Fuller) Date: Fri, 5 Dec 2003 19:41:31 -0800 Subject: [dba-SQLServer]World's Largest Databases In-Reply-To: <3CCEA32DFF043C4CB99B835557E11B3002A2F41D@ex02.eagle.usaa.com> Message-ID: <013701c3bbaa$d67da9e0$6501a8c0@rock> I don't think you read the numbers correctly, Robert, or perhaps I didn't, but I took them as 6.9 K GB (i.e. TB) not 6.9 GB. Hell, I've got lots of databases bigger than 7GB that's NUTHIN. Why on earth would one use a Terabyte box for 6.9GB, when any dumbass PC can handle 20 times that? A. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Djabarov, Robert Sent: Friday, December 05, 2003 11:49 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]World's Largest Databases Interesting...I guess we don't advertise our sizes to this Winter Corp., because we'd have beaten everyone on the list on both OLTP and DSS implementations. Our average OLTP db size is 6.9GB and the largest OLTP db is 42.7GB, while the largest DSS db is 60.9GB and the average DSS is 20.47GB. Mind you that all these db's are on SQL Server and I am not even mentioning Oracle and DB2 installs that have much larger databases. We're currently working on taking 400GB+ Oracle db for a parallel implementation in SQL Server (don't ask why, many things are better be left unknown here :) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Friday, December 05, 2003 4:05 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]World's Largest Databases I came across this URL and thought to share it. Now I feel that I have never even come close to a large database :-) Watch for wrap. http://databases.about.com/gi/dynamic/offsite.htm?site=http://wintercorp .com/VLDB/2003%5FTopTen%5FSurvey/TopTenProgram.html 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 From sgeller at cce.umn.edu Mon Dec 8 08:47:49 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Mon, 8 Dec 2003 08:47:49 -0600 Subject: [dba-SQLServer]Zeros not showing up on a report Message-ID: ADP in Access XP (2002 format). I have a report whose record source is a sproc that does some summing. All is well except that "0" does not show up on the report. All other values show up. I have similar problems before and have always been able to solve them by explicitly casting the fields in the sproc as decimals. In the past I've seen this more in that if I didn't cast as such, the report couldn't add values like in a group footer. When I run the sproc from the adp I see the zeros. It's only on the report that I don't see them. I've tried using the nz function on the report and that doesn't work. And, I've tired using an IIF to evaluate for zero and that doesn't work. So, they aren't coming through as zero or as null. Ideas? --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 From liam at energyexhausts.co.uk Mon Dec 8 09:55:19 2003 From: liam at energyexhausts.co.uk (Liam Meadows) Date: Mon, 8 Dec 2003 15:55:19 -0000 Subject: [dba-SQLServer]ADP auto login to SQL server Message-ID: <125066531861D043863CE6453EE8509EA940@energys1.energy.local> How is it possible to set an ADP to auto login to an SQL database. Obviously I will create an account thatisn't able to alter things I don't want them to but I don't want the shopfloor to keep having to type in a login and password every time the ADP is started up. Cheers Liam From Robert.Djabarov at usaa.com Mon Dec 8 10:09:08 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Mon, 8 Dec 2003 10:09:08 -0600 Subject: [dba-SQLServer]ADP auto login to SQL server Message-ID: <3CCEA32DFF043C4CB99B835557E11B3002A2F522@ex02.eagle.usaa.com> Use Windows Authentication -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Liam Meadows Sent: Monday, December 08, 2003 9:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]ADP auto login to SQL server How is it possible to set an ADP to auto login to an SQL database. Obviously I will create an account thatisn't able to alter things I don't want them to but I don't want the shopfloor to keep having to type in a login and password every time the ADP is started up. Cheers Liam _______________________________________________ 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 Dec 8 10:26:57 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 08 Dec 2003 08:26:57 -0800 Subject: [dba-SQLServer]ADP auto login to SQL server In-Reply-To: <125066531861D043863CE6453EE8509EA940@energys1.energy.local> References: <125066531861D043863CE6453EE8509EA940@energys1.energy.local> Message-ID: <3FD4A651.8090702@verizon.net> One way to avoid this is to use windows authentication, but if you want to stick with SQL authentication then I suggeet you open up the connection window (file|Connection), and check the box that says save password. Liam Meadows wrote: > How is it possible to set an ADP to auto login to an SQL database. > Obviously I will create an account thatisn't able to alter things I > don't want them to but I don't want the shopfloor to keep having to type > in a login and password every time the ADP is started up. > > Cheers > > Liam > -- -Francisco From my.lists at verizon.net Mon Dec 8 12:53:49 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 08 Dec 2003 10:53:49 -0800 Subject: [dba-SQLServer]Zeros not showing up on a report In-Reply-To: References: Message-ID: <3FD4C8BD.1020705@verizon.net> In my situation w/ Access 2000, they show up and my boss doesn't want to see them :D. But what you might want to check is in the report what the fields are formatted as, generally you can just format it to general and that ought to do it it, if not in the format property add a 0 and see if that takes care of it. -- -Francisco Susan Geller wrote: >ADP in Access XP (2002 format). I have a report whose record source is >a sproc that does some summing. All is well except that "0" does not >show up on the report. All other values show up. I have similar >problems before and have always been able to solve them by explicitly >casting the fields in the sproc as decimals. In the past I've seen this >more in that if I didn't cast as such, the report couldn't add values >like in a group footer. When I run the sproc from the adp I see the >zeros. It's only on the report that I don't see them. I've tried using >the nz function on the report and that doesn't work. And, I've tired >using an IIF to evaluate for zero and that doesn't work. So, they >aren't coming through as zero or as null. Ideas? > >--Susan > > >Susan B. Geller > > From sgeller at cce.umn.edu Mon Dec 8 17:50:20 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Mon, 8 Dec 2003 17:50:20 -0600 Subject: [dba-SQLServer]Zeros not showing up on a report Message-ID: When I change the formatting from #,### to #,##0 I see zeros. Thanks much! --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: Monday, December 08, 2003 12:54 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Zeros not showing up on a report In my situation w/ Access 2000, they show up and my boss doesn't want to see them :D. But what you might want to check is in the report what the fields are formatted as, generally you can just format it to general and that ought to do it it, if not in the format property add a 0 and see if that takes care of it. -- -Francisco Susan Geller wrote: >ADP in Access XP (2002 format). I have a report whose record source is >a sproc that does some summing. All is well except that "0" does not >show up on the report. All other values show up. I have similar >problems before and have always been able to solve them by explicitly >casting the fields in the sproc as decimals. In the past I've seen >this more in that if I didn't cast as such, the report couldn't add >values like in a group footer. When I run the sproc from the adp I see >the zeros. It's only on the report that I don't see them. I've tried >using the nz function on the report and that doesn't work. And, I've >tired using an IIF to evaluate for zero and that doesn't work. So, >they aren't coming through as zero or as null. Ideas? > >--Susan > > >Susan B. Geller > > _______________________________________________ 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 Tue Dec 9 12:37:27 2003 From: artful at rogers.com (Arthur Fuller) Date: Tue, 9 Dec 2003 10:37:27 -0800 Subject: [dba-SQLServer]MS To Junk Flagship Products In-Reply-To: Message-ID: <000801c3be83$7f879110$6601a8c0@rock> (Cross posted to dba-Tech) but posted here because SQL 7 will be dead at the end of the month.... http://www.eweek.com/article2/0,4149,1405300,00.asp Arthur From Robert.Djabarov at usaa.com Tue Dec 9 10:05:13 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 9 Dec 2003 10:05:13 -0600 Subject: [dba-SQLServer]MS To Junk Flagship Products Message-ID: <3CCEA32DFF043C4CB99B835557E11B3002A2F6A5@ex02.eagle.usaa.com> Authur, You're right, I was not reading the numbers right. Turns out we're not advertising the numbers because...there's nothing to advertise :) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Tuesday, December 09, 2003 12:37 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]MS To Junk Flagship Products (Cross posted to dba-Tech) but posted here because SQL 7 will be dead at the end of the month.... http://www.eweek.com/article2/0,4149,1405300,00.asp Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Wed Dec 10 12:19:51 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 10 Dec 2003 10:19:51 -0800 Subject: [dba-SQLServer]Directory Listing Message-ID: <000f01c3bf4a$345bea70$6601a8c0@rock> A while ago I discovered how to obtain a list of files from a directory, using a SELECT statement, and now that I need it I can't seem to find the code. Can anyone nudge my memory? TIA, Arthur From JRojas at tnco-inc.com Wed Dec 10 10:06:25 2003 From: JRojas at tnco-inc.com (Joe Rojas) Date: Wed, 10 Dec 2003 11:06:25 -0500 Subject: [dba-SQLServer]Stored Procedure permissions question Message-ID: <806536912C472E4A9D6515DF2E57261E23962B@mercury.tnco-inc.com> Hello All, (SqlServer 7.0) I was wondering. If a user is granted execute permission to a stored procedure (SP) and that SP accesses a table in a different database, what user or login is used to access this table if the user executing the SP has no explicit permissions to the table? Another way of asking my question would be: We grant exec permissions to SPs so that no user has direct access to a table. But is essence the user is still getting data from a table, just through an SP. Does the SP have it's own 'special' user to access the table directly? Thanks! JR This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. From artful at rogers.com Wed Dec 10 13:43:23 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 10 Dec 2003 11:43:23 -0800 Subject: [dba-SQLServer]Stored Procedure permissions question In-Reply-To: <806536912C472E4A9D6515DF2E57261E23962B@mercury.tnco-inc.com> Message-ID: <000301c3bf55$df9d28d0$6601a8c0@rock> I could be wrong, but I think that a sproc doesn't have a special user, but rather that in theory a sproc can do anything. The issue is outside and above the sproc, so to speak -- at the level of user rights and/or role permissions. Then your app logs in as a user, perhaps with a role, and that dictates what happens. A user with no rights won't be able to execute the sproc. Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Wednesday, December 10, 2003 8:06 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer]Stored Procedure permissions question Hello All, (SqlServer 7.0) I was wondering. If a user is granted execute permission to a stored procedure (SP) and that SP accesses a table in a different database, what user or login is used to access this table if the user executing the SP has no explicit permissions to the table? Another way of asking my question would be: We grant exec permissions to SPs so that no user has direct access to a table. But is essence the user is still getting data from a table, just through an SP. Does the SP have it's own 'special' user to access the table directly? Thanks! JR This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From JRojas at tnco-inc.com Wed Dec 10 12:24:30 2003 From: JRojas at tnco-inc.com (Joe Rojas) Date: Wed, 10 Dec 2003 13:24:30 -0500 Subject: [dba-SQLServer]Stored Procedure permissions question Message-ID: <806536912C472E4A9D6515DF2E57261E23962C@mercury.tnco-inc.com> Thanks for the reply. This is kind of what I thought with regards to sprocs. I don't know if you read by previous post but I am having a problem where I have one database (DB1) that has a sproc that performs a SELECT statement on a table that is located in another database (DB2). Both databases are on the same server. The user has database access permitted on both databases (DB1 and DB2). The user has execute permissions on the sproc in DB1 (no rows are returned from this sproc, just an OUTPUT value). The user has no permissions declared (all checkboxes are cleared) on the table in DB2. An error of "SELECT permission denied on object 'tblLogins', database 'TNCOGlobal', owner 'dbo'" is received. But if I use the same sproc (meaning I created another sproc with the same code) and setup as above but in another database (DB3), everything works perfectly. I am trying to hunt down what would cause this. Any ideas? JR -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Wednesday, December 10, 2003 2:43 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedure permissions question I could be wrong, but I think that a sproc doesn't have a special user, but rather that in theory a sproc can do anything. The issue is outside and above the sproc, so to speak -- at the level of user rights and/or role permissions. Then your app logs in as a user, perhaps with a role, and that dictates what happens. A user with no rights won't be able to execute the sproc. Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Wednesday, December 10, 2003 8:06 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer]Stored Procedure permissions question Hello All, (SqlServer 7.0) I was wondering. If a user is granted execute permission to a stored procedure (SP) and that SP accesses a table in a different database, what user or login is used to access this table if the user executing the SP has no explicit permissions to the table? Another way of asking my question would be: We grant exec permissions to SPs so that no user has direct access to a table. But is essence the user is still getting data from a table, just through an SP. Does the SP have it's own 'special' user to access the table directly? Thanks! JR This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. From sgeller at cce.umn.edu Wed Dec 10 13:57:02 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Wed, 10 Dec 2003 13:57:02 -0600 Subject: [dba-SQLServer]Stored Procedure permissions question Message-ID: We do what you are trying to do and we have found that in order to get a sproc in DB 1 to access a table in DB 2 we have to grant select access to the table in DB 2. I'm curious what you are doing in DB 3 that is making it not require this. Another thing we have found with permissions is that even if we are in only one database, if a sproc runs a query directly, then we don't need to grant rights to the underlying tables. However, if a sproc builds a sQL string and then exec(MySQLSTring) at the end, we do need to grant select access to the underlying tables. We only do this when absolutely necessary b/c it makes for less efficient sprocs. --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Wednesday, December 10, 2003 12:25 PM To: 'dba-sqlserver at databaseadvisors.com' Subject: RE: [dba-SQLServer]Stored Procedure permissions question Thanks for the reply. This is kind of what I thought with regards to sprocs. I don't know if you read by previous post but I am having a problem where I have one database (DB1) that has a sproc that performs a SELECT statement on a table that is located in another database (DB2). Both databases are on the same server. The user has database access permitted on both databases (DB1 and DB2). The user has execute permissions on the sproc in DB1 (no rows are returned from this sproc, just an OUTPUT value). The user has no permissions declared (all checkboxes are cleared) on the table in DB2. An error of "SELECT permission denied on object 'tblLogins', database 'TNCOGlobal', owner 'dbo'" is received. But if I use the same sproc (meaning I created another sproc with the same code) and setup as above but in another database (DB3), everything works perfectly. I am trying to hunt down what would cause this. Any ideas? JR -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Wednesday, December 10, 2003 2:43 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedure permissions question I could be wrong, but I think that a sproc doesn't have a special user, but rather that in theory a sproc can do anything. The issue is outside and above the sproc, so to speak -- at the level of user rights and/or role permissions. Then your app logs in as a user, perhaps with a role, and that dictates what happens. A user with no rights won't be able to execute the sproc. Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Wednesday, December 10, 2003 8:06 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer]Stored Procedure permissions question Hello All, (SqlServer 7.0) I was wondering. If a user is granted execute permission to a stored procedure (SP) and that SP accesses a table in a different database, what user or login is used to access this table if the user executing the SP has no explicit permissions to the table? Another way of asking my question would be: We grant exec permissions to SPs so that no user has direct access to a table. But is essence the user is still getting data from a table, just through an SP. Does the SP have it's own 'special' user to access the table directly? Thanks! JR This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From JRojas at tnco-inc.com Wed Dec 10 14:18:59 2003 From: JRojas at tnco-inc.com (Joe Rojas) Date: Wed, 10 Dec 2003 15:18:59 -0500 Subject: [dba-SQLServer]Stored Procedure permissions question Message-ID: <806536912C472E4A9D6515DF2E57261E23962D@mercury.tnco-inc.com> To be honest, I have no idea what is special about DB3. That is the part I can't figure out. Just today I converted another database (DB4) so that it accesses DB2 and that also works like DB3! I am confused. I do not like the idea of giving direct access to a table; even it is only SELECT access. To make it worse, if I can't fixed this issue I will have to grant both SELECT and UPDATE! Eek! Thanks! JR -----Original Message----- From: Susan Geller [mailto:sgeller at cce.umn.edu] Sent: Wednesday, December 10, 2003 2:57 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedure permissions question We do what you are trying to do and we have found that in order to get a sproc in DB 1 to access a table in DB 2 we have to grant select access to the table in DB 2. I'm curious what you are doing in DB 3 that is making it not require this. Another thing we have found with permissions is that even if we are in only one database, if a sproc runs a query directly, then we don't need to grant rights to the underlying tables. However, if a sproc builds a sQL string and then exec(MySQLSTring) at the end, we do need to grant select access to the underlying tables. We only do this when absolutely necessary b/c it makes for less efficient sprocs. --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Wednesday, December 10, 2003 12:25 PM To: 'dba-sqlserver at databaseadvisors.com' Subject: RE: [dba-SQLServer]Stored Procedure permissions question Thanks for the reply. This is kind of what I thought with regards to sprocs. I don't know if you read by previous post but I am having a problem where I have one database (DB1) that has a sproc that performs a SELECT statement on a table that is located in another database (DB2). Both databases are on the same server. The user has database access permitted on both databases (DB1 and DB2). The user has execute permissions on the sproc in DB1 (no rows are returned from this sproc, just an OUTPUT value). The user has no permissions declared (all checkboxes are cleared) on the table in DB2. An error of "SELECT permission denied on object 'tblLogins', database 'TNCOGlobal', owner 'dbo'" is received. But if I use the same sproc (meaning I created another sproc with the same code) and setup as above but in another database (DB3), everything works perfectly. I am trying to hunt down what would cause this. Any ideas? JR -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Wednesday, December 10, 2003 2:43 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedure permissions question I could be wrong, but I think that a sproc doesn't have a special user, but rather that in theory a sproc can do anything. The issue is outside and above the sproc, so to speak -- at the level of user rights and/or role permissions. Then your app logs in as a user, perhaps with a role, and that dictates what happens. A user with no rights won't be able to execute the sproc. Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Wednesday, December 10, 2003 8:06 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer]Stored Procedure permissions question Hello All, (SqlServer 7.0) I was wondering. If a user is granted execute permission to a stored procedure (SP) and that SP accesses a table in a different database, what user or login is used to access this table if the user executing the SP has no explicit permissions to the table? Another way of asking my question would be: We grant exec permissions to SPs so that no user has direct access to a table. But is essence the user is still getting data from a table, just through an SP. Does the SP have it's own 'special' user to access the table directly? Thanks! JR This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. From artful at rogers.com Wed Dec 10 18:37:47 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 10 Dec 2003 16:37:47 -0800 Subject: [dba-SQLServer]Stored Procedure permissions question In-Reply-To: Message-ID: <001f01c3bf7f$00051230$6601a8c0@rock> I haven't tried that, Susan, but are you quite sure about this? It doesn't sound right. My guess is that you have several choices, the most useful two being: A) write a table udf in the common db that returns the relevant info from the users table; B) create a view within the common db that does the same thing. Deny table permissions to all mere mortals on the common db. Grant mere mortals access only to the udf or the view. Should a mortal be allowed to update his password etc., then write a sproc dedicated to that purpose and grant exec to it as well. Don't use an updatable view or dynamic SQL for this or you'll have to spend time defending against SQL injections. If it's a sproc most injections are trapped automatically. Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Geller Sent: Wednesday, December 10, 2003 11:57 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedure permissions question We do what you are trying to do and we have found that in order to get a sproc in DB 1 to access a table in DB 2 we have to grant select access to the table in DB 2. I'm curious what you are doing in DB 3 that is making it not require this. Another thing we have found with permissions is that even if we are in only one database, if a sproc runs a query directly, then we don't need to grant rights to the underlying tables. However, if a sproc builds a sQL string and then exec(MySQLSTring) at the end, we do need to grant select access to the underlying tables. We only do this when absolutely necessary b/c it makes for less efficient sprocs. --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Wednesday, December 10, 2003 12:25 PM To: 'dba-sqlserver at databaseadvisors.com' Subject: RE: [dba-SQLServer]Stored Procedure permissions question Thanks for the reply. This is kind of what I thought with regards to sprocs. I don't know if you read by previous post but I am having a problem where I have one database (DB1) that has a sproc that performs a SELECT statement on a table that is located in another database (DB2). Both databases are on the same server. The user has database access permitted on both databases (DB1 and DB2). The user has execute permissions on the sproc in DB1 (no rows are returned from this sproc, just an OUTPUT value). The user has no permissions declared (all checkboxes are cleared) on the table in DB2. An error of "SELECT permission denied on object 'tblLogins', database 'TNCOGlobal', owner 'dbo'" is received. But if I use the same sproc (meaning I created another sproc with the same code) and setup as above but in another database (DB3), everything works perfectly. I am trying to hunt down what would cause this. Any ideas? JR -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Wednesday, December 10, 2003 2:43 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Stored Procedure permissions question I could be wrong, but I think that a sproc doesn't have a special user, but rather that in theory a sproc can do anything. The issue is outside and above the sproc, so to speak -- at the level of user rights and/or role permissions. Then your app logs in as a user, perhaps with a role, and that dictates what happens. A user with no rights won't be able to execute the sproc. Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Joe Rojas Sent: Wednesday, December 10, 2003 8:06 AM To: 'dba-sqlserver at databaseadvisors.com' Subject: [dba-SQLServer]Stored Procedure permissions question Hello All, (SqlServer 7.0) I was wondering. If a user is granted execute permission to a stored procedure (SP) and that SP accesses a table in a different database, what user or login is used to access this table if the user executing the SP has no explicit permissions to the table? Another way of asking my question would be: We grant exec permissions to SPs so that no user has direct access to a table. But is essence the user is still getting data from a table, just through an SP. Does the SP have it's own 'special' user to access the table directly? Thanks! JR This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com This electronic transmission is strictly confidential to TNCO, Inc. and intended solely for the addressee. It may contain information which is covered by legal, professional, or other privileges. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy, or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. While TNCO, Inc. uses virus protection, the recipient should check this email and any attachments for the presence of viruses. TNCO, Inc. accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From michael.broesdorf at web.de Thu Dec 11 08:45:28 2003 From: michael.broesdorf at web.de (=?us-ascii?Q?Michael_Brosdorf?=) Date: Thu, 11 Dec 2003 15:45:28 +0100 Subject: [dba-SQLServer]Internationalization problem In-Reply-To: <001f01c3bf7f$00051230$6601a8c0@rock> Message-ID: Dear group, is there any reliable known algorithm to 'translate' numbers users type in a user interface into valid SQL numbers? I want to generate SQL statements that include number users type in. The problem is, some of my users use non-american notation (, as decimal separator and . as thousand separator). Therefore, all input is accepted as a string and needs to be converted to valid SQL numbers with a . as decimal separator. TIA, Michael From clopez at AirAuto.COM Thu Dec 11 12:07:45 2003 From: clopez at AirAuto.COM (Carolina M. Lopez) Date: Thu, 11 Dec 2003 11:07:45 -0700 Subject: [dba-SQLServer]updating sequential numbers In-Reply-To: <001f01c3bf7f$00051230$6601a8c0@rock> Message-ID: <015f01c3c011$b0181090$2171b6c6@carolina> Greetings! I have a problem that may be simple, but it's making me pound my head against the wall. Here's the scenario: I have a table with a list of business rules. This table is numbered in a kind of hierarchy. The rules have numbers, but are not used in that order. One rule number could supersede another due to some other business constraint. So, they have another number associated with them, an id number as the field is named for now at least. What I need to be able to do is change/update the id field so that this particular rule's hierarchy is changed either higher or lower, then update the rest of the id numbers in the table (increment or decrement them by 1) as necessary. Keeping the same order, just changing the one. Am I making this more difficult than it should be? I probably am.... Table Structure for relevant fields: id ruleNumber 1 1001 2 9005 3 1400 4 13 5 1020 Let's say I want to change rule number 1400 to have an id of 5, but keep the order of the rest...incrementing and decrementing as needed. From accessd at shaw.ca Thu Dec 11 21:28:33 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Thu, 11 Dec 2003 19:28:33 -0800 Subject: [dba-SQLServer]updating sequential numbers In-Reply-To: <015f01c3c011$b0181090$2171b6c6@carolina> Message-ID: Hi Carolina: I really hope the id field is not your primary key, if it is you can not/should not change it. Why not just create another number field like: Table Structure for relevant fields: id ruleId ruleNumber 1 1 1001 2 2 9005 3 3 1400 4 4 13 5 5 1020 6 6 1200 7 7 123 Run a SP that First saves the position of the ruleID you want to change and the value you want to change it to. ie. id 6 change ruleID to 3. Second run the following run an update query that is something like: update rules SET ruleId = ruleId + (ruleID >= 3 and rulID <= 6); Given that true = 1 and False = 0 then the values all stay the same below the value 3, increment if greater or equal to three but less than or equal to 6. A gap opens in the third position and the ruleId continues to increment until the sixth position 6 is overwriten by 7. Like this id ruleId ruleNumber 1 1 1001 2 2 9005 3 4 1400 4 5 13 5 6 1020 6 7 1200 7 7 123 Then change ruleID in the position 6 to 3 update rules SET ruleId = 3 where id = 6; id ruleId ruleNumber 1 1 1001 2 2 9005 3 4 1400 4 5 13 5 6 1020 6 3 1200 7 7 123 and because ruleID is an index the list will look like this. id ruleId ruleNumber 1 1 1001 2 2 9005 6 3 1200 3 4 1400 4 5 13 5 6 1020 7 7 123 HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Carolina M. Lopez Sent: Thursday, December 11, 2003 10:08 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]updating sequential numbers Greetings! I have a problem that may be simple, but it's making me pound my head against the wall. Here's the scenario: I have a table with a list of business rules. This table is numbered in a kind of hierarchy. The rules have numbers, but are not used in that order. One rule number could supersede another due to some other business constraint. So, they have another number associated with them, an id number as the field is named for now at least. What I need to be able to do is change/update the id field so that this particular rule's hierarchy is changed either higher or lower, then update the rest of the id numbers in the table (increment or decrement them by 1) as necessary. Keeping the same order, just changing the one. Am I making this more difficult than it should be? I probably am.... Table Structure for relevant fields: id ruleNumber 1 1001 2 9005 3 1400 4 13 5 1020 Let's say I want to change rule number 1400 to have an id of 5, but keep the order of the rest...incrementing and decrementing as needed. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From clopez at AirAuto.COM Fri Dec 12 09:42:50 2003 From: clopez at AirAuto.COM (Carolina M. Lopez) Date: Fri, 12 Dec 2003 08:42:50 -0700 Subject: [dba-SQLServer]updating sequential numbers In-Reply-To: Message-ID: <01b001c3c0c6$9a6b0b70$2171b6c6@carolina> Jim, Thanks for the help! The id field was strickly for changing the rule order around. I'll be working on this today, maybe I can even get through it. Thanks again! -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Jim Lawrence (AccessD) Sent: Thursday, December 11, 2003 8:29 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]updating sequential numbers Hi Carolina: I really hope the id field is not your primary key, if it is you can not/should not change it. Why not just create another number field like: Table Structure for relevant fields: id ruleId ruleNumber 1 1 1001 2 2 9005 3 3 1400 4 4 13 5 5 1020 6 6 1200 7 7 123 Run a SP that First saves the position of the ruleID you want to change and the value you want to change it to. ie. id 6 change ruleID to 3. Second run the following run an update query that is something like: update rules SET ruleId = ruleId + (ruleID >= 3 and rulID <= 6); Given that true = 1 and False = 0 then the values all stay the same below the value 3, increment if greater or equal to three but less than or equal to 6. A gap opens in the third position and the ruleId continues to increment until the sixth position 6 is overwriten by 7. Like this id ruleId ruleNumber 1 1 1001 2 2 9005 3 4 1400 4 5 13 5 6 1020 6 7 1200 7 7 123 Then change ruleID in the position 6 to 3 update rules SET ruleId = 3 where id = 6; id ruleId ruleNumber 1 1 1001 2 2 9005 3 4 1400 4 5 13 5 6 1020 6 3 1200 7 7 123 and because ruleID is an index the list will look like this. id ruleId ruleNumber 1 1 1001 2 2 9005 6 3 1200 3 4 1400 4 5 13 5 6 1020 7 7 123 HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Carolina M. Lopez Sent: Thursday, December 11, 2003 10:08 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]updating sequential numbers Greetings! I have a problem that may be simple, but it's making me pound my head against the wall. Here's the scenario: I have a table with a list of business rules. This table is numbered in a kind of hierarchy. The rules have numbers, but are not used in that order. One rule number could supersede another due to some other business constraint. So, they have another number associated with them, an id number as the field is named for now at least. What I need to be able to do is change/update the id field so that this particular rule's hierarchy is changed either higher or lower, then update the rest of the id numbers in the table (increment or decrement them by 1) as necessary. Keeping the same order, just changing the one. Am I making this more difficult than it should be? I probably am.... Table Structure for relevant fields: id ruleNumber 1 1001 2 9005 3 1400 4 13 5 1020 Let's say I want to change rule number 1400 to have an id of 5, but keep the order of the rest...incrementing and decrementing as needed. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From sgeller at cce.umn.edu Mon Dec 15 14:52:52 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Mon, 15 Dec 2003 14:52:52 -0600 Subject: [dba-SQLServer]Large varchar fields -- performance implications? Message-ID: I am working on a data model and have some questions about large (that is over 255) sized varchar fields. 1. Does it matter what size the varchar is once it is over 255? That is, do you take the same performance hit for a varchar 260 as for a varchar 8000? 2. If I have a field in a table that needs to be over varchar(255), but will only be populated about 20% of the time, should I put that field in its own table with an id value and just store the id value in the table? In other words, do I take a performance hit even when my field is empty? --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 From Robert.Djabarov at usaa.com Mon Dec 15 15:25:25 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Mon, 15 Dec 2003 15:25:25 -0600 Subject: [dba-SQLServer]Large varchar fields -- performance implications? Message-ID: <3CCEA32DFF043C4CB99B835557E11B300318676B@ex02.eagle.usaa.com> 1. 8000-character fields do not impact your performance any more than 255-character fields do. 2. Nope, keep it together with the rest of the fields, unless those 20% may have total length entered greater or equal to the row length limitations, in which case your INSERT/UPDATE will fail. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Geller Sent: Monday, December 15, 2003 2:53 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer]Large varchar fields -- performance implications? I am working on a data model and have some questions about large (that is over 255) sized varchar fields. 1. Does it matter what size the varchar is once it is over 255? That is, do you take the same performance hit for a varchar 260 as for a varchar 8000? 2. If I have a field in a table that needs to be over varchar(255), but will only be populated about 20% of the time, should I put that field in its own table with an id value and just store the id value in the table? In other words, do I take a performance hit even when my field is empty? --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Kenneth.Stoker at pnl.gov Mon Dec 15 17:18:22 2003 From: Kenneth.Stoker at pnl.gov (Stoker, Kenneth E) Date: Mon, 15 Dec 2003 15:18:22 -0800 Subject: [dba-SQLServer] Data Transformation Packages from SQL Server 2K to Oracle 9 Message-ID: <249C1CB246997C48BB74963CCD361C1B014A030A@pnlmse28.pnl.gov> Everyone, Has anyone had any experience with this? I have a coworker who came to me asking if I could help him. I don't have any experience working with Oracle within DTS. We are trying to first validate what data is in the Oracle 9 database and make inserts from the SQL Server database of what is missing. Does anyone also have any good book recommendations for programming DTS Packages? Thanks everyone. Always a help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov From tuxedo_man at hotmail.com Mon Dec 15 17:54:08 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Mon, 15 Dec 2003 23:54:08 +0000 Subject: [dba-SQLServer]Large varchar fields -- performance implications? Message-ID: Somebody correct me if I am wrong but if you are concerned about performance, keep your tables thin. Basic unit of storage in sql server is a page. For a table, the more rows you can fit into an 8k page, the better the performance. This is because when you query that table, sql server goes through less pages when gathering the results. For example, you have two phone books, each with equal number of entries. The first phone book is your standard phone book with 400 names per page. The second phone book has 1 name per page (and thus is 400 times thicker than first phone book). It would take you less time to find a name in the first phone book than second phone book. HTH Billy >From: "Susan Geller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]Large varchar fields -- performance implications? >Date: Mon, 15 Dec 2003 14:52:52 -0600 > >I am working on a data model and have some questions about large (that >is over 255) sized varchar fields. > >1. Does it matter what size the varchar is once it is over 255? That >is, do you take the same performance hit for a varchar 260 as for a >varchar 8000? > >2. If I have a field in a table that needs to be over varchar(255), but >will only be populated about 20% of the time, should I put that field in >its own table with an id value and just store the id value in the table? >In other words, do I take a performance hit even when my field is empty? > > >--Susan > > >Susan B. Geller >Office of Information Systems >College of Continuing Education >University of Minnesota >306 Wesbrook Hall >77 Pleasant Street SE >Minneapolis, MN 55455 >Phone: 612-626-4785 >Fax: 612-625-2568 > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca From accessd at shaw.ca Mon Dec 15 21:40:33 2003 From: accessd at shaw.ca (Jim Lawrence (AccessD)) Date: Mon, 15 Dec 2003 19:40:33 -0800 Subject: [dba-SQLServer] Data Transformation Packages from SQL Server 2K to Oracle 9 In-Reply-To: <249C1CB246997C48BB74963CCD361C1B014A030A@pnlmse28.pnl.gov> Message-ID: Hi Ken: I have used TOAD, a graphic SQL script editor for building Oracle and MSSQL scripts and testing them. I do not imagine it would be a big stretch to migrate between the two as multiple connections can be established. Mine you, I have not been in an environment where both Oracle and MSSQL were available. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Stoker, Kenneth E Sent: Monday, December 15, 2003 3:18 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer] Data Transformation Packages from SQL Server 2K to Oracle 9 Everyone, Has anyone had any experience with this? I have a coworker who came to me asking if I could help him. I don't have any experience working with Oracle within DTS. We are trying to first validate what data is in the Oracle 9 database and make inserts from the SQL Server database of what is missing. Does anyone also have any good book recommendations for programming DTS Packages? Thanks everyone. Always a help. Ken Stoker Technology Commercialization Information Systems Administrator PH: (509) 375-3758 FAX: (509) 375-6731 E-mail: Kenneth.Stoker at pnl.gov _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From martyconnelly at shaw.ca Tue Dec 16 01:18:38 2003 From: martyconnelly at shaw.ca (MartyConnelly) Date: Mon, 15 Dec 2003 23:18:38 -0800 Subject: [dba-SQLServer] Data Transformation Packages from SQL Server 2K to Oracle 9 References: <249C1CB246997C48BB74963CCD361C1B014A030A@pnlmse28.pnl.gov> Message-ID: <3FDEB1CE.5050806@shaw.ca> I don't know if this would be any help but the VB source code for a large DMO-SQL program equivalent to Enterprise Manger is available here. http://www.asql.biz/DbaMgr.shtm http://www.asql.biz/DbaMgr/DownLoad.shtm If not you could e-mail Andrea Montanari at andrea.sql at virgilio.it and he might be able to point you in the right direction Microsoft finally made him an MVP last month. Stoker, Kenneth E wrote: >Everyone, > >Has anyone had any experience with this? I have a coworker who came to >me asking if I could help him. I don't have any experience working with >Oracle within DTS. > >We are trying to first validate what data is in the Oracle 9 database >and make inserts from the SQL Server database of what is missing. > >Does anyone also have any good book recommendations for programming DTS >Packages? > >Thanks everyone. Always a help. > >Ken Stoker >Technology Commercialization >Information Systems Administrator >PH: (509) 375-3758 >FAX: (509) 375-6731 >E-mail: Kenneth.Stoker at pnl.gov > > > -- Marty Connelly Victoria, B.C. Canada From sgeller at cce.umn.edu Tue Dec 16 07:20:49 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Tue, 16 Dec 2003 07:20:49 -0600 Subject: [dba-SQLServer]Large varchar fields -- performance implications? Message-ID: I believe Billy is correct. I read a bit about this in Delaney's book on SQL Server and it is all about how you can use pages. The fewer the pages, the more efficient your I/O. A page can hold 8K. Thanks, Billy. --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Billy Pang Sent: Monday, December 15, 2003 5:54 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? Somebody correct me if I am wrong but if you are concerned about performance, keep your tables thin. Basic unit of storage in sql server is a page. For a table, the more rows you can fit into an 8k page, the better the performance. This is because when you query that table, sql server goes through less pages when gathering the results. For example, you have two phone books, each with equal number of entries. The first phone book is your standard phone book with 400 names per page. The second phone book has 1 name per page (and thus is 400 times thicker than first phone book). It would take you less time to find a name in the first phone book than second phone book. HTH Billy >From: "Susan Geller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]Large varchar fields -- performance >implications? >Date: Mon, 15 Dec 2003 14:52:52 -0600 > >I am working on a data model and have some questions about large (that >is over 255) sized varchar fields. > >1. Does it matter what size the varchar is once it is over 255? That >is, do you take the same performance hit for a varchar 260 as for a >varchar 8000? > >2. If I have a field in a table that needs to be over varchar(255), >but will only be populated about 20% of the time, should I put that >field in its own table with an id value and just store the id value in >the table? In other words, do I take a performance hit even when my >field is empty? > > >--Susan > > >Susan B. Geller >Office of Information Systems >College of Continuing Education >University of Minnesota >306 Wesbrook Hall >77 Pleasant Street SE >Minneapolis, MN 55455 >Phone: 612-626-4785 >Fax: 612-625-2568 > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin .msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca _______________________________________________ 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 Dec 16 09:13:01 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 16 Dec 2003 09:13:01 -0600 Subject: [dba-SQLServer]Large varchar fields -- performance implications? Message-ID: <3CCEA32DFF043C4CB99B835557E11B300318680A@ex02.eagle.usaa.com> VARCHAR datatype does not take the maximum allowed number of characters unless they are actually used. This means that if I have a field declared as VARCHAR(8000) and store a 10-character value there are 7,992 characters that are avalable on the page for the rest of the fields in the table. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Geller Sent: Tuesday, December 16, 2003 7:21 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? I believe Billy is correct. I read a bit about this in Delaney's book on SQL Server and it is all about how you can use pages. The fewer the pages, the more efficient your I/O. A page can hold 8K. Thanks, Billy. --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Billy Pang Sent: Monday, December 15, 2003 5:54 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? Somebody correct me if I am wrong but if you are concerned about performance, keep your tables thin. Basic unit of storage in sql server is a page. For a table, the more rows you can fit into an 8k page, the better the performance. This is because when you query that table, sql server goes through less pages when gathering the results. For example, you have two phone books, each with equal number of entries. The first phone book is your standard phone book with 400 names per page. The second phone book has 1 name per page (and thus is 400 times thicker than first phone book). It would take you less time to find a name in the first phone book than second phone book. HTH Billy >From: "Susan Geller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]Large varchar fields -- performance >implications? >Date: Mon, 15 Dec 2003 14:52:52 -0600 > >I am working on a data model and have some questions about large (that >is over 255) sized varchar fields. > >1. Does it matter what size the varchar is once it is over 255? That >is, do you take the same performance hit for a varchar 260 as for a >varchar 8000? > >2. If I have a field in a table that needs to be over varchar(255), >but will only be populated about 20% of the time, should I put that >field in its own table with an id value and just store the id value in >the table? In other words, do I take a performance hit even when my >field is empty? > > >--Susan > > >Susan B. Geller >Office of Information Systems >College of Continuing Education >University of Minnesota >306 Wesbrook Hall >77 Pleasant Street SE >Minneapolis, MN 55455 >Phone: 612-626-4785 >Fax: 612-625-2568 > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin .msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca _______________________________________________ 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 Tue Dec 16 09:15:24 2003 From: Robert.Djabarov at usaa.com (Djabarov, Robert) Date: Tue, 16 Dec 2003 09:15:24 -0600 Subject: [dba-SQLServer]Large varchar fields -- performance implications? Message-ID: <3CCEA32DFF043C4CB99B835557E11B300318680D@ex02.eagle.usaa.com> Sorry, I was thinking about an 8-character value, thus - my math is really bad this morning :) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Djabarov, Robert Sent: Tuesday, December 16, 2003 9:13 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? VARCHAR datatype does not take the maximum allowed number of characters unless they are actually used. This means that if I have a field declared as VARCHAR(8000) and store a 10-character value there are 7,992 characters that are avalable on the page for the rest of the fields in the table. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Geller Sent: Tuesday, December 16, 2003 7:21 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? I believe Billy is correct. I read a bit about this in Delaney's book on SQL Server and it is all about how you can use pages. The fewer the pages, the more efficient your I/O. A page can hold 8K. Thanks, Billy. --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Billy Pang Sent: Monday, December 15, 2003 5:54 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? Somebody correct me if I am wrong but if you are concerned about performance, keep your tables thin. Basic unit of storage in sql server is a page. For a table, the more rows you can fit into an 8k page, the better the performance. This is because when you query that table, sql server goes through less pages when gathering the results. For example, you have two phone books, each with equal number of entries. The first phone book is your standard phone book with 400 names per page. The second phone book has 1 name per page (and thus is 400 times thicker than first phone book). It would take you less time to find a name in the first phone book than second phone book. HTH Billy >From: "Susan Geller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]Large varchar fields -- performance >implications? >Date: Mon, 15 Dec 2003 14:52:52 -0600 > >I am working on a data model and have some questions about large (that >is over 255) sized varchar fields. > >1. Does it matter what size the varchar is once it is over 255? That >is, do you take the same performance hit for a varchar 260 as for a >varchar 8000? > >2. If I have a field in a table that needs to be over varchar(255), >but will only be populated about 20% of the time, should I put that >field in its own table with an id value and just store the id value in >the table? In other words, do I take a performance hit even when my >field is empty? > > >--Susan > > >Susan B. Geller >Office of Information Systems >College of Continuing Education >University of Minnesota >306 Wesbrook Hall >77 Pleasant Street SE >Minneapolis, MN 55455 >Phone: 612-626-4785 >Fax: 612-625-2568 > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin .msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca _______________________________________________ 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 liam at energyexhausts.co.uk Tue Dec 16 08:32:06 2003 From: liam at energyexhausts.co.uk (Liam Meadows) Date: Tue, 16 Dec 2003 14:32:06 -0000 Subject: [dba-SQLServer]SQL HELP (IIF or IF) Message-ID: <125066531861D043863CE6453EE8509EA941@energys1.energy.local> I'm trying to build an SQL Query in Access ADP and could do with some help Basically I am trying to build a list that shows qty x cost against a list of part numbers but also to not add the cost of certain codes So for instance if I selected P4 using like I would not want it added into the Tcost2 column Part Qty Cost1 TCost1 Tcost2 P1 2 2.0 4 4 P2 3 3.0 9 9 P3 2 1.0 2 2 P4 1 5.00 5 0 Is this possible from an SQL query, it is under Access MDB using IIF but there seems to be no alternative for SQL server. Cheers Liam From sgeller at cce.umn.edu Tue Dec 16 12:22:41 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Tue, 16 Dec 2003 12:22:41 -0600 Subject: [dba-SQLServer]Large varchar fields -- performance implications? Message-ID: This is true, but as Delaney points out, there can be performance issues when you increase how much data is actually in the varchar, especially if you have a clustered index. In order to accommodate the growth and maintain the index, a new page would be created thus decreasing performance. --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Djabarov, Robert Sent: Tuesday, December 16, 2003 9:15 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? Sorry, I was thinking about an 8-character value, thus - my math is really bad this morning :) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Djabarov, Robert Sent: Tuesday, December 16, 2003 9:13 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? VARCHAR datatype does not take the maximum allowed number of characters unless they are actually used. This means that if I have a field declared as VARCHAR(8000) and store a 10-character value there are 7,992 characters that are avalable on the page for the rest of the fields in the table. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Geller Sent: Tuesday, December 16, 2003 7:21 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? I believe Billy is correct. I read a bit about this in Delaney's book on SQL Server and it is all about how you can use pages. The fewer the pages, the more efficient your I/O. A page can hold 8K. Thanks, Billy. --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Billy Pang Sent: Monday, December 15, 2003 5:54 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Large varchar fields -- performance implications? Somebody correct me if I am wrong but if you are concerned about performance, keep your tables thin. Basic unit of storage in sql server is a page. For a table, the more rows you can fit into an 8k page, the better the performance. This is because when you query that table, sql server goes through less pages when gathering the results. For example, you have two phone books, each with equal number of entries. The first phone book is your standard phone book with 400 names per page. The second phone book has 1 name per page (and thus is 400 times thicker than first phone book). It would take you less time to find a name in the first phone book than second phone book. HTH Billy >From: "Susan Geller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]Large varchar fields -- performance >implications? >Date: Mon, 15 Dec 2003 14:52:52 -0600 > >I am working on a data model and have some questions about large (that >is over 255) sized varchar fields. > >1. Does it matter what size the varchar is once it is over 255? That >is, do you take the same performance hit for a varchar 260 as for a >varchar 8000? > >2. If I have a field in a table that needs to be over varchar(255), >but will only be populated about 20% of the time, should I put that >field in its own table with an id value and just store the id value in >the table? In other words, do I take a performance hit even when my >field is empty? > > >--Susan > > >Susan B. Geller >Office of Information Systems >College of Continuing Education >University of Minnesota >306 Wesbrook Hall >77 Pleasant Street SE >Minneapolis, MN 55455 >Phone: 612-626-4785 >Fax: 612-625-2568 > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin .msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca _______________________________________________ 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 mikedorism at adelphia.net Tue Dec 16 13:00:37 2003 From: mikedorism at adelphia.net (Mike & Doris Manning) Date: Tue, 16 Dec 2003 14:00:37 -0500 Subject: [dba-SQLServer]SQL HELP (IIF or IF) In-Reply-To: <125066531861D043863CE6453EE8509EA941@energys1.energy.local> Message-ID: <000001c3c406$e4e9a0b0$8b194244@hargrove.internal> Take a look at CASE WHEN in the help files. 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 Liam Meadows Sent: Tuesday, December 16, 2003 9:32 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer]SQL HELP (IIF or IF) I'm trying to build an SQL Query in Access ADP and could do with some help Basically I am trying to build a list that shows qty x cost against a list of part numbers but also to not add the cost of certain codes So for instance if I selected P4 using like I would not want it added into the Tcost2 column Part Qty Cost1 TCost1 Tcost2 P1 2 2.0 4 4 P2 3 3.0 9 9 P3 2 1.0 2 2 P4 1 5.00 5 0 Is this possible from an SQL query, it is under Access MDB using IIF but there seems to be no alternative for SQL server. Cheers Liam _______________________________________________ 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 Tue Dec 16 23:43:00 2003 From: artful at rogers.com (Arthur Fuller) Date: Tue, 16 Dec 2003 21:43:00 -0800 Subject: [dba-SQLServer] Data Transformation Packages from SQL Server 2Kto Oracle 9 In-Reply-To: <3FDEB1CE.5050806@shaw.ca> Message-ID: <000601c3c460$a2049660$6701a8c0@rock> I looked through his code and while I did not find his app up to my needs, I did find enough code to easily change it to suit my requirements. He did a very nice job, IMO. Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of MartyConnelly Sent: Monday, December 15, 2003 11:19 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Data Transformation Packages from SQL Server 2Kto Oracle 9 I don't know if this would be any help but the VB source code for a large DMO-SQL program equivalent to Enterprise Manger is available here. http://www.asql.biz/DbaMgr.shtm http://www.asql.biz/DbaMgr/DownLoad.shtm If not you could e-mail Andrea Montanari at andrea.sql at virgilio.it and he might be able to point you in the right direction Microsoft finally made him an MVP last month. Stoker, Kenneth E wrote: >Everyone, > >Has anyone had any experience with this? I have a coworker who came to >me asking if I could help him. I don't have any experience working >with Oracle within DTS. > >We are trying to first validate what data is in the Oracle 9 database >and make inserts from the SQL Server database of what is missing. > >Does anyone also have any good book recommendations for programming DTS >Packages? > >Thanks everyone. Always a help. > >Ken Stoker >Technology Commercialization >Information Systems Administrator >PH: (509) 375-3758 >FAX: (509) 375-6731 >E-mail: Kenneth.Stoker at pnl.gov > > > -- Marty Connelly Victoria, B.C. Canada _______________________________________________ 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 Tue Dec 16 23:43:00 2003 From: artful at rogers.com (Arthur Fuller) Date: Tue, 16 Dec 2003 21:43:00 -0800 Subject: [dba-SQLServer] Data Transformation Packages from SQL Server 2Kto Oracle 9 In-Reply-To: <3FDEB1CE.5050806@shaw.ca> Message-ID: <000601c3c460$a2049660$6701a8c0@rock> I looked through his code and while I did not find his app up to my needs, I did find enough code to easily change it to suit my requirements. He did a very nice job, IMO. Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of MartyConnelly Sent: Monday, December 15, 2003 11:19 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Data Transformation Packages from SQL Server 2Kto Oracle 9 I don't know if this would be any help but the VB source code for a large DMO-SQL program equivalent to Enterprise Manger is available here. http://www.asql.biz/DbaMgr.shtm http://www.asql.biz/DbaMgr/DownLoad.shtm If not you could e-mail Andrea Montanari at andrea.sql at virgilio.it and he might be able to point you in the right direction Microsoft finally made him an MVP last month. Stoker, Kenneth E wrote: >Everyone, > >Has anyone had any experience with this? I have a coworker who came to >me asking if I could help him. I don't have any experience working >with Oracle within DTS. > >We are trying to first validate what data is in the Oracle 9 database >and make inserts from the SQL Server database of what is missing. > >Does anyone also have any good book recommendations for programming DTS >Packages? > >Thanks everyone. Always a help. > >Ken Stoker >Technology Commercialization >Information Systems Administrator >PH: (509) 375-3758 >FAX: (509) 375-6731 >E-mail: Kenneth.Stoker at pnl.gov > > > -- Marty Connelly Victoria, B.C. Canada _______________________________________________ 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 Dec 17 07:27:45 2003 From: jcolby at colbyconsulting.com (John W. Colby) Date: Wed, 17 Dec 2003 08:27:45 -0500 Subject: [dba-SQLServer]Torn page Message-ID: I get an error entering data into a table of my billing database - "insert failed - torn page detected". If I go into the table I am attempting to enter data in,. nothing but #error# in all fields. Relinked table, same thing. Is this reparable? If so how? John W. Colby www.ColbyConsulting.com From mwp.reid at qub.ac.uk Wed Dec 17 08:04:52 2003 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Wed, 17 Dec 2003 14:04:52 -0000 Subject: [dba-SQLServer]Torn page References: Message-ID: <000d01c3c4a6$be23fa70$9111758f@aine> Not that I am aware. You may even need to recreate a new db and get the exisiting data transferred. Did you suffer a recent power failure etc Martin ----- Original Message ----- From: "John W. Colby" To: "SQLServer" Sent: Wednesday, December 17, 2003 1:27 PM Subject: [dba-SQLServer]Torn page > I get an error entering data into a table of my billing database - "insert > failed - torn page detected". If I go into the table I am attempting to > enter data in,. nothing but #error# in all fields. Relinked table, same > thing. > > Is this reparable? If so how? > > John W. Colby > www.ColbyConsulting.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From mwp.reid at qub.ac.uk Wed Dec 17 08:15:13 2003 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Wed, 17 Dec 2003 14:15:13 -0000 Subject: [dba-SQLServer]Torn page References: <000d01c3c4a6$be23fa70$9111758f@aine> Message-ID: <000901c3c4a8$300d8c90$9111758f@aine> Forgot to say, if you have a recent backup etc you can restore the DB Martin ----- Original Message ----- From: "Martin Reid" To: Sent: Wednesday, December 17, 2003 2:04 PM Subject: Re: [dba-SQLServer]Torn page > Not that I am aware. > > You may even need to recreate a new db and get the exisiting data > transferred. Did you suffer a recent power failure etc > > Martin > > > ----- Original Message ----- > From: "John W. Colby" > To: "SQLServer" > Sent: Wednesday, December 17, 2003 1:27 PM > Subject: [dba-SQLServer]Torn page > > > > I get an error entering data into a table of my billing database - "insert > > failed - torn page detected". If I go into the table I am attempting to > > enter data in,. nothing but #error# in all fields. Relinked table, same > > thing. > > > > Is this reparable? If so how? > > > > John W. Colby > > 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 > > From rgilimited at btconnect.com Wed Dec 17 08:46:07 2003 From: rgilimited at btconnect.com (Robin Lawrence) Date: Wed, 17 Dec 2003 14:46:07 -0000 Subject: [dba-SQLServer]Torn page In-Reply-To: Message-ID: <000201c3c4ac$818a7660$5373a8c0@local> John, Further info at http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodt echnol/sql/reskit/sql7res/part8/sqc10.asp Q: What happens when SQL Server detects a torn page? A: When a torn page is detected, a severe I/O error is raised. This error closes the connection. The database is marked suspect only if the torn page is detected during recovery. Q: How can I recover from torn pages? A: Restoring the database from a backup and rolling the transaction log forward should correct the problem with no data loss. HTH Rgds Robin Lawrence -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of John W. Colby Sent: 17 December 2003 13:28 To: SQLServer Subject: [dba-SQLServer]Torn page I get an error entering data into a table of my billing database - "insert failed - torn page detected". If I go into the table I am attempting to enter data in,. nothing but #error# in all fields. Relinked table, same thing. Is this reparable? If so how? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From andrew.haslett at ilc.gov.au Wed Dec 17 18:45:42 2003 From: andrew.haslett at ilc.gov.au (Haslett, Andrew) Date: Thu, 18 Dec 2003 11:15:42 +1030 Subject: [dba-SQLServer]Torn page Message-ID: There's also a 'torn-page-detection' database setting, but I'm not sure if this will actually prevent errors.. -----Original Message----- From: Robin Lawrence [mailto:rgilimited at btconnect.com] Sent: Thursday, 18 December 2003 1:16 AM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Torn page John, Further info at http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodt echnol/sql/reskit/sql7res/part8/sqc10.asp Q: What happens when SQL Server detects a torn page? A: When a torn page is detected, a severe I/O error is raised. This error closes the connection. The database is marked suspect only if the torn page is detected during recovery. Q: How can I recover from torn pages? A: Restoring the database from a backup and rolling the transaction log forward should correct the problem with no data loss. HTH Rgds Robin Lawrence -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of John W. Colby Sent: 17 December 2003 13:28 To: SQLServer Subject: [dba-SQLServer]Torn page I get an error entering data into a table of my billing database - "insert failed - torn page detected". If I go into the table I am attempting to enter data in,. nothing but #error# in all fields. Relinked table, same thing. Is this reparable? If so how? John W. Colby 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 IMPORTANT - PLEASE READ ******************** This email and any files transmitted with it are confidential and may contain information protected by law from disclosure. If you have received this message in error, please notify the sender immediately and delete this email from your system. No warranty is given that this email or files, if attached to this email, are free from computer viruses or other defects. They are provided on the basis the user assumes all responsibility for loss, damage or consequence resulting directly or indirectly from their use, whether caused by the negligence of the sender or not. From artful at rogers.com Sat Dec 20 14:05:30 2003 From: artful at rogers.com (Arthur Fuller) Date: Sat, 20 Dec 2003 12:05:30 -0800 Subject: [dba-SQLServer]Please verify this In-Reply-To: Message-ID: <00ca01c3c734$9f3f52e0$6701a8c0@rock> Open Enterprise Manager. Open the Servers node and select a Server. Right click and select Properties. On my machine(s) EM thinks for a minute and then commits seppuku, without a warning or message or anything. Just dies. Arthur From tuxedo_man at hotmail.com Sat Dec 20 15:10:39 2003 From: tuxedo_man at hotmail.com (Billy Pang) Date: Sat, 20 Dec 2003 21:10:39 +0000 Subject: [dba-SQLServer]Please verify this Message-ID: By design, penalty of viewing server properties is not seppuku. Connection permissions, ok? >From: "Arthur Fuller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]Please verify this >Date: Sat, 20 Dec 2003 12:05:30 -0800 > >Open Enterprise Manager. Open the Servers node and select a Server. >Right click and select Properties. > >On my machine(s) EM thinks for a minute and then commits seppuku, >without a warning or message or anything. Just dies. > >Arthur > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca From artful at rogers.com Sun Dec 21 17:07:41 2003 From: artful at rogers.com (Arthur Fuller) Date: Sun, 21 Dec 2003 15:07:41 -0800 Subject: [dba-SQLServer]Please verify this In-Reply-To: Message-ID: <01f401c3c817$46b89210$6701a8c0@rock> The connections are fine. I can open any database and view any nodes, etc. I can select from 4 different servers and everything works as expected -- except right clicking on the database and selecting properties. Boom! Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Billy Pang Sent: Saturday, December 20, 2003 1:11 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Please verify this By design, penalty of viewing server properties is not seppuku. Connection permissions, ok? >From: "Arthur Fuller" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: [dba-SQLServer]Please verify this >Date: Sat, 20 Dec 2003 12:05:30 -0800 > >Open Enterprise Manager. Open the Servers node and select a Server. >Right click and select Properties. > >On my machine(s) EM thinks for a minute and then commits seppuku, >without a warning or message or anything. Just dies. > >Arthur > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin .msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca _______________________________________________ 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 Dec 22 10:53:40 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Mon, 22 Dec 2003 08:53:40 -0800 Subject: [dba-SQLServer]Please verify this In-Reply-To: <01f401c3c817$46b89210$6701a8c0@rock> References: <01f401c3c817$46b89210$6701a8c0@rock> Message-ID: <3FE72194.4020305@verizon.net> NT authentication or SQL (for your registration). -- -Francisco Arthur Fuller wrote: >The connections are fine. I can open any database and view any nodes, >etc. I can select from 4 different servers and everything works as >expected -- except right clicking on the database and selecting >properties. Boom! > >Arthur > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Billy >Pang >Sent: Saturday, December 20, 2003 1:11 PM >To: dba-sqlserver at databaseadvisors.com >Subject: RE: [dba-SQLServer]Please verify this > > >By design, penalty of viewing server properties is not seppuku. >Connection permissions, ok? > > > > > >>From: "Arthur Fuller" >>Reply-To: dba-sqlserver at databaseadvisors.com >>To: >>Subject: [dba-SQLServer]Please verify this >>Date: Sat, 20 Dec 2003 12:05:30 -0800 >> >>Open Enterprise Manager. Open the Servers node and select a Server. >>Right click and select Properties. >> >>On my machine(s) EM thinks for a minute and then commits seppuku, >>without a warning or message or anything. Just dies. >> >>Arthur >> >> >> From artful at rogers.com Tue Dec 23 11:42:14 2003 From: artful at rogers.com (Arthur Fuller) Date: Tue, 23 Dec 2003 09:42:14 -0800 Subject: [dba-SQLServer]MSDE User Throttle Message-ID: <006001c3c97c$1a063d10$6701a8c0@rock> Information on this topic seems to be particularly mushy. IIRC, MSDE is supposed to work exactly the same way as SQL 2K up to a certain number of users, which I believe was specified as 5. I have personally seen it work just fine in test circumstances with 10 users. I recall reading a post either here or maybe on one of the other SQL lists I belong to that a developer had a working MSDE install with 50+ users, and no performance degradation. Has anyone here got any real-world experience with going beyond the alleged user limit in a production system, or even in a test system? Another question: how would ADO.NET affect the throttle? For those who don't know, ADO.NET is a significant departure from standard ADO, notably in its use of disconnected recordsets.... The implication being that your period of connection is very brief. So would 50 users using ADO.NET cause the throttle to kick in? Does anyone know of any actual benchmark tests that demonstrate the MSDE throttle's effect? I am no longer in a position to set up such a test using 25-50 computers; would a test using 5 computers with several instances of some app or other (Access, QA, whatever) be valid? Arthur From martyconnelly at shaw.ca Tue Dec 23 11:45:03 2003 From: martyconnelly at shaw.ca (MartyConnelly) Date: Tue, 23 Dec 2003 09:45:03 -0800 Subject: [dba-SQLServer]MSDE User Throttle References: <006001c3c97c$1a063d10$6701a8c0@rock> Message-ID: <3FE87F1F.7010707@shaw.ca> You can write your own benchmark ;). You can track the amount of throttling going on through DBCC and logs I once tracked this and kept a log in an access table. There is more on url below or SQL BOL search on ( DBCC CONCURRENCYVIOLATION ) Watch out below for yellow on white tips (kind of hard to read in IE click on white area to see. http://www.betav.com/Files/Content/Whitepapers/msde_files/msde.htm To track the throttling you can use something like SP below with DBCC or turn it on in the SQL log, it gives you the number of times you have exceed the 5 connection limit. This dumps the following records to database table. Concurrency violations since 2003-01-21 12:20:43.747 1 2 3 4 5 6 7 8 9 10-100 >100 0 0 0 0 0 0 0 0 0 0 0 Concurrency violations will be written to the SQL Server error log. ALTER PROCEDURE StoredProcedureDBCCworks /* ( @parameter1 datatype = default value, @parameter2 datatype OUTPUT ) */ AS SET NOCOUNT ON -- Create the table to accept the results or use #tracestatus #indicates temptable If NOT EXISTS (SELECT * FROM SYSOBJECTS WHERE ID = OBJECT_ID('DBCCtracestatus ') AND sysstat & 0xf=3) DROP TABLE DBCCtracestatus BEGIN CREATE TABLE DBCCtracestatus ( maint varchar(4096), TraceFlag INT, Status INT ) END I lifted parts of it I think from Betav.com( no longer there), but is pretty basic calls. The only thing unusual is the select statement. I just put it together for a client group that was interested; can't find my final code I would rewrite but need a network to test on ; or run a dozen or so access mssql clients from my machine to check. You can do this by hand starting the dbcctrace to sql error logging from OSQL then sifting through the error log. Susan Harkin wanted to write an article on this recently but I don't have a network handy to test on or all the final code. Arthur Fuller wrote: >Information on this topic seems to be particularly mushy. IIRC, MSDE is >supposed to work exactly the same way as SQL 2K up to a certain number >of users, which I believe was specified as 5. I have personally seen it >work just fine in test circumstances with 10 users. I recall reading a >post either here or maybe on one of the other SQL lists I belong to that >a developer had a working MSDE install with 50+ users, and no >performance degradation. > >Has anyone here got any real-world experience with going beyond the >alleged user limit in a production system, or even in a test system? > >Another question: how would ADO.NET affect the throttle? For those who >don't know, ADO.NET is a significant departure from standard ADO, >notably in its use of disconnected recordsets.... The implication being >that your period of connection is very brief. So would 50 users using >ADO.NET cause the throttle to kick in? > >Does anyone know of any actual benchmark tests that demonstrate the MSDE >throttle's effect? I am no longer in a position to set up such a test >using 25-50 computers; would a test using 5 computers with several >instances of some app or other (Access, QA, whatever) be valid? > >Arthur > > > -- Marty Connelly Victoria, B.C. Canada From artful at rogers.com Tue Dec 23 18:18:54 2003 From: artful at rogers.com (Arthur Fuller) Date: Tue, 23 Dec 2003 16:18:54 -0800 Subject: [dba-SQLServer]MSDE User Throttle In-Reply-To: <3FE87F1F.7010707@shaw.ca> Message-ID: <002f01c3c9b3$840a91c0$6701a8c0@rock> Thanks for the contribution, Marty! I will start a suite based on your code. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of MartyConnelly Sent: Tuesday, December 23, 2003 9:45 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]MSDE User Throttle You can write your own benchmark ;). You can track the amount of throttling going on through DBCC and logs I once tracked this and kept a log in an access table. There is more on url below or SQL BOL search on ( DBCC CONCURRENCYVIOLATION ) Watch out below for yellow on white tips (kind of hard to read in IE click on white area to see. http://www.betav.com/Files/Content/Whitepapers/msde_files/msde.htm To track the throttling you can use something like SP below with DBCC or turn it on in the SQL log, it gives you the number of times you have exceed the 5 connection limit. This dumps the following records to database table. Concurrency violations since 2003-01-21 12:20:43.747 1 2 3 4 5 6 7 8 9 10-100 >100 0 0 0 0 0 0 0 0 0 0 0 Concurrency violations will be written to the SQL Server error log. ALTER PROCEDURE StoredProcedureDBCCworks /* ( @parameter1 datatype = default value, @parameter2 datatype OUTPUT ) */ AS SET NOCOUNT ON -- Create the table to accept the results or use #tracestatus #indicates temptable If NOT EXISTS (SELECT * FROM SYSOBJECTS WHERE ID = OBJECT_ID('DBCCtracestatus ') AND sysstat & 0xf=3) DROP TABLE DBCCtracestatus BEGIN CREATE TABLE DBCCtracestatus ( maint varchar(4096), TraceFlag INT, Status INT ) END I lifted parts of it I think from Betav.com( no longer there), but is pretty basic calls. The only thing unusual is the select statement. I just put it together for a client group that was interested; can't find my final code I would rewrite but need a network to test on ; or run a dozen or so access mssql clients from my machine to check. You can do this by hand starting the dbcctrace to sql error logging from OSQL then sifting through the error log. Susan Harkin wanted to write an article on this recently but I don't have a network handy to test on or all the final code. Arthur Fuller wrote: >Information on this topic seems to be particularly mushy. IIRC, MSDE is >supposed to work exactly the same way as SQL 2K up to a certain number >of users, which I believe was specified as 5. I have personally seen it >work just fine in test circumstances with 10 users. I recall reading a >post either here or maybe on one of the other SQL lists I belong to >that a developer had a working MSDE install with 50+ users, and no >performance degradation. > >Has anyone here got any real-world experience with going beyond the >alleged user limit in a production system, or even in a test system? > >Another question: how would ADO.NET affect the throttle? For those who >don't know, ADO.NET is a significant departure from standard ADO, >notably in its use of disconnected recordsets.... The implication being >that your period of connection is very brief. So would 50 users using >ADO.NET cause the throttle to kick in? > >Does anyone know of any actual benchmark tests that demonstrate the >MSDE throttle's effect? I am no longer in a position to set up such a >test using 25-50 computers; would a test using 5 computers with several >instances of some app or other (Access, QA, whatever) be valid? > >Arthur > > > -- Marty Connelly Victoria, B.C. Canada _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From mwp.reid at qub.ac.uk Wed Dec 24 04:48:21 2003 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Wed, 24 Dec 2003 02:48:21 -0800 Subject: [dba-SQLServer]MSDE User Throttle References: <006001c3c97c$1a063d10$6701a8c0@rock> Message-ID: <003d01c3ca0b$745a6cc0$38f66e51@martin1> Arthur Its not users at all but threads of operation. Rusell Simclair the TE on a book says he was working on a production system with up to 300 users. Havnt seen it but I take his word for it. Its not affected by the language either. Its built into the db engine. 5 PCs wiht all actually doing something on the engine should show how this works. I posted a URL on this some time ago but cant find it now. Maybe someone has it. Martin ----- Original Message ----- From: "Arthur Fuller" To: "dba-SQLServer" Sent: Tuesday, December 23, 2003 9:42 AM Subject: [dba-SQLServer]MSDE User Throttle > Information on this topic seems to be particularly mushy. IIRC, MSDE is > supposed to work exactly the same way as SQL 2K up to a certain number > of users, which I believe was specified as 5. I have personally seen it > work just fine in test circumstances with 10 users. I recall reading a > post either here or maybe on one of the other SQL lists I belong to that > a developer had a working MSDE install with 50+ users, and no > performance degradation. > > Has anyone here got any real-world experience with going beyond the > alleged user limit in a production system, or even in a test system? > > Another question: how would ADO.NET affect the throttle? For those who > don't know, ADO.NET is a significant departure from standard ADO, > notably in its use of disconnected recordsets.... The implication being > that your period of connection is very brief. So would 50 users using > ADO.NET cause the throttle to kick in? > > Does anyone know of any actual benchmark tests that demonstrate the MSDE > throttle's effect? I am no longer in a position to set up such a test > using 25-50 computers; would a test using 5 computers with several > instances of some app or other (Access, QA, whatever) be valid? > > Arthur > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From knicholson at gpsx.net Wed Dec 24 09:35:07 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 24 Dec 2003 10:35:07 -0500 Subject: [dba-SQLServer]Two Databases, One Server Message-ID: Is it possible to create a view using tables from two different databases that reside on one server? From djkr at msn.com Wed Dec 24 11:40:16 2003 From: djkr at msn.com (DJK(John) Robinson) Date: Wed, 24 Dec 2003 17:40:16 -0000 Subject: [dba-SQLServer]Two Databases, One Server In-Reply-To: Message-ID: <001801c3ca44$fe402770$bf00a8c0@dabsight> Yes. John > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf > Of Nicholson, Karen > Sent: 24 December 2003 15:35 > To: Dba-Sqlserver (E-mail) > Subject: [dba-SQLServer]Two Databases, One Server > > > Is it possible to create a view using tables from two > different databases that reside on one server? > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From knicholson at gpsx.net Wed Dec 24 11:43:41 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 24 Dec 2003 12:43:41 -0500 Subject: [dba-SQLServer]Two Databases, One Server Message-ID: I figured it out. Monitordb.dbo.alarm_incident (preface with the database name, owner and the table needed). -----Original Message----- From: DJK(John) Robinson [mailto:djkr at msn.com] Sent: Wednesday, December 24, 2003 12:40 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Two Databases, One Server Yes. John > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf > Of Nicholson, Karen > Sent: 24 December 2003 15:35 > To: Dba-Sqlserver (E-mail) > Subject: [dba-SQLServer]Two Databases, One Server > > > Is it possible to create a view using tables from two > different databases that reside on one server? > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Wed Dec 24 15:40:47 2003 From: artful at rogers.com (Arthur Fuller) Date: Wed, 24 Dec 2003 13:40:47 -0800 Subject: [dba-SQLServer]Two Databases, One Server In-Reply-To: Message-ID: <00b101c3ca66$98901440$6701a8c0@rock> I have two copies of Northwind installed, one called Northwind and my customizations to it called NorthwindCS. Running QA and selecting NorthwindCS first.... Select * from Customers inner join Northwind.dbo.Orders on Customers.CustomerID = Northwind.dbo.Orders.CustomerID Works fine. HTH, Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Nicholson, Karen Sent: Wednesday, December 24, 2003 7:35 AM To: Dba-Sqlserver (E-mail) Subject: [dba-SQLServer]Two Databases, One Server Is it possible to create a view using tables from two different databases that reside on one server? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From knicholson at gpsx.net Wed Dec 24 12:57:12 2003 From: knicholson at gpsx.net (Nicholson, Karen) Date: Wed, 24 Dec 2003 13:57:12 -0500 Subject: [dba-SQLServer]Two Databases, One Server Message-ID: Yep, it is pretty slicko.. thanks. -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Wednesday, December 24, 2003 4:41 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]Two Databases, One Server I have two copies of Northwind installed, one called Northwind and my customizations to it called NorthwindCS. Running QA and selecting NorthwindCS first.... Select * from Customers inner join Northwind.dbo.Orders on Customers.CustomerID = Northwind.dbo.Orders.CustomerID Works fine. HTH, Arthur -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Nicholson, Karen Sent: Wednesday, December 24, 2003 7:35 AM To: Dba-Sqlserver (E-mail) Subject: [dba-SQLServer]Two Databases, One Server Is it possible to create a view using tables from two different databases that reside on one server? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From sgeller at cce.umn.edu Wed Dec 31 10:07:21 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Wed, 31 Dec 2003 10:07:21 -0600 Subject: [dba-SQLServer]Errors only in larger screen resolutions Message-ID: I have an adp file that has one form that is generating a "fatal error" report only when I have my monitor (or any other test monitors) set to lower than 1280 X 1024. Access 2002, Windows XP. Ideas? I've only seen a similar problem once before and it turned out to be related to how I was loading the recordsource for a listbox. But, on the open of this form, there is no list box record source being set. --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 From my.lists at verizon.net Wed Dec 31 11:28:53 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 31 Dec 2003 09:28:53 -0800 Subject: [dba-SQLServer]Errors only in larger screen resolutions In-Reply-To: References: Message-ID: <3FF30755.2010603@verizon.net> I've never seen this error... have you tried a /decompile on the .adp? Susan Geller wrote: >I have an adp file that has one form that is generating a "fatal error" >report only when I have my monitor (or any other test monitors) set to >lower than 1280 X 1024. Access 2002, Windows XP. Ideas? I've only >seen a similar problem once before and it turned out to be related to >how I was loading the recordsource for a listbox. But, on the open of >this form, there is no list box record source being set. > >--Susan > > -- -Francisco From my.lists at verizon.net Wed Dec 31 11:32:33 2003 From: my.lists at verizon.net (Francisco H Tapia) Date: Wed, 31 Dec 2003 09:32:33 -0800 Subject: [dba-SQLServer] Re: SQL Server 2000 - Need to change a value in a primary key... In-Reply-To: References: Message-ID: <3FF30831.7050504@verizon.net> I'm cc'ing the Sql list as this is a Sql question... :) It's Identity Insert ON (tablename) your update/insert statement that inclues the primay key then Identity Insert OFF YOU MUST turn it off otherwise it stays on the entire time (iirc of the session). for more info check out BOL (Books on line) to subscribe to the dba-SqlServer list go to http://databaseadvisors.com/mailman/listinfo/dba-sqlserver Melissa Sener wrote: >Does anybody know how to change a value in a primary key in SQL Server 2000? > >Melissa > > -- -Francisco From sgeller at cce.umn.edu Wed Dec 31 11:59:39 2003 From: sgeller at cce.umn.edu (Susan Geller) Date: Wed, 31 Dec 2003 11:59:39 -0600 Subject: [dba-SQLServer]Errors only in larger screen resolutions Message-ID: Nope, but I don't think that is it. We rebuilt the adp by detaching all code from the app and saving it into separate text files and then reattaching the code and then recompiling and that did nothing. But, we may still try decompile. --Susan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco H Tapia Sent: Wednesday, December 31, 2003 11:29 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer]Errors only in larger screen resolutions I've never seen this error... have you tried a /decompile on the .adp? Susan Geller wrote: >I have an adp file that has one form that is generating a "fatal error" >report only when I have my monitor (or any other test monitors) set to >lower than 1280 X 1024. Access 2002, Windows XP. Ideas? I've only >seen a similar problem once before and it turned out to be related to >how I was loading the recordsource for a listbox. But, on the open of >this form, there is no list box record source being set. > >--Susan > > -- -Francisco _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com