From jwcolby at colbyconsulting.com Thu Jan 3 13:57:49 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 3 Jan 2008 14:57:49 -0500 Subject: [dba-SQLServer] Can't find the principal Message-ID: <004701c84e42$eb400ab0$657aa8c0@M90> I have databases that I created on one machine. When I move the database file to a different machine I get a "can't find the principal" error when trying to mount the database on the new machine. The reason appears to be that the owner is the user under which the database was created on the old system. How do i get around this? John W. Colby Colby Consulting www.ColbyConsulting.com From fuller.artful at gmail.com Thu Jan 3 14:05:14 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 3 Jan 2008 15:05:14 -0500 Subject: [dba-SQLServer] Can't find the principal In-Reply-To: <004701c84e42$eb400ab0$657aa8c0@M90> References: <004701c84e42$eb400ab0$657aa8c0@M90> Message-ID: <29f585dd0801031205o5613cc2fy604db8722aef7b1b@mail.gmail.com> Supposedly you can just change owners, but I've never been able to make that work correctly (could be my stupidity rather than an MS problem). But I've gotten around this by creating a new database and then importing everything from the other one. Then the ownership stuff on the new database is fine, and then you can delete the old one. A. On 1/3/08, jwcolby wrote: > > I have databases that I created on one machine. When I move the database > file to a different machine I get a "can't find the principal" error when > trying to mount the database on the new machine. The reason appears to be > that the owner is the user under which the database was created on the old > system. > > How do i get around this? > From jwcolby at colbyconsulting.com Thu Jan 3 14:59:02 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 3 Jan 2008 15:59:02 -0500 Subject: [dba-SQLServer] Can't find the principal In-Reply-To: <29f585dd0801031205o5613cc2fy604db8722aef7b1b@mail.gmail.com> References: <004701c84e42$eb400ab0$657aa8c0@M90> <29f585dd0801031205o5613cc2fy604db8722aef7b1b@mail.gmail.com> Message-ID: <004801c84e4b$78cca390$657aa8c0@M90> Well, after getting the error while trying to mount two databases on Stonehenge from my laptop M90, I decided to go to Stonehenge directly and both databases were actually mounted. I then refreshed the database collection on M90 and they were there. So the issue is not as serious as I thought, just a trivial error of some sort while doing the mount. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Thursday, January 03, 2008 3:05 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Can't find the principal Supposedly you can just change owners, but I've never been able to make that work correctly (could be my stupidity rather than an MS problem). But I've gotten around this by creating a new database and then importing everything from the other one. Then the ownership stuff on the new database is fine, and then you can delete the old one. A. On 1/3/08, jwcolby wrote: > > I have databases that I created on one machine. When I move the > database file to a different machine I get a "can't find the > principal" error when trying to mount the database on the new machine. > The reason appears to be that the owner is the user under which the > database was created on the old system. > > How do i get around this? > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jan 3 22:58:53 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 3 Jan 2008 23:58:53 -0500 Subject: [dba-SQLServer] Running two copies of the same database Message-ID: <000301c84e8e$81929910$657aa8c0@M90> I have two servers Stonehenge and Azul, so called for the desktop wallpaper they run so that I can tell them apart when on my KVM. Each is running Windows Server 2003 and SQL Server 2005. These machines are essentially identical and have a large raid array. Stonehenge has been the main machine and I have been backing up the databases from Stonehenge to Azul in case of corruption or other problems that Raid 6 doesn't cover. With the advent of WHS and the possibility of using it as a backup tool, I am wanting to do something to get actual use out of the second server. I actually have done some "research" kind of stuff such as the previously mentioned "vertical vs horizontal vs cover index" on Azul but the main server is Stonehenge. The problem as you might imagine is that due to the size of these databases (several over 100 gb and one over 200 gb) and the fact that I can and do mount the copies on Azul and use them in the research, it becomes tough to figure out which is "the latest". What I am wondering is whether there is a way to "mirror" the databases on two different machines such that they actually can be run on either machine and any changes made to one get written to the other in the background. Probably this weekend I am also about to try to bring up a Windows 2003 x64 and SQL Server 64 machine (as yet unnamed since I haven't picked the wallpaper). If I succeed then it may very well become the main workhorse since it will be able to access a full 8 gigs of ram, and I will move the quad core processor over there. Due to the expanded ram and quad processors I may also start doing virtual machines on that new server as well. So, any thoughts on organization matters here? John W. Colby Colby Consulting www.ColbyConsulting.com From fhtapia at gmail.com Thu Jan 3 23:21:31 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 3 Jan 2008 21:21:31 -0800 Subject: [dba-SQLServer] Running two copies of the same database In-Reply-To: <000301c84e8e$81929910$657aa8c0@M90> References: <000301c84e8e$81929910$657aa8c0@M90> Message-ID: look into database mirroring from Sql Server 2005, this is a pretty cool feature, and allows you to have 2 db's synched at all times. you can even specify how the system should behave should you have a failover. On Jan 3, 2008 8:58 PM, jwcolby wrote: > I have two servers Stonehenge and Azul, so called for the desktop > wallpaper > they run so that I can tell them apart when on my KVM. Each is running > Windows Server 2003 and SQL Server 2005. These machines are essentially > identical and have a large raid array. Stonehenge has been the main > machine > and I have been backing up the databases from Stonehenge to Azul in case > of > corruption or other problems that Raid 6 doesn't cover. With the advent > of > WHS and the possibility of using it as a backup tool, I am wanting to do > something to get actual use out of the second server. I actually have > done > some "research" kind of stuff such as the previously mentioned "vertical > vs > horizontal vs cover index" on Azul but the main server is Stonehenge. > > The problem as you might imagine is that due to the size of these > databases > (several over 100 gb and one over 200 gb) and the fact that I can and do > mount the copies on Azul and use them in the research, it becomes tough to > figure out which is "the latest". > > What I am wondering is whether there is a way to "mirror" the databases on > two different machines such that they actually can be run on either > machine > and any changes made to one get written to the other in the background. > > Probably this weekend I am also about to try to bring up a Windows 2003 > x64 > and SQL Server 64 machine (as yet unnamed since I haven't picked the > wallpaper). If I succeed then it may very well become the main workhorse > since it will be able to access a full 8 gigs of ram, and I will move the > quad core processor over there. Due to the expanded ram and quad > processors > I may also start doing virtual machines on that new server as well. > > So, any thoughts on organization matters here? > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From fuller.artful at gmail.com Fri Jan 4 06:52:45 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 4 Jan 2008 07:52:45 -0500 Subject: [dba-SQLServer] SSM Access Migration Wizard Message-ID: <29f585dd0801040452s2763d5e0q59a9150ed23ea2c2@mail.gmail.com> I'm reading a paper about migrating access apps to SQL Server, and it's all about something called the SSM Access Migration Wizard, which I've never heard of before. Where does one obtain this? Is it already installed on my machine? If so, where do I find it? If not, where do I download it? (Access 2000, 2003 and 2007 are all installed; so are SQL 2000 and 2005, and Visual Studio.NET 2005.) TIA, Arthur From fuller.artful at gmail.com Fri Jan 4 06:57:56 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 4 Jan 2008 07:57:56 -0500 Subject: [dba-SQLServer] SSMA Message-ID: <29f585dd0801040457t27d7b02bs31869177f49601cb@mail.gmail.com> I found it. Migration wizards are also available for Oracle, Sybase and others, at http://www.microsoft.com/sql/solutions/migration/default.mspx, in case anyone is interested. A. From jwcolby at colbyconsulting.com Fri Jan 4 08:21:24 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 4 Jan 2008 09:21:24 -0500 Subject: [dba-SQLServer] Large cover index slows things down Message-ID: <000301c84edd$1679a930$657aa8c0@M90> I had an interesting occurrence today. I am processing an order on the database from hell. As a result of my research a few weeks ago I discovered that cover indexes on a field which includes the PK goes a long way in speeding things up. So I learned to create "single field" indexes where I index just a specific field (golf or walking for example) and adding in the PKID. In this case I need to process eight "hobby" fields, selecting records where any of these fields are 'Y'. So I created 8 indexes on these 8 fields. I then created a single query that pulled in all eight hobby fields in an OR such that any 'Y' in any field pulls the PKID. I then created a count of the PKID to see how many I got (7,704,210). I decided to go back in and create cover indexes on a group of the fields. These fields are consecutive in the table and tend to be called out in orders together, IOW Golf or running or skiing etc. In order to cover the 18 fields I created two cover indexes grouping the first 9 and then the second 9 (and the PKID in each index). The query actually slowed down significantly, going from 2 minutes 36 seconds when there was no larger cover indexes to 4 minutes 12 seconds after building these larger cover indexes. Understand that I was not using every single field from these 18 fields in the where clause, in fact only about 8 of them, but the 8 fields just happen to be split across the two larger cover indexes so that both would be used. understand too that I still have the "single field" cover indexes for all of the fields needed in my where clause. So it appears that the presence of a cover that included several of the fields in the where clause caused SQL Server to use the larger 8 field cover indexes rather than the individual "single field" cover indexes, and in so doing slowed down the query by about 40% or so. Hmmmm. John W. Colby Colby Consulting www.ColbyConsulting.com From fuller.artful at gmail.com Fri Jan 4 08:43:08 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 4 Jan 2008 09:43:08 -0500 Subject: [dba-SQLServer] Large cover index slows things down In-Reply-To: <000301c84edd$1679a930$657aa8c0@M90> References: <000301c84edd$1679a930$657aa8c0@M90> Message-ID: <29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com> John, T-SQL has what are known as Query Hints, which allow you to tell the query engine which indexes to use. The syntax is a tad hairy to document thoroughly here, but you can get to it quickly by searching BOL for Hints, which takes you to this URL: http://msdn2.microsoft.com/en-us/library/ms181714.aspx. Look at the Profiler results and then if you don't like what you see, add a hint or two or three and compare results. hth, Arthur On 1/4/08, jwcolby wrote: > > I had an interesting occurrence today. I am processing an order on the > database from hell. As a result of my research a few weeks ago I > discovered > that cover indexes on a field which includes the PK goes a long way in > speeding things up. So I learned to create "single field" indexes where I > index just a specific field (golf or walking for example) and adding in > the > PKID. In this case I need to process eight "hobby" fields, selecting > records where any of these fields are 'Y'. So I created 8 indexes on > these > 8 fields. > > I then created a single query that pulled in all eight hobby fields in an > OR > such that any 'Y' in any field pulls the PKID. I then created a count of > the PKID to see how many I got (7,704,210). I decided to go back in and > create cover indexes on a group of the fields. These fields are > consecutive > in the table and tend to be called out in orders together, IOW Golf or > running or skiing etc. In order to cover the 18 fields I created two > cover > indexes grouping the first 9 and then the second 9 (and the PKID in each > index). The query actually slowed down significantly, going from 2 > minutes > 36 seconds when there was no larger cover indexes to 4 minutes 12 seconds > after building these larger cover indexes. > > Understand that I was not using every single field from these 18 fields in > the where clause, in fact only about 8 of them, but the 8 fields just > happen > to be split across the two larger cover indexes so that both would be > used. > understand too that I still have the "single field" cover indexes for all > of > the fields needed in my where clause. > > So it appears that the presence of a cover that included several of the > fields in the where clause caused SQL Server to use the larger 8 field > cover > indexes rather than the individual "single field" cover indexes, and in so > doing slowed down the query by about 40% or so. > > Hmmmm. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Jan 4 09:09:31 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 4 Jan 2008 10:09:31 -0500 Subject: [dba-SQLServer] Large cover index slows things down In-Reply-To: <29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com> References: <000301c84edd$1679a930$657aa8c0@M90> <29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com> Message-ID: <000401c84ee3$cf2b18f0$657aa8c0@M90> Arthur, I knew these existed but have never used them. Given everything on my plate and my current state of knowledge or lack thereof, I might just delete the larger cover indexes back out. the use of the single field cover indexes has worked wonders on my processing times already. The client tends to ask for the same select fields over and over. in this case I had to add 8 new indexes but had three in place already. Luckily the creation of the cover indexes only takes 2 minutes or so per. Over time I will end up with every field already indexed and the process of filling an order will get less time consuming. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Friday, January 04, 2008 9:43 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Large cover index slows things down John, T-SQL has what are known as Query Hints, which allow you to tell the query engine which indexes to use. The syntax is a tad hairy to document thoroughly here, but you can get to it quickly by searching BOL for Hints, which takes you to this URL: http://msdn2.microsoft.com/en-us/library/ms181714.aspx. Look at the Profiler results and then if you don't like what you see, add a hint or two or three and compare results. hth, Arthur On 1/4/08, jwcolby wrote: > > I had an interesting occurrence today. I am processing an order on > the database from hell. As a result of my research a few weeks ago I > discovered that cover indexes on a field which includes the PK goes a > long way in speeding things up. So I learned to create "single field" > indexes where I index just a specific field (golf or walking for > example) and adding in the PKID. In this case I need to process eight > "hobby" fields, selecting records where any of these fields are 'Y'. > So I created 8 indexes on these > 8 fields. > > I then created a single query that pulled in all eight hobby fields in > an OR such that any 'Y' in any field pulls the PKID. I then created a > count of the PKID to see how many I got (7,704,210). I decided to go > back in and create cover indexes on a group of the fields. These > fields are consecutive in the table and tend to be called out in > orders together, IOW Golf or running or skiing etc. In order to cover > the 18 fields I created two cover indexes grouping the first 9 and > then the second 9 (and the PKID in each index). The query actually > slowed down significantly, going from 2 minutes > 36 seconds when there was no larger cover indexes to 4 minutes 12 > seconds after building these larger cover indexes. > > Understand that I was not using every single field from these 18 > fields in the where clause, in fact only about 8 of them, but the 8 > fields just happen to be split across the two larger cover indexes so > that both would be used. > understand too that I still have the "single field" cover indexes for > all of the fields needed in my where clause. > > So it appears that the presence of a cover that included several of > the fields in the where clause caused SQL Server to use the larger 8 > field cover indexes rather than the individual "single field" cover > indexes, and in so doing slowed down the query by about 40% or so. > > Hmmmm. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fuller.artful at gmail.com Fri Jan 4 09:47:25 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 4 Jan 2008 10:47:25 -0500 Subject: [dba-SQLServer] Large cover index slows things down In-Reply-To: <000401c84ee3$cf2b18f0$657aa8c0@M90> References: <000301c84edd$1679a930$657aa8c0@M90> <29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com> <000401c84ee3$cf2b18f0$657aa8c0@M90> Message-ID: <29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com> That's beautiful (index-creation time). Be aware, however, that the maximum number of indexes on a single table is 249 (LOL). Since you have so much on your plate, and I so little, perhaps you might consider farming something my way. :) Oh, incidentally, I am looking for copies of the following software: Adobe PhotoShop Adobe Illustrator Adobe FrameMaker Adobe Acrobat (full -- last version I have is 6.0) Given so much on your plate, I doubt that you have time for such unrelated activities, but I thought I'd inquire anyway. A.0 On 1/4/08, jwcolby wrote: > > Arthur, > > I knew these existed but have never used them. Given everything on my > plate > and my current state of knowledge or lack thereof, I might just delete the > larger cover indexes back out. the use of the single field cover indexes > has worked wonders on my processing times already. The client tends to > ask > for the same select fields over and over. in this case I had to add 8 new > indexes but had three in place already. Luckily the creation of the cover > indexes only takes 2 minutes or so per. Over time I will end up with > every > field already indexed and the process of filling an order will get less > time > consuming. > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > From jwcolby at colbyconsulting.com Fri Jan 4 10:27:15 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 4 Jan 2008 11:27:15 -0500 Subject: [dba-SQLServer] Large cover index slows things down In-Reply-To: <29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com> References: <000301c84edd$1679a930$657aa8c0@M90><29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com><000401c84ee3$cf2b18f0$657aa8c0@M90> <29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com> Message-ID: <001201c84eee$ab0df220$657aa8c0@M90> 249? What a gype. As it turns out I will probably need less than 100 anyway. ATM I have 37 indexes. The odd part of this is that in some cases multi-field covers work well, probably because of the contents of the fields. For example they break the "age of adults" down into bands of 10 years, and inside of that there are multiple values, including values that mean male and female. I created a cover on seven "age of adult" fields (plus PK) and get count times around 15 seconds in a query that asks for three values in two different age bands. Of course each of those age bands also has a "single field" index (includes PKID) and I really don't know which indexes it used to process the query. That is something else I am going to have to go learn in my copious spare time. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Friday, January 04, 2008 10:47 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Large cover index slows things down That's beautiful (index-creation time). Be aware, however, that the maximum number of indexes on a single table is 249 (LOL). Since you have so much on your plate, and I so little, perhaps you might consider farming something my way. :) Oh, incidentally, I am looking for copies of the following software: Adobe PhotoShop Adobe Illustrator Adobe FrameMaker Adobe Acrobat (full -- last version I have is 6.0) Given so much on your plate, I doubt that you have time for such unrelated activities, but I thought I'd inquire anyway. A.0 On 1/4/08, jwcolby wrote: > > Arthur, > > I knew these existed but have never used them. Given everything on my > plate and my current state of knowledge or lack thereof, I might just > delete the larger cover indexes back out. the use of the single field > cover indexes has worked wonders on my processing times already. The > client tends to ask for the same select fields over and over. in this > case I had to add 8 new indexes but had three in place already. > Luckily the creation of the cover indexes only takes 2 minutes or so > per. Over time I will end up with every field already indexed and the > process of filling an order will get less time consuming. > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From JRojas at tnco-inc.com Fri Jan 4 11:00:39 2008 From: JRojas at tnco-inc.com (Joe Rojas) Date: Fri, 4 Jan 2008 12:00:39 -0500 Subject: [dba-SQLServer] SQL 7 - Trigger Question References: <000301c84edd$1679a930$657aa8c0@M90><29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com><000401c84ee3$cf2b18f0$657aa8c0@M90><29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com> <001201c84eee$ab0df220$657aa8c0@M90> Message-ID: <758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com> Hello, I created a trigger on a table that is designed to monitor the change in value for a few fields. An audit log trigger if you will. Whenever there is an update event on the table being monitored, the trigger compares the before and after value and if they are different, the trigger will insert a row into the audit trail table. The issue I'm having is if more than one field was changed, only the first field that is monitor has a record in the audit table. For example, I am monitoring an employee's vacation time and personal time balance. If there is an update that changes the value of both the vacation time and the personal time, only the vacation time update has a record in the audit trail table and the desired goal is to have a record for each field change. I suspect that the problem lies in my trigger, but I can seem to figure it out. I have included the trigger below and I hope someone can point out my issue. Thanks in advance!!! CREATE TRIGGER dbo.tr_AuditEmpData ON dbo.tblEmpData FOR UPDATE AS BEGIN SET NOCOUNT ON DECLARE @ADPFileNum int DECLARE @VTimeNew decimal(10,2) DECLARE @VTimeOld decimal(10,2) DECLARE @PTimeNew decimal(10,2) DECLARE @PTimeOld decimal(10,2) DECLARE @NewRate money DECLARE @OldRate money DECLARE @NewAccrual decimal(10,2) DECLARE @OldAccrual decimal(10,2) SELECT @ADPFileNum = ADPFileNum, @VTimeNew = VacationTime, @PTimeNew = PersonalTime, @NewRate = PayRate, @NewAccrual = AccrualAmount FROM inserted SELECT @VTimeOld = VacationTime, @PTimeOld = PersonalTime, @OldRate = PayRate, @OldAccrual = AccrualAmount FROM deleted --Check Vacation Time IF (@VTimeNew <> @VTimeOld) BEGIN INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, NewValue) VALUES (@ADPFileNum, 'VacationTime', @VTimeOld, @VTimeNew) END --Check Personal Time IF (@PTimeNew <> @PTimeOld) BEGIN INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, NewValue) VALUES (@ADPFileNum, 'PersonalTime', @PTimeOld, @PTimeNew) END --Check Pay Rate IF (@NewRate <> @OldRate) BEGIN INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, NewValue) VALUES (@ADPFileNum, 'PayRate', CONVERT(varchar(50), @OldRate), CONVERT(varchar(50), at NewRate)) END --Check Accrual Amount IF (@NewAccrual <> @OldAccrual) BEGIN INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, NewValue) VALUES (@ADPFileNum, 'AccrualAmount', CONVERT(varchar(50), @OldAccrual), CONVERT(varchar(50), at NewAccrual)) END SET NOCOUNT OFF END Joe Rojas Information Technology Manager Symmetry Medical TNCO 15 Colebrook Blvd Whitman MA 02382 781.447.6661 x7506 From ssharkins at gmail.com Fri Jan 4 12:23:55 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 4 Jan 2008 13:23:55 -0500 Subject: [dba-SQLServer] SQL 7 - Trigger Question References: <000301c84edd$1679a930$657aa8c0@M90><29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com><000401c84ee3$cf2b18f0$657aa8c0@M90><29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com><001201c84eee$ab0df220$657aa8c0@M90> <758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com> Message-ID: <007f01c84efe$f8fda010$4b3a8343@SusanOne> http://www.devx.com/dbzone/Article/7939/1954?pf=true Joe, I didn't review your code and this article might not help you a bit. Susan H. > Hello, > > I created a trigger on a table that is designed to monitor the change in > value for a few fields. An audit log trigger if you will. > Whenever there is an update event on the table being monitored, the > trigger compares the before and after value and if they are different, > the trigger will insert a row into the audit trail table. > > The issue I'm having is if more than one field was changed, only the > first field that is monitor has a record in the audit table. For > example, I am monitoring an employee's vacation time and personal time > balance. If there is an update that changes the value of both the > vacation time and the personal time, only the vacation time update has a > record in the audit trail table and the desired goal is to have a record > for each field change. > > I suspect that the problem lies in my trigger, but I can seem to figure > it out. > I have included the trigger below and I hope someone can point out my > issue. > > Thanks in advance!!! > > CREATE TRIGGER dbo.tr_AuditEmpData ON dbo.tblEmpData > FOR UPDATE > AS > > BEGIN > SET NOCOUNT ON > > DECLARE @ADPFileNum int > DECLARE @VTimeNew decimal(10,2) > DECLARE @VTimeOld decimal(10,2) > DECLARE @PTimeNew decimal(10,2) > DECLARE @PTimeOld decimal(10,2) > DECLARE @NewRate money > DECLARE @OldRate money > DECLARE @NewAccrual decimal(10,2) > DECLARE @OldAccrual decimal(10,2) > > SELECT @ADPFileNum = ADPFileNum, @VTimeNew = VacationTime, @PTimeNew = > PersonalTime, @NewRate = PayRate, @NewAccrual = AccrualAmount > FROM inserted > > SELECT @VTimeOld = VacationTime, @PTimeOld = PersonalTime, @OldRate = > PayRate, @OldAccrual = AccrualAmount > FROM deleted > > --Check Vacation Time > IF (@VTimeNew <> @VTimeOld) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, > OldValue, NewValue) > VALUES (@ADPFileNum, 'VacationTime', @VTimeOld, @VTimeNew) > END > > --Check Personal Time > IF (@PTimeNew <> @PTimeOld) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, > OldValue, NewValue) > VALUES (@ADPFileNum, 'PersonalTime', @PTimeOld, @PTimeNew) > END > > --Check Pay Rate > IF (@NewRate <> @OldRate) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, > OldValue, NewValue) > VALUES (@ADPFileNum, 'PayRate', CONVERT(varchar(50), @OldRate), > CONVERT(varchar(50), at NewRate)) > END > > --Check Accrual Amount > IF (@NewAccrual <> @OldAccrual) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, > OldValue, NewValue) > VALUES (@ADPFileNum, 'AccrualAmount', CONVERT(varchar(50), > @OldAccrual), CONVERT(varchar(50), at NewAccrual)) > END > > SET NOCOUNT OFF > END > > > Joe Rojas > Information Technology Manager > Symmetry Medical TNCO > 15 Colebrook Blvd > Whitman MA 02382 > 781.447.6661 x7506 > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Fri Jan 4 13:07:40 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 4 Jan 2008 14:07:40 -0500 Subject: [dba-SQLServer] SQL 7 - Trigger Question In-Reply-To: <007f01c84efe$f8fda010$4b3a8343@SusanOne> References: <000301c84edd$1679a930$657aa8c0@M90><29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com><000401c84ee3$cf2b18f0$657aa8c0@M90><29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com><001201c84eee$ab0df220$657aa8c0@M90><758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com> <007f01c84efe$f8fda010$4b3a8343@SusanOne> Message-ID: <002301c84f05$14268a40$657aa8c0@M90> LOL, real positive isn't she? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, January 04, 2008 1:24 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL 7 - Trigger Question http://www.devx.com/dbzone/Article/7939/1954?pf=true Joe, I didn't review your code and this article might not help you a bit. Susan H. > Hello, > > I created a trigger on a table that is designed to monitor the change > in value for a few fields. An audit log trigger if you will. > Whenever there is an update event on the table being monitored, the > trigger compares the before and after value and if they are different, > the trigger will insert a row into the audit trail table. > > The issue I'm having is if more than one field was changed, only the > first field that is monitor has a record in the audit table. For > example, I am monitoring an employee's vacation time and personal time > balance. If there is an update that changes the value of both the > vacation time and the personal time, only the vacation time update has > a record in the audit trail table and the desired goal is to have a > record for each field change. > > I suspect that the problem lies in my trigger, but I can seem to > figure it out. > I have included the trigger below and I hope someone can point out my > issue. > > Thanks in advance!!! > > CREATE TRIGGER dbo.tr_AuditEmpData ON dbo.tblEmpData FOR UPDATE AS > > BEGIN > SET NOCOUNT ON > > DECLARE @ADPFileNum int > DECLARE @VTimeNew decimal(10,2) > DECLARE @VTimeOld decimal(10,2) > DECLARE @PTimeNew decimal(10,2) > DECLARE @PTimeOld decimal(10,2) > DECLARE @NewRate money > DECLARE @OldRate money > DECLARE @NewAccrual decimal(10,2) > DECLARE @OldAccrual decimal(10,2) > > SELECT @ADPFileNum = ADPFileNum, @VTimeNew = VacationTime, @PTimeNew = > PersonalTime, @NewRate = PayRate, @NewAccrual = AccrualAmount FROM > inserted > > SELECT @VTimeOld = VacationTime, @PTimeOld = PersonalTime, @OldRate = > PayRate, @OldAccrual = AccrualAmount FROM deleted > > --Check Vacation Time > IF (@VTimeNew <> @VTimeOld) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > NewValue) VALUES (@ADPFileNum, 'VacationTime', @VTimeOld, @VTimeNew) > END > > --Check Personal Time > IF (@PTimeNew <> @PTimeOld) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > NewValue) VALUES (@ADPFileNum, 'PersonalTime', @PTimeOld, @PTimeNew) > END > > --Check Pay Rate > IF (@NewRate <> @OldRate) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > NewValue) VALUES (@ADPFileNum, 'PayRate', CONVERT(varchar(50), > @OldRate), > CONVERT(varchar(50), at NewRate)) > END > > --Check Accrual Amount > IF (@NewAccrual <> @OldAccrual) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > NewValue) VALUES (@ADPFileNum, 'AccrualAmount', CONVERT(varchar(50), > @OldAccrual), CONVERT(varchar(50), at NewAccrual)) END > > SET NOCOUNT OFF > END > > > Joe Rojas > Information Technology Manager > Symmetry Medical TNCO > 15 Colebrook Blvd > Whitman MA 02382 > 781.447.6661 x7506 > > _______________________________________________ > 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 ssharkins at gmail.com Fri Jan 4 13:26:00 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 4 Jan 2008 14:26:00 -0500 Subject: [dba-SQLServer] SQL 7 - Trigger Question References: <000301c84edd$1679a930$657aa8c0@M90><29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com><000401c84ee3$cf2b18f0$657aa8c0@M90><29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com><001201c84eee$ab0df220$657aa8c0@M90><758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com><007f01c84efe$f8fda010$4b3a8343@SusanOne> <002301c84f05$14268a40$657aa8c0@M90> Message-ID: <00c301c84f07$aa7f6460$4b3a8343@SusanOne> So far today, I've kept up with a 2 year old, fixed and cleaned up after two meals, mopped the kitchen, picked up mega bloks about 15 times, kept the big dog from killing the little dog, who happens to be in heat, gotten the dh off to work (not an easy task), cleaned a bathroom, moved toward the vacuum and then said, "screw it..." -- I don't have time for positive -- it's hit or miss in my house anymore. Right now, baby and all dogs are asleep, or you'd not get even this from me! ;) Susan H. > LOL, real positive isn't she? From fhtapia at gmail.com Fri Jan 4 13:29:47 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 4 Jan 2008 11:29:47 -0800 Subject: [dba-SQLServer] SQL 7 - Trigger Question In-Reply-To: <002301c84f05$14268a40$657aa8c0@M90> References: <000301c84edd$1679a930$657aa8c0@M90> <29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com> <000401c84ee3$cf2b18f0$657aa8c0@M90> <29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com> <001201c84eee$ab0df220$657aa8c0@M90> <758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com> <007f01c84efe$f8fda010$4b3a8343@SusanOne> <002301c84f05$14268a40$657aa8c0@M90> Message-ID: yes she is :), LOL I was thinking it's more to do about how you compare your data. You're only loading the values into your variables once, thus it only finds the first changed data as opposed to all the changed data. I suggest you consider working with the entire select statement instead of single values such as INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, NewValue) SELECT ADPFileNum, 'Field Name', OldValue, NewValue FROM INSERTED AS I INNER JOIN DELETED AS D ON I.PKID = D.PKID AND I.VacationTime<> D.VacationTime This will capture all similar records with different vacation time values. do this for each clause you need. -- Francisco On Jan 4, 2008 11:07 AM, jwcolby wrote: > LOL, real positive isn't she? > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan > Harkins > Sent: Friday, January 04, 2008 1:24 PM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] SQL 7 - Trigger Question > > http://www.devx.com/dbzone/Article/7939/1954?pf=true > > Joe, I didn't review your code and this article might not help you a bit. > > Susan H. > > > Hello, > > > > I created a trigger on a table that is designed to monitor the change > > in value for a few fields. An audit log trigger if you will. > > Whenever there is an update event on the table being monitored, the > > trigger compares the before and after value and if they are different, > > the trigger will insert a row into the audit trail table. > > > > The issue I'm having is if more than one field was changed, only the > > first field that is monitor has a record in the audit table. For > > example, I am monitoring an employee's vacation time and personal time > > balance. If there is an update that changes the value of both the > > vacation time and the personal time, only the vacation time update has > > a record in the audit trail table and the desired goal is to have a > > record for each field change. > > > > I suspect that the problem lies in my trigger, but I can seem to > > figure it out. > > I have included the trigger below and I hope someone can point out my > > issue. > > > > Thanks in advance!!! > > > > CREATE TRIGGER dbo.tr_AuditEmpData ON dbo.tblEmpData FOR UPDATE AS > > > > BEGIN > > SET NOCOUNT ON > > > > DECLARE @ADPFileNum int > > DECLARE @VTimeNew decimal(10,2) > > DECLARE @VTimeOld decimal(10,2) > > DECLARE @PTimeNew decimal(10,2) > > DECLARE @PTimeOld decimal(10,2) > > DECLARE @NewRate money > > DECLARE @OldRate money > > DECLARE @NewAccrual decimal(10,2) > > DECLARE @OldAccrual decimal(10,2) > > > > SELECT @ADPFileNum = ADPFileNum, @VTimeNew = VacationTime, @PTimeNew = > > PersonalTime, @NewRate = PayRate, @NewAccrual = AccrualAmount FROM > > inserted > > > > SELECT @VTimeOld = VacationTime, @PTimeOld = PersonalTime, @OldRate = > > PayRate, @OldAccrual = AccrualAmount FROM deleted > > > > --Check Vacation Time > > IF (@VTimeNew <> @VTimeOld) > > BEGIN > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > NewValue) VALUES (@ADPFileNum, 'VacationTime', @VTimeOld, @VTimeNew) > > END > > > > --Check Personal Time > > IF (@PTimeNew <> @PTimeOld) > > BEGIN > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > NewValue) VALUES (@ADPFileNum, 'PersonalTime', @PTimeOld, @PTimeNew) > > END > > > > --Check Pay Rate > > IF (@NewRate <> @OldRate) > > BEGIN > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > NewValue) VALUES (@ADPFileNum, 'PayRate', CONVERT(varchar(50), > > @OldRate), > > CONVERT(varchar(50), at NewRate)) > > END > > > > --Check Accrual Amount > > IF (@NewAccrual <> @OldAccrual) > > BEGIN > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > NewValue) VALUES (@ADPFileNum, 'AccrualAmount', CONVERT(varchar(50), > > @OldAccrual), CONVERT(varchar(50), at NewAccrual)) END > > > > SET NOCOUNT OFF > > END > > > > > > Joe Rojas > > Information Technology Manager > > Symmetry Medical TNCO > > 15 Colebrook Blvd > > Whitman MA 02382 > > 781.447.6661 x7506 > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From jwcolby at colbyconsulting.com Fri Jan 4 13:36:50 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 4 Jan 2008 14:36:50 -0500 Subject: [dba-SQLServer] SQL 7 - Trigger Question In-Reply-To: <00c301c84f07$aa7f6460$4b3a8343@SusanOne> References: <000301c84edd$1679a930$657aa8c0@M90><29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com><000401c84ee3$cf2b18f0$657aa8c0@M90><29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com><001201c84eee$ab0df220$657aa8c0@M90><758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com><007f01c84efe$f8fda010$4b3a8343@SusanOne><002301c84f05$14268a40$657aa8c0@M90> <00c301c84f07$aa7f6460$4b3a8343@SusanOne> Message-ID: <002e01c84f09$27532700$657aa8c0@M90> ROTFL. You don't get paid enough. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, January 04, 2008 2:26 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL 7 - Trigger Question So far today, I've kept up with a 2 year old, fixed and cleaned up after two meals, mopped the kitchen, picked up mega bloks about 15 times, kept the big dog from killing the little dog, who happens to be in heat, gotten the dh off to work (not an easy task), cleaned a bathroom, moved toward the vacuum and then said, "screw it..." -- I don't have time for positive -- it's hit or miss in my house anymore. Right now, baby and all dogs are asleep, or you'd not get even this from me! ;) Susan H. > LOL, real positive isn't she? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From JRojas at tnco-inc.com Fri Jan 4 13:43:30 2008 From: JRojas at tnco-inc.com (Joe Rojas) Date: Fri, 4 Jan 2008 14:43:30 -0500 Subject: [dba-SQLServer] SQL 7 - Trigger Question References: <000301c84edd$1679a930$657aa8c0@M90><29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com><000401c84ee3$cf2b18f0$657aa8c0@M90><29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com><001201c84eee$ab0df220$657aa8c0@M90><758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com><007f01c84efe$f8fda010$4b3a8343@SusanOne><002301c84f05$14268a40$657aa8c0@M90> Message-ID: <758E92433C4F3740B67BE4DD369AF5775C55EA@ex2k3.corp.tnco-inc.com> Hi Francisco, I will try this out but I have a follow up question. My application only updates/inserts one row at a time even if there are more than one updates or inserts required. I iterate though the rows that need to be updated/inserted and call the SP to perform the task each time. By doing so, shouldn't INSERTED and DELETED only contain one row for each call? Joe Rojas Information Technology Manager Symmetry Medical TNCO 15 Colebrook Blvd Whitman MA 02382 781.447.6661 x7506 -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Friday, January 04, 2008 2:30 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL 7 - Trigger Question yes she is :), LOL I was thinking it's more to do about how you compare your data. You're only loading the values into your variables once, thus it only finds the first changed data as opposed to all the changed data. I suggest you consider working with the entire select statement instead of single values such as INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, NewValue) SELECT ADPFileNum, 'Field Name', OldValue, NewValue FROM INSERTED AS I INNER JOIN DELETED AS D ON I.PKID = D.PKID AND I.VacationTime<> D.VacationTime This will capture all similar records with different vacation time values. do this for each clause you need. -- Francisco On Jan 4, 2008 11:07 AM, jwcolby wrote: > LOL, real positive isn't she? > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan > Harkins > Sent: Friday, January 04, 2008 1:24 PM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] SQL 7 - Trigger Question > > http://www.devx.com/dbzone/Article/7939/1954?pf=true > > Joe, I didn't review your code and this article might not help you a bit. > > Susan H. > > > Hello, > > > > I created a trigger on a table that is designed to monitor the change > > in value for a few fields. An audit log trigger if you will. > > Whenever there is an update event on the table being monitored, the > > trigger compares the before and after value and if they are different, > > the trigger will insert a row into the audit trail table. > > > > The issue I'm having is if more than one field was changed, only the > > first field that is monitor has a record in the audit table. For > > example, I am monitoring an employee's vacation time and personal time > > balance. If there is an update that changes the value of both the > > vacation time and the personal time, only the vacation time update has > > a record in the audit trail table and the desired goal is to have a > > record for each field change. > > > > I suspect that the problem lies in my trigger, but I can seem to > > figure it out. > > I have included the trigger below and I hope someone can point out my > > issue. > > > > Thanks in advance!!! > > > > CREATE TRIGGER dbo.tr_AuditEmpData ON dbo.tblEmpData FOR UPDATE AS > > > > BEGIN > > SET NOCOUNT ON > > > > DECLARE @ADPFileNum int > > DECLARE @VTimeNew decimal(10,2) > > DECLARE @VTimeOld decimal(10,2) > > DECLARE @PTimeNew decimal(10,2) > > DECLARE @PTimeOld decimal(10,2) > > DECLARE @NewRate money > > DECLARE @OldRate money > > DECLARE @NewAccrual decimal(10,2) > > DECLARE @OldAccrual decimal(10,2) > > > > SELECT @ADPFileNum = ADPFileNum, @VTimeNew = VacationTime, @PTimeNew = > > PersonalTime, @NewRate = PayRate, @NewAccrual = AccrualAmount FROM > > inserted > > > > SELECT @VTimeOld = VacationTime, @PTimeOld = PersonalTime, @OldRate = > > PayRate, @OldAccrual = AccrualAmount FROM deleted > > > > --Check Vacation Time > > IF (@VTimeNew <> @VTimeOld) > > BEGIN > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > NewValue) VALUES (@ADPFileNum, 'VacationTime', @VTimeOld, @VTimeNew) > > END > > > > --Check Personal Time > > IF (@PTimeNew <> @PTimeOld) > > BEGIN > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > NewValue) VALUES (@ADPFileNum, 'PersonalTime', @PTimeOld, @PTimeNew) > > END > > > > --Check Pay Rate > > IF (@NewRate <> @OldRate) > > BEGIN > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > NewValue) VALUES (@ADPFileNum, 'PayRate', CONVERT(varchar(50), > > @OldRate), > > CONVERT(varchar(50), at NewRate)) > > END > > > > --Check Accrual Amount > > IF (@NewAccrual <> @OldAccrual) > > BEGIN > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > NewValue) VALUES (@ADPFileNum, 'AccrualAmount', CONVERT(varchar(50), > > @OldAccrual), CONVERT(varchar(50), at NewAccrual)) END > > > > SET NOCOUNT OFF > > END > > > > > > Joe Rojas > > Information Technology Manager > > Symmetry Medical TNCO > > 15 Colebrook Blvd > > Whitman MA 02382 > > 781.447.6661 x7506 > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From JRojas at tnco-inc.com Fri Jan 4 13:44:47 2008 From: JRojas at tnco-inc.com (Joe Rojas) Date: Fri, 4 Jan 2008 14:44:47 -0500 Subject: [dba-SQLServer] SQL 7 - Trigger Question References: <000301c84edd$1679a930$657aa8c0@M90><29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com><000401c84ee3$cf2b18f0$657aa8c0@M90><29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com><001201c84eee$ab0df220$657aa8c0@M90><758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com> <007f01c84efe$f8fda010$4b3a8343@SusanOne> Message-ID: <758E92433C4F3740B67BE4DD369AF5775C55EB@ex2k3.corp.tnco-inc.com> Hi Susan, Thanks for the link! It was insightful but not directly applicable to my issue...as far as I can tell. :) Joe Rojas Information Technology Manager Symmetry Medical TNCO 15 Colebrook Blvd Whitman MA 02382 781.447.6661 x7506 -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, January 04, 2008 1:24 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL 7 - Trigger Question http://www.devx.com/dbzone/Article/7939/1954?pf=true Joe, I didn't review your code and this article might not help you a bit. Susan H. > Hello, > > I created a trigger on a table that is designed to monitor the change in > value for a few fields. An audit log trigger if you will. > Whenever there is an update event on the table being monitored, the > trigger compares the before and after value and if they are different, > the trigger will insert a row into the audit trail table. > > The issue I'm having is if more than one field was changed, only the > first field that is monitor has a record in the audit table. For > example, I am monitoring an employee's vacation time and personal time > balance. If there is an update that changes the value of both the > vacation time and the personal time, only the vacation time update has a > record in the audit trail table and the desired goal is to have a record > for each field change. > > I suspect that the problem lies in my trigger, but I can seem to figure > it out. > I have included the trigger below and I hope someone can point out my > issue. > > Thanks in advance!!! > > CREATE TRIGGER dbo.tr_AuditEmpData ON dbo.tblEmpData > FOR UPDATE > AS > > BEGIN > SET NOCOUNT ON > > DECLARE @ADPFileNum int > DECLARE @VTimeNew decimal(10,2) > DECLARE @VTimeOld decimal(10,2) > DECLARE @PTimeNew decimal(10,2) > DECLARE @PTimeOld decimal(10,2) > DECLARE @NewRate money > DECLARE @OldRate money > DECLARE @NewAccrual decimal(10,2) > DECLARE @OldAccrual decimal(10,2) > > SELECT @ADPFileNum = ADPFileNum, @VTimeNew = VacationTime, @PTimeNew = > PersonalTime, @NewRate = PayRate, @NewAccrual = AccrualAmount > FROM inserted > > SELECT @VTimeOld = VacationTime, @PTimeOld = PersonalTime, @OldRate = > PayRate, @OldAccrual = AccrualAmount > FROM deleted > > --Check Vacation Time > IF (@VTimeNew <> @VTimeOld) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, > OldValue, NewValue) > VALUES (@ADPFileNum, 'VacationTime', @VTimeOld, @VTimeNew) > END > > --Check Personal Time > IF (@PTimeNew <> @PTimeOld) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, > OldValue, NewValue) > VALUES (@ADPFileNum, 'PersonalTime', @PTimeOld, @PTimeNew) > END > > --Check Pay Rate > IF (@NewRate <> @OldRate) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, > OldValue, NewValue) > VALUES (@ADPFileNum, 'PayRate', CONVERT(varchar(50), @OldRate), > CONVERT(varchar(50), at NewRate)) > END > > --Check Accrual Amount > IF (@NewAccrual <> @OldAccrual) > BEGIN > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, > OldValue, NewValue) > VALUES (@ADPFileNum, 'AccrualAmount', CONVERT(varchar(50), > @OldAccrual), CONVERT(varchar(50), at NewAccrual)) > END > > SET NOCOUNT OFF > END > > > Joe Rojas > Information Technology Manager > Symmetry Medical TNCO > 15 Colebrook Blvd > Whitman MA 02382 > 781.447.6661 x7506 > > _______________________________________________ > 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 ssharkins at gmail.com Fri Jan 4 13:49:46 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 4 Jan 2008 14:49:46 -0500 Subject: [dba-SQLServer] SQL 7 - Trigger Question References: <000301c84edd$1679a930$657aa8c0@M90><29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com><000401c84ee3$cf2b18f0$657aa8c0@M90><29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com><001201c84eee$ab0df220$657aa8c0@M90><758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com><007f01c84efe$f8fda010$4b3a8343@SusanOne><002301c84f05$14268a40$657aa8c0@M90><00c301c84f07$aa7f6460$4b3a8343@SusanOne> <002e01c84f09$27532700$657aa8c0@M90> Message-ID: <00e601c84f0b$0f2b9c50$4b3a8343@SusanOne> You're telling me! ;) Wait! I don't get paid for THAT at all!!!!!!! Susan H. > ROTFL. You don't get paid enough. From fuller.artful at gmail.com Fri Jan 4 14:01:29 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 4 Jan 2008 15:01:29 -0500 Subject: [dba-SQLServer] SQL 7 - Trigger Question In-Reply-To: <758E92433C4F3740B67BE4DD369AF5775C55EB@ex2k3.corp.tnco-inc.com> References: <000301c84edd$1679a930$657aa8c0@M90> <29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com> <000401c84ee3$cf2b18f0$657aa8c0@M90> <29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com> <001201c84eee$ab0df220$657aa8c0@M90> <758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com> <007f01c84efe$f8fda010$4b3a8343@SusanOne> <758E92433C4F3740B67BE4DD369AF5775C55EB@ex2k3.corp.tnco-inc.com> Message-ID: <29f585dd0801041201m5d447b17n53e00b810a497610@mail.gmail.com> If you touch just one row at a time, you'll have one row in both inserted and deleted. That was the principle behind our article that Susan's URL led to: by comparing the two rows, you can tell exactly what changed and thus create an audit trail. Arthur On 1/4/08, Joe Rojas wrote: > > Hi Susan, > > Thanks for the link! > It was insightful but not directly applicable to my issue...as far as I > can tell. :) > > Joe Rojas > From fhtapia at gmail.com Fri Jan 4 15:04:19 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 4 Jan 2008 13:04:19 -0800 Subject: [dba-SQLServer] SQL 7 - Trigger Question In-Reply-To: <758E92433C4F3740B67BE4DD369AF5775C55EA@ex2k3.corp.tnco-inc.com> References: <000301c84edd$1679a930$657aa8c0@M90> <29f585dd0801040643i26bdea3ode49164a24237708@mail.gmail.com> <000401c84ee3$cf2b18f0$657aa8c0@M90> <29f585dd0801040747n1e966e1es8b00b3f42ff2e927@mail.gmail.com> <001201c84eee$ab0df220$657aa8c0@M90> <758E92433C4F3740B67BE4DD369AF5775C55E2@ex2k3.corp.tnco-inc.com> <007f01c84efe$f8fda010$4b3a8343@SusanOne> <002301c84f05$14268a40$657aa8c0@M90> <758E92433C4F3740B67BE4DD369AF5775C55EA@ex2k3.corp.tnco-inc.com> Message-ID: ah, i mis-read it then :). You'll want to encapsulate your variables with COALESC(@Variable, 'NewValue') that way all variables have data because you cannot compare a null with anything even another null. On Jan 4, 2008 11:43 AM, Joe Rojas wrote: > Hi Francisco, > > I will try this out but I have a follow up question. > > My application only updates/inserts one row at a time even if there are > more than one updates or inserts required. I iterate though the rows > that need to be updated/inserted and call the SP to perform the task > each time. By doing so, shouldn't INSERTED and DELETED only contain one > row for each call? > > Joe Rojas > Information Technology Manager > Symmetry Medical TNCO > 15 Colebrook Blvd > Whitman MA 02382 > 781.447.6661 x7506 > > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > Francisco Tapia > Sent: Friday, January 04, 2008 2:30 PM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] SQL 7 - Trigger Question > > yes she is :), LOL > > I was thinking it's more to do about how you compare your data. You're > only > loading the values into your variables once, thus it only finds the > first > changed data as opposed to all the changed data. > > I suggest you consider working with the entire select statement instead > of > single values such as > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > NewValue) > SELECT ADPFileNum, 'Field Name', OldValue, NewValue FROM INSERTED AS I > INNER JOIN DELETED AS D ON I.PKID = D.PKID AND I.VacationTime<> > D.VacationTime > > > This will capture all similar records with different vacation time > values. > do this for each clause you need. > > -- > Francisco > > > On Jan 4, 2008 11:07 AM, jwcolby wrote: > > > LOL, real positive isn't she? > > > > > > John W. Colby > > Colby Consulting > > www.ColbyConsulting.com > > -----Original Message----- > > From: dba-sqlserver-bounces at databaseadvisors.com > > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan > > Harkins > > Sent: Friday, January 04, 2008 1:24 PM > > To: dba-sqlserver at databaseadvisors.com > > Subject: Re: [dba-SQLServer] SQL 7 - Trigger Question > > > > http://www.devx.com/dbzone/Article/7939/1954?pf=true > > > > Joe, I didn't review your code and this article might not help you a > bit. > > > > Susan H. > > > > > Hello, > > > > > > I created a trigger on a table that is designed to monitor the > change > > > in value for a few fields. An audit log trigger if you will. > > > Whenever there is an update event on the table being monitored, the > > > trigger compares the before and after value and if they are > different, > > > the trigger will insert a row into the audit trail table. > > > > > > The issue I'm having is if more than one field was changed, only the > > > first field that is monitor has a record in the audit table. For > > > example, I am monitoring an employee's vacation time and personal > time > > > balance. If there is an update that changes the value of both the > > > vacation time and the personal time, only the vacation time update > has > > > a record in the audit trail table and the desired goal is to have a > > > record for each field change. > > > > > > I suspect that the problem lies in my trigger, but I can seem to > > > figure it out. > > > I have included the trigger below and I hope someone can point out > my > > > issue. > > > > > > Thanks in advance!!! > > > > > > CREATE TRIGGER dbo.tr_AuditEmpData ON dbo.tblEmpData FOR UPDATE AS > > > > > > BEGIN > > > SET NOCOUNT ON > > > > > > DECLARE @ADPFileNum int > > > DECLARE @VTimeNew decimal(10,2) > > > DECLARE @VTimeOld decimal(10,2) > > > DECLARE @PTimeNew decimal(10,2) > > > DECLARE @PTimeOld decimal(10,2) > > > DECLARE @NewRate money > > > DECLARE @OldRate money > > > DECLARE @NewAccrual decimal(10,2) > > > DECLARE @OldAccrual decimal(10,2) > > > > > > SELECT @ADPFileNum = ADPFileNum, @VTimeNew = VacationTime, @PTimeNew > = > > > PersonalTime, @NewRate = PayRate, @NewAccrual = AccrualAmount FROM > > > inserted > > > > > > SELECT @VTimeOld = VacationTime, @PTimeOld = PersonalTime, @OldRate > = > > > PayRate, @OldAccrual = AccrualAmount FROM deleted > > > > > > --Check Vacation Time > > > IF (@VTimeNew <> @VTimeOld) > > > BEGIN > > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > > NewValue) VALUES (@ADPFileNum, 'VacationTime', @VTimeOld, @VTimeNew) > > > END > > > > > > --Check Personal Time > > > IF (@PTimeNew <> @PTimeOld) > > > BEGIN > > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > > NewValue) VALUES (@ADPFileNum, 'PersonalTime', @PTimeOld, @PTimeNew) > > > END > > > > > > --Check Pay Rate > > > IF (@NewRate <> @OldRate) > > > BEGIN > > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > > NewValue) VALUES (@ADPFileNum, 'PayRate', CONVERT(varchar(50), > > > @OldRate), > > > CONVERT(varchar(50), at NewRate)) > > > END > > > > > > --Check Accrual Amount > > > IF (@NewAccrual <> @OldAccrual) > > > BEGIN > > > INSERT INTO dbo.tblAuditEmpData (ADPFileNum, FieldName, OldValue, > > > NewValue) VALUES (@ADPFileNum, 'AccrualAmount', CONVERT(varchar(50), > > > @OldAccrual), CONVERT(varchar(50), at NewAccrual)) END > > > > > > SET NOCOUNT OFF > > > END > > > > > > > > > Joe Rojas > > > Information Technology Manager > > > Symmetry Medical TNCO > > > 15 Colebrook Blvd > > > Whitman MA 02382 > > > 781.447.6661 x7506 > > > > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > -- > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From jwcolby at colbyconsulting.com Sat Jan 5 14:35:01 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 5 Jan 2008 15:35:01 -0500 Subject: [dba-SQLServer] X64 Message-ID: <001001c84fda$72906670$657aa8c0@M90> I built a new system last night and this morning, installing Windows Server 2003 X64 and SQL Server 2005 X64. The system currently has a dual proc AMD code but once I get the chance to wring it out I will probably move my quad core in there. The system currently has 4 gigs ram but I have a matching 4 gigs in another system which I will pull out of that system and drop in this one so that I can test X64 with 8 gigs RAM. It will be interesting to see what effect this will have on my large databases. I have some queries that take awhile to run (5+ minutes) that I can run "side by side" on the x32 and x64 systems. Interestingly these same queries dropped from 20-30 minutes down to 5-6 minutes by using "cover queries" that included the PKID and a single field together in a single index, rather than my old method of just using that single field in the index (not including the PKID). The x32 system will have the same processor (different / older motherboard though) running Windows 2003 x32 and SQL Server 2005 x32 with only 4 gigs or ram. I think I will run the same 5 minute query on both systems with 4 gigs, then move the additional 4 gigs into the x64 system and run again, then move the quad core into the x64 system and run again. This will provide a fairly "apples to apples" test of x32 vs. x64, 4 gigs vs. 8 gigs, and dual cores vs. quad cores. Unfortunately the system is low level formatting a 400 gig partition right now which is taking FOREVER! Once I have that 400 gig partition to use to hold the database I will run these tests. John W. Colby Colby Consulting www.ColbyConsulting.com From garykjos at gmail.com Sat Jan 5 15:56:30 2008 From: garykjos at gmail.com (Gary Kjos) Date: Sat, 5 Jan 2008 15:56:30 -0600 Subject: [dba-SQLServer] [dba-Tech] X64 In-Reply-To: <001001c84fda$72906670$657aa8c0@M90> References: <001001c84fda$72906670$657aa8c0@M90> Message-ID: Some guys have all the fun. I just worked to get my Christmas decorations taken down today and the top put up on the convertible which Ishould have done in Mid November when I last drive it but figured I had a couple more rides yet at that point. Then the cold snap hit. Today we have near 40 so I had my chance to get it put up and I took advantage of it. So I did have some accomplishments at least. Now football is on so that will shoot the rest of the day for me ;-) GK On Jan 5, 2008 2:35 PM, jwcolby wrote: > I built a new system last night and this morning, installing Windows Server > 2003 X64 and SQL Server 2005 X64. The system currently has a dual proc AMD > code but once I get the chance to wring it out I will probably move my quad > core in there. The system currently has 4 gigs ram but I have a matching 4 > gigs in another system which I will pull out of that system and drop in this > one so that I can test X64 with 8 gigs RAM. It will be interesting to see > what effect this will have on my large databases. I have some queries that > take awhile to run (5+ minutes) that I can run "side by side" on the x32 and > x64 systems. > > Interestingly these same queries dropped from 20-30 minutes down to 5-6 > minutes by using "cover queries" that included the PKID and a single field > together in a single index, rather than my old method of just using that > single field in the index (not including the PKID). > > The x32 system will have the same processor (different / older motherboard > though) running Windows 2003 x32 and SQL Server 2005 x32 with only 4 gigs or > ram. I think I will run the same 5 minute query on both systems with 4 > gigs, then move the additional 4 gigs into the x64 system and run again, > then move the quad core into the x64 system and run again. This will > provide a fairly "apples to apples" test of x32 vs. x64, 4 gigs vs. 8 gigs, > and dual cores vs. quad cores. > > Unfortunately the system is low level formatting a 400 gig partition right > now which is taking FOREVER! > > Once I have that 400 gig partition to use to hold the database I will run > these tests. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-Tech mailing list > dba-Tech at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-tech > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From jwcolby at colbyconsulting.com Sat Jan 5 20:13:14 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 5 Jan 2008 21:13:14 -0500 Subject: [dba-SQLServer] x64 tests Message-ID: <001c01c85009$b22731e0$657aa8c0@M90> OK, I have the x64 system up and running. I am doing tests on the same four databases. I have: HSID which contains data used in selection criteria, with a PK. 50 million records. AZHSID contains address validated records of name / address fields originally in HSID. With a PK matching the PKs in HSID. 50 million records ZipCodeWorld contains about 80K records of valid zip codes. It has information that allows me to exclude prisons, military FPOs etc. PSM11132 contains all of the queries required for me to fill an actual order of addresses (112000) going out to a client. The order asks for: Source File FIELD Select Codes Description Geography HSID/INF 074 2, 3, 6 OR Female 35 44 HSID/INF 073 2, 3, 6 Female 45-54 AND HSID/INF 091 7-9, A-T INC $50,000+ AND HSID/INF 282 Y Tennis HSID/INF 283 Y OR Golf HSID/INF 284 Y OR Snow Skiing HSID/INF 288 Y OR Bicycling HSID/INF 292 Y OR Running HSID/INF 294 Y OR Horseback Riding HSID/INF 298 Y OR Power Boating HSID/INF 299 Y Sailing AND Zip Code World 015 16980 CBSA Chicago Zip Code World 015 19820 OR CBSA Detroit Zip Code World 015 12580 OR CBSA Baltimore Zip Code World 015 31100 OR CBSA Los Angeles Zip Code World 015 35620 OR CBSA New York Zip Code World 015 37980 OR CBSA Philadelphia Zip Code World 015 47900 CBSA Washington DC As you can see basically they want women 35 to 54, income > 50K who participate in various hobbies, and live in selected big metropolitan areas. In order to prep the order I had to build cover indexes (field and PK) on the hobby fields. I already had cover indexes on the income and PK, and a single cover index on ALL of the age fields plus the PK. I then built FOUR different views. One for Age/Sex, one for income, and one for hobbies. Those three are ANDS so by pulling the PKs for each of those views I could do an inner join to get the AND. From these queries I actually only pulled the PK field itself to minimize data pulled out of the table. I did not need the select data itself, just the PKs for the joins. I then built a fourth view of Zip Code World (ZCW) using the CBSA code that selected ZIPS in specific metropolitan areas. From this view I pulled ONLY the zip field. I built a FIFTH master view that pulled in the four views above, PLUS the AZHSID table. AZHSID contains the PK to match the HSID select views, plus address validated name / address information. That information will be actually extracted and written into a flat file on disk, zipped and sent to the client. So I have age/sex, income, hobbies and AZHSID inner joined. The data pulled is just the PKID and name / address which includes Zip. I then inner join the zip from the ZCW view to limit the addresses to those in the right zip codes. Whew. OK, so the thing I am going to time is the COUNT of the PKs in this big query (how many people match all the criteria and live in the right zips). I am going to time the count on my original system that I actually used to run this order, and then on the new system. The original system (Stonehenge) is a AMD "3800" X2 with 4 gigs ram, Windows 2003 x32, SQL Server 2005 x32, with a dedicated raid controller card with an 8 drive raid 6 array. The new system (W2k3x64) is (currently) an AMD "3800" x2 with 4 gigs ram, Windows 2003 x64, SQL Server 2005 x64, with a pair of 650 gig IDE 100 hard disks. No raid. The databases reside on one of the 650 gig drives and the OS resides on the other. Stonehenge runs the count query in 5:32 (5 minutes, 32 seconds) and counts 630,025 valid addresses with the criteria above, in the zips specified. W2k3x64 runs the query in 9:26 (9 minutes and 32 seconds) and counts 630,025 records (just a check that we are counting the same thing). So the first thing that we see is that the new system is slower. The difference is likely caused by the fact that the Raid array in Stonehenge STREAMS data at 400 mbytes / sec whereas the single disk in W2k3x64 streams MUCH slower, probably around 50 mbytes / second. We do not KNOW that is the reason for the difference at this point, but it is a pretty good bet. I "sacrificed" the video controller from Azul to build the new system (yea, poor planning, forgot the damned video card) so I will probably move the raid array into the new system, or more likely move the new system (and boot disk) into the cabinet that Azul currently occupies. Moving a raid array with 8 disks is not something I want to do if I can avoid it. Next, I am going to pull the other 4 gigs (two 2 gig sticks) out of Azul and move it into W2k3x64. I have a video card on order, will be here next week but for now Azul is dead anyway so I might as well scrounge the memory as well. I did not take CPU and memory usage readings with just the 4 gigs, but with 8 in there both processors are pegging (100%) and the memory usage is maximum (only about 200 megs available) and it is using about 8 gigs of page file as well. W2k3x64 runs the same query in 9:11 after adding two additional sticks of memory and boosting the total to 8 gigs. Oddly, SQL Server has a little control for telling it how much it can have max, and it is maxed at ~2 gig bytes. I was under the impression that it would now allow SQL Server to natively use more ram. Sigh. there is an unchecked box for "Use AWE to allocate memory" which I just checked and am now rerunning the query a third time. With AWE memory enabled, the query ran in 8:27. A slight boost but certainly not stellar. So why is SQL Server not using more memory natively? What I really need to do is create a dual boot with Windows 2003 x32 and SQL Server 2003 x32, and then run the count query again for that. I suspect though that the Raid card and array would do more than anything to bump the speed back up. I am going to swap the quad core processor from Azul and see what that does for me. I think I will swap the view card and memory back in to Azul and try running the same database on Azul. It is virtually identical to Stonehenge. It has a quad core AMD, 4 gigs of memory and an 8 disk raid array on the same controller card that Stonehenge has. I could also TRY to do a dual boot to W2K3x64 but it currently boots off the raid which makes installing the new OS difficult (adds the issue of x64 raid drivers at install time). F6, floppy and all that. I hate that stuff. Well, more later. John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jan 8 09:17:15 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 8 Jan 2008 10:17:15 -0500 Subject: [dba-SQLServer] [AccessD] x64 tests In-Reply-To: <001c01c85009$b22731e0$657aa8c0@M90> References: <001c01c85009$b22731e0$657aa8c0@M90> Message-ID: <003701c85209$8d6c56d0$657aa8c0@M90> Azul actually died the other day. The computer shut down suddenly and when I opened it up the Heat Sink Fan was just hanging loose inside of the case. It turns out that two of the three plastic tabs on one side of the foundation that holds the HSF in place had broken off. This is the second time this has happened to me! To be honest though, I think this is my fault. The HSF I use is a rather large affair, heat pipes to a large radiator etc. It is very tough to see down under it and it is very tough to get the retaining bracket correctly hooked over the tabs when the motherboard is mounted in the case. I think I probably did not get the retaining bracket square so the tabs that broke off had a larger shear load. Sigh. Anyway, the motherboard is not usable. I might be able to get the plastic HSF foundation part, it just bolts onto the motherboard. We'll see. I wanted to use one of these motherboards to replace the aging board that runs my Address validation process. If I can't get the bracket, I will likely just buy the same little motherboard that I used for the Windows Home Server. In the meantime I decided to just go with it and put the new motherboard I bought last week into the case that Azul occupied. It has the first Areca Raid controller that I purchased and the eight 320 gig drives. I also decided to install the quad core processor onto the motherboard BEFORE putting the motherboard into the case so that I can inspect the mounting bracket, get is square and hopefully avoid the issues I had with Azul. When I brought up the quad core, the motherboard complained about the two different pairs of memory sticks so I had to pull one out to get it running. The sticks are different brands and timings. Both are DDR2 800 but one set was a CAS 5 and the other set CAS 6. People advise against using mismatched sticks like that but my experience has been that if you use "worst case", in this case set the motherboard to use CAS 6, then it works just fine. I will probably drop the other set back in later but to get it to boot and run I had to pull it out. So... W2k3x64 now lives in the case where Azul formerly resided. I got the Raid drivers installed so that W2k3x64 can see the raid array, and I am copying the databases that I was testing in the x64 tests below onto that raid array. I should soon have a benchmark with Windows 2003x64 and SQL Server 2005x64, using 4 gigs of RAM. The 8 gig benchmark will follow if the memory will place nice together in this motherboard and with this processor. Unfortunately this also means I will not be getting a Windows x64 / Sql Server 2005 X64 benchmark on a dual core. The processor socket on this new motherboard is turned 90 degrees from the old motherboard and is even more difficult to get the HSF seated properly with the board installed, and it is a ROYAL PITA to pull the motherboard so it just isn't worth the pain to me just for a benchmark. >>>>>>>>>>> So the answer is... 6:36 seconds to run the count query on the new system. >>>>>>>>>>> >W2k3x64 runs the query in 9:26 (9 minutes and 26 seconds) and counts 630,025 records (just a check that we are counting the same thing). This was the previous run for W2k3x64. As discussed in the previous email, the old W2Kx64 only had a pair of IDE 100 drives, and Windows and SQL Server were installed on one, while the DATA database files were installed on the other. In the new system Windows boots off of an IDE 100 drive, AND the SQL Server is installed there and the SQL Server system databases reside there. Basically I just moved the old Boot drive into the new chassis (where the raid array lives), and the boot drive already had Windows 2k3x64 and SQL Server 2005x64 installed on that C: drive. Because SQL Server installed on C: it put its system databases on that drive as well. The main databases now reside on the raid array as opposed to being on the second IDE drive in the old W2Kx64 system. So while I did pick up a 33% decrease in the time to do the count by moving the database from a single IDE drive onto the RAID array, it is still well below the 5:26 required by Stonehenge which is Windows 2K3x32 and SQL Server 2005x32. It does show however what a fast RAID array does for the system! And in the end I still don't know anything, such is the problem with doing benchmarks in the real world. Is it the fact that Windows is running off an IDE instead of the raid? Or the SQL Server system databases running on the IDE? Or is W2K3x64 and SQL Server 2005x64 just slower than the 32 bit brethren? Or is it something else entirely? You really HAVE to change one variable at a time and circumstances made that inconvenient to say the least. According to benchmarks the quad core I am using should be somewhat faster that the dual core I am using. It is quad core rather than dual core so if Windows and SQL Server can use the extra cores it SHOULD give the process a boost. It is pretty hard to sort out what the problem is though and a bit discouraging because of that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, January 05, 2008 9:13 PM To: 'Access Developers discussion and problem solving' Cc: 'Discussion of Hardware and Software issues'; dba-sqlserver at databaseadvisors.com Subject: [AccessD] x64 tests OK, I have the x64 system up and running. I am doing tests on the same four databases. I have: HSID which contains data used in selection criteria, with a PK. 50 million records. AZHSID contains address validated records of name / address fields originally in HSID. With a PK matching the PKs in HSID. 50 million records ZipCodeWorld contains about 80K records of valid zip codes. It has information that allows me to exclude prisons, military FPOs etc. PSM11132 contains all of the queries required for me to fill an actual order of addresses (112000) going out to a client. The order asks for: Source File FIELD Select Codes Description Geography HSID/INF 074 2, 3, 6 OR Female 35 44 HSID/INF 073 2, 3, 6 Female 45-54 AND HSID/INF 091 7-9, A-T INC $50,000+ AND HSID/INF 282 Y Tennis HSID/INF 283 Y OR Golf HSID/INF 284 Y OR Snow Skiing HSID/INF 288 Y OR Bicycling HSID/INF 292 Y OR Running HSID/INF 294 Y OR Horseback Riding HSID/INF 298 Y OR Power Boating HSID/INF 299 Y Sailing AND Zip Code World 015 16980 CBSA Chicago Zip Code World 015 19820 OR CBSA Detroit Zip Code World 015 12580 OR CBSA Baltimore Zip Code World 015 31100 OR CBSA Los Angeles Zip Code World 015 35620 OR CBSA New York Zip Code World 015 37980 OR CBSA Philadelphia Zip Code World 015 47900 CBSA Washington DC As you can see basically they want women 35 to 54, income > 50K who participate in various hobbies, and live in selected big metropolitan areas. In order to prep the order I had to build cover indexes (field and PK) on the hobby fields. I already had cover indexes on the income and PK, and a single cover index on ALL of the age fields plus the PK. I then built FOUR different views. One for Age/Sex, one for income, and one for hobbies. Those three are ANDS so by pulling the PKs for each of those views I could do an inner join to get the AND. From these queries I actually only pulled the PK field itself to minimize data pulled out of the table. I did not need the select data itself, just the PKs for the joins. I then built a fourth view of Zip Code World (ZCW) using the CBSA code that selected ZIPS in specific metropolitan areas. From this view I pulled ONLY the zip field. I built a FIFTH master view that pulled in the four views above, PLUS the AZHSID table. AZHSID contains the PK to match the HSID select views, plus address validated name / address information. That information will be actually extracted and written into a flat file on disk, zipped and sent to the client. So I have age/sex, income, hobbies and AZHSID inner joined. The data pulled is just the PKID and name / address which includes Zip. I then inner join the zip from the ZCW view to limit the addresses to those in the right zip codes. Whew. OK, so the thing I am going to time is the COUNT of the PKs in this big query (how many people match all the criteria and live in the right zips). I am going to time the count on my original system that I actually used to run this order, and then on the new system. The original system (Stonehenge) is a AMD "3800" X2 with 4 gigs ram, Windows 2003 x32, SQL Server 2005 x32, with a dedicated raid controller card with an 8 drive raid 6 array. The new system (W2k3x64) is (currently) an AMD "3800" x2 with 4 gigs ram, Windows 2003 x64, SQL Server 2005 x64, with a pair of 650 gig IDE 100 hard disks. No raid. The databases reside on one of the 650 gig drives and the OS resides on the other. Stonehenge runs the count query in 5:32 (5 minutes, 32 seconds) and counts 630,025 valid addresses with the criteria above, in the zips specified. W2k3x64 runs the query in 9:26 (9 minutes and 26 seconds) and counts 630,025 records (just a check that we are counting the same thing). So the first thing that we see is that the new system is slower. The difference is likely caused by the fact that the Raid array in Stonehenge STREAMS data at 400 mbytes / sec whereas the single disk in W2k3x64 streams MUCH slower, probably around 50 mbytes / second. We do not KNOW that is the reason for the difference at this point, but it is a pretty good bet. I "sacrificed" the video controller from Azul to build the new system (yea, poor planning, forgot the damned video card) so I will probably move the raid array into the new system, or more likely move the new system (and boot disk) into the cabinet that Azul currently occupies. Moving a raid array with 8 disks is not something I want to do if I can avoid it. Next, I am going to pull the other 4 gigs (two 2 gig sticks) out of Azul and move it into W2k3x64. I have a video card on order, will be here next week but for now Azul is dead anyway so I might as well scrounge the memory as well. I did not take CPU and memory usage readings with just the 4 gigs, but with 8 in there both processors are pegging (100%) and the memory usage is maximum (only about 200 megs available) and it is using about 8 gigs of page file as well. W2k3x64 runs the same query in 9:11 after adding two additional sticks of memory and boosting the total to 8 gigs. Oddly, SQL Server has a little control for telling it how much it can have max, and it is maxed at ~2 gig bytes. I was under the impression that it would now allow SQL Server to natively use more ram. Sigh. there is an unchecked box for "Use AWE to allocate memory" which I just checked and am now rerunning the query a third time. With AWE memory enabled, the query ran in 8:27. A slight boost but certainly not stellar. So why is SQL Server not using more memory natively? What I really need to do is create a dual boot with Windows 2003 x32 and SQL Server 2003 x32, and then run the count query again for that. I suspect though that the Raid card and array would do more than anything to bump the speed back up. I am going to swap the quad core processor from Azul and see what that does for me. I think I will swap the view card and memory back in to Azul and try running the same database on Azul. It is virtually identical to Stonehenge. It has a quad core AMD, 4 gigs of memory and an 8 disk raid array on the same controller card that Stonehenge has. I could also TRY to do a dual boot to W2K3x64 but it currently boots off the raid which makes installing the new OS difficult (adds the issue of x64 raid drivers at install time). F6, floppy and all that. I hate that stuff. Well, more later. John W. Colby Colby Consulting www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From garykjos at gmail.com Tue Jan 8 10:28:56 2008 From: garykjos at gmail.com (Gary Kjos) Date: Tue, 8 Jan 2008 10:28:56 -0600 Subject: [dba-SQLServer] [dba-Tech] [AccessD] x64 tests In-Reply-To: <003701c85209$8d6c56d0$657aa8c0@M90> References: <001c01c85009$b22731e0$657aa8c0@M90> <003701c85209$8d6c56d0$657aa8c0@M90> Message-ID: You are hard on your computers John ;-) GK On 1/8/08, jwcolby wrote: > Azul actually died the other day. -- Gary Kjos garykjos at gmail.com From fuller.artful at gmail.com Tue Jan 15 04:24:18 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 15 Jan 2008 05:24:18 -0500 Subject: [dba-SQLServer] Nuke All Traces of SQL Server Message-ID: <29f585dd0801150224h62e0b300m32b6512a708b6600@mail.gmail.com> A friend has a problem that I seem unable to solve. Using the install wizards, he has removed SQL 2000, MSDE, Express and SQL 2005, and then attempted to reinstall 2005. It doesn't work correctly. Something, perhaps in the registry, is going wrong. I want to tell him how to remove all evidence that any SQL-related product was ever installed on this box, so he can start afresh. It's simple enough to run the un-install and then nuke the directory, but there may be traces in the registry. Anyone know what they are and where to find them? A. From fhtapia at gmail.com Tue Jan 15 12:56:14 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 15 Jan 2008 10:56:14 -0800 Subject: [dba-SQLServer] Nuke All Traces of SQL Server In-Reply-To: <29f585dd0801150224h62e0b300m32b6512a708b6600@mail.gmail.com> References: <29f585dd0801150224h62e0b300m32b6512a708b6600@mail.gmail.com> Message-ID: have him followup the uninstall with something like ccleaner he can find it on www.filehippo.com ccleaner is a registry cleaner that will remove entries for files that are no longer on your system. On Jan 15, 2008 2:24 AM, Arthur Fuller wrote: > A friend has a problem that I seem unable to solve. Using the install > wizards, he has removed SQL 2000, MSDE, Express and SQL 2005, and then > attempted to reinstall 2005. It doesn't work correctly. Something, perhaps > in the registry, is going wrong. > > I want to tell him how to remove all evidence that any SQL-related product > was ever installed on this box, so he can start afresh. It's simple enough > to run the un-install and then nuke the directory, but there may be traces > in the registry. Anyone know what they are and where to find them? > > A. > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From fuller.artful at gmail.com Tue Jan 15 13:22:32 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 15 Jan 2008 14:22:32 -0500 Subject: [dba-SQLServer] Nuke All Traces of SQL Server In-Reply-To: References: <29f585dd0801150224h62e0b300m32b6512a708b6600@mail.gmail.com> Message-ID: <29f585dd0801151122s6c3e2a9cj8260b331ddf102ca@mail.gmail.com> Thanks. From robert at webedb.com Tue Jan 15 21:09:02 2008 From: robert at webedb.com (Robert L. Stewart) Date: Tue, 15 Jan 2008 21:09:02 -0600 Subject: [dba-SQLServer] Nuke All Traces of SQL Server In-Reply-To: References: Message-ID: <200801160312.m0G3Cd6K014863@databaseadvisors.com> When I installed the beta of SQL 2005, I had to reinstall the OS to do this. since then, I run it in a VM. At 12:00 PM 1/15/2008, you wrote: >Date: Tue, 15 Jan 2008 05:24:18 -0500 >From: "Arthur Fuller" >Subject: [dba-SQLServer] Nuke All Traces of SQL Server >To: dba-sqlserver at databaseadvisors.com >Message-ID: > <29f585dd0801150224h62e0b300m32b6512a708b6600 at mail.gmail.com> >Content-Type: text/plain; charset=ISO-8859-1 > >A friend has a problem that I seem unable to solve. Using the install >wizards, he has removed SQL 2000, MSDE, Express and SQL 2005, and then >attempted to reinstall 2005. It doesn't work correctly. Something, perhaps >in the registry, is going wrong. > >I want to tell him how to remove all evidence that any SQL-related product >was ever installed on this box, so he can start afresh. It's simple enough >to run the un-install and then nuke the directory, but there may be traces >in the registry. Anyone know what they are and where to find them? > >A. From ssharkins at gmail.com Wed Jan 16 12:22:04 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Wed, 16 Jan 2008 13:22:04 -0500 Subject: [dba-SQLServer] conversion mystery Message-ID: <004501c8586c$b7fe7cc0$4b3a8343@SusanOne> The following expression SickLeaveHours/8 returns whole numbers because SickLeaveHours is an int column -- at least, I believe that's the reason. I've tried the following: CAST(SickLeaveHours/8 As decimal(6,4)) As SickHoursUsed but it still returns a whole value, just with four decimal places, all sporting 0's. I've tried numeric, with the same results. I want this expression to return valid decimal values -- for instance, 69/8 = 8.625. I'm getting 8.0000 Also, I'd really like to discuss this percision, scale business -- I don't get it at all. I don't understand how the two interact -- for instance, in the above decimal(5,4) returns an error, but 6,4 doesn't. Susan H. From ssharkins at gmail.com Wed Jan 16 13:11:24 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Wed, 16 Jan 2008 14:11:24 -0500 Subject: [dba-SQLServer] nevermind (Fw: conversion mystery) Message-ID: <00bc01c85873$99ce0c00$4b3a8343@SusanOne> Nevermind, as soon as I sent the message, the light went on! Susan H. ----- Original Message ----- From: "Susan Harkins" To: "SQLList" Sent: Wednesday, January 16, 2008 1:22 PM Subject: conversion mystery > The following expression > > SickLeaveHours/8 > > returns whole numbers because SickLeaveHours is an int column -- at least, > I believe that's the reason. > > I've tried the following: > > CAST(SickLeaveHours/8 As decimal(6,4)) As SickHoursUsed > > but it still returns a whole value, just with four decimal places, all > sporting 0's. I've tried numeric, with the same results. I want this > expression to return valid decimal values -- for instance, 69/8 = 8.625. > I'm getting 8.0000 > > Also, I'd really like to discuss this percision, scale business -- I don't > get it at all. I don't understand how the two interact -- for instance, in > the above decimal(5,4) returns an error, but 6,4 doesn't. > > Susan H. From jwcolby at colbyconsulting.com Wed Jan 16 13:51:49 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 16 Jan 2008 14:51:49 -0500 Subject: [dba-SQLServer] nevermind (Fw: conversion mystery) In-Reply-To: <00bc01c85873$99ce0c00$4b3a8343@SusanOne> References: <00bc01c85873$99ce0c00$4b3a8343@SusanOne> Message-ID: <000601c85879$3c3ee0e0$657aa8c0@M90> LOL, the OhNoSecond! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Wednesday, January 16, 2008 2:11 PM To: SQLList Subject: [dba-SQLServer] nevermind (Fw: conversion mystery) Nevermind, as soon as I sent the message, the light went on! Susan H. ----- Original Message ----- From: "Susan Harkins" To: "SQLList" Sent: Wednesday, January 16, 2008 1:22 PM Subject: conversion mystery > The following expression > > SickLeaveHours/8 > > returns whole numbers because SickLeaveHours is an int column -- at least, > I believe that's the reason. > > I've tried the following: > > CAST(SickLeaveHours/8 As decimal(6,4)) As SickHoursUsed > > but it still returns a whole value, just with four decimal places, all > sporting 0's. I've tried numeric, with the same results. I want this > expression to return valid decimal values -- for instance, 69/8 = 8.625. > I'm getting 8.0000 > > Also, I'd really like to discuss this percision, scale business -- I don't > get it at all. I don't understand how the two interact -- for instance, in > the above decimal(5,4) returns an error, but 6,4 doesn't. > > Susan H. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Gustav at cactus.dk Fri Jan 18 08:40:43 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 18 Jan 2008 15:40:43 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi all I'm new to DTS and thought I had a job for this for a scheduled job for importing/exporting some data. Then this page: http://msdn2.microsoft.com/en-us/library/ms141026.aspx tells that: Integration Services replaces Data Transformation Services (DTS), which was first introduced as a component of SQL Server 7.0. Is that so? And even worse, this page: http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx indicates that SSIS is not available with the SQL Server Express edition. So our client will have to purchase a SQL Server Standard Edition? Or would there be another simple method to run a scheduled job? It's only about retrieving data from some Access tables and writing some others to another database without user intervention. /gustav From fuller.artful at gmail.com Fri Jan 18 09:21:16 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 18 Jan 2008 10:21:16 -0500 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: References: Message-ID: <29f585dd0801180721o604ec990t73c225af211bd373@mail.gmail.com> Gustav, You can still run DTS pkgs in SQL 2005 but yes, DTS has been deprecated. MS bought DTS from a third party way back when (1998) and rolled it into SQL 2000, but then rewrote it from the ground up for SQL 2005. There is still DTSRun in 2005 and also a migration wizard to get you from A to B, but DTS is, as they say, deprecated. (That's kind of like decapitated but more graceful.) For your immediate client's needs, you have a few alternatives. Stick with DTS and do the imports there; create ODBC links and do a classic Access-style import. For starters. More if required. hth, A. On 1/18/08, Gustav Brock wrote: > > Hi all > > I'm new to DTS and thought I had a job for this for a scheduled job for > importing/exporting some data. > Then this page: > > http://msdn2.microsoft.com/en-us/library/ms141026.aspx > > tells that: > > Integration Services replaces Data Transformation Services (DTS), which > was first introduced as a component of SQL Server 7.0. > > Is that so? > And even worse, this page: > > http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx > > indicates that SSIS is not available with the SQL Server Express edition. > So our client will have to purchase a SQL Server Standard Edition? > > Or would there be another simple method to run a scheduled job? It's only > about retrieving data from some Access tables and writing some others to > another database without user intervention. > > /gustav > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From Gustav at cactus.dk Fri Jan 18 09:38:05 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 18 Jan 2008 16:38:05 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi Arthur Thanks. I think I can stick with DTS as the tasks will be quite simple. But where do I go? I located this: Microsoft SQL Server 2000 DTS Designer Components The Microsoft SQL Server 2000 Data Transformation Services (DTS) package designer is a design tool used by developers and administrators of SQL Server 2005 servers to edit and maintain existing DTS packages until they can be upgraded or recreated in the SQL Server 2005 Integration Services package format. After installing this download, SQL Server 2005 users can continue to edit and maintain existing DTS packages from the Object Explorer in SQL Server 2005 Management Studio and from the Execute DTS 2000 Package Task Editor in Business Intelligence Development Studio, without needing to reinstall the SQL Server 2000 tools. The DTS package designer in this download was formerly accessed from the Data Transformation Services node in SQL Server 2000 Enterprise Manager. and downloaded and installed the file "SQLServer2005_DTS.msi". But now what? Close reading reveils "existing", so can't a new DTS package be created? I relaunched my "Microsoft SQL Server Management Studio Express" but the only item regarding DTS was found under Providers: DTSPackageDSO ... /gustav >>> fuller.artful at gmail.com 18-01-2008 16:21:16 >>> Gustav, You can still run DTS pkgs in SQL 2005 but yes, DTS has been deprecated. MS bought DTS from a third party way back when (1998) and rolled it into SQL 2000, but then rewrote it from the ground up for SQL 2005. There is still DTSRun in 2005 and also a migration wizard to get you from A to B, but DTS is, as they say, deprecated. (That's kind of like decapitated but more graceful.) For your immediate client's needs, you have a few alternatives. Stick with DTS and do the imports there; create ODBC links and do a classic Access-style import. For starters. More if required. hth, A. On 1/18/08, Gustav Brock wrote: > > Hi all > > I'm new to DTS and thought I had a job for this for a scheduled job for > importing/exporting some data. > Then this page: > > http://msdn2.microsoft.com/en-us/library/ms141026.aspx > > tells that: > > Integration Services replaces Data Transformation Services (DTS), which > was first introduced as a component of SQL Server 7.0. > > Is that so? > And even worse, this page: > > http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx > > indicates that SSIS is not available with the SQL Server Express edition. > So our client will have to purchase a SQL Server Standard Edition? > > Or would there be another simple method to run a scheduled job? It's only > about retrieving data from some Access tables and writing some others to > another database without user intervention. > > /gustav From JRojas at tnco-inc.com Fri Jan 18 09:47:29 2008 From: JRojas at tnco-inc.com (Joe Rojas) Date: Fri, 18 Jan 2008 10:47:29 -0500 Subject: [dba-SQLServer] SQL7 to SQL2005 References: Message-ID: <758E92433C4F3740B67BE4DD369AF5775C564E@ex2k3.corp.tnco-inc.com> Hi All, I was reading the SSIS thread and it got me wondering if there are any good books out there for learning what is different between 7 and 2005 and how to migrate from the two? Any recommendations? Joe Rojas Information Technology Manager Symmetry Medical TNCO 15 Colebrook Blvd Whitman MA 02382 781.447.6661 x7506 From fuller.artful at gmail.com Fri Jan 18 09:51:06 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 18 Jan 2008 10:51:06 -0500 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: References: Message-ID: <29f585dd0801180751s47dfead1rbef3e2a9ace38fe3@mail.gmail.com> I could be wrong and this is "off the top of my forehead", as it were, but I think that to go where you wish to go, you need a box with SQL 2000 and SQL 2005 installed. Then you can create the DTS pkgs in 2000 and run them in 2005 should you wish to do so. Another alternative, which I'm sure applies to Europe as well as North America, is to attend the roll-out for SQL 2008, VS 2008 and SharePoint 2008. Here in Toronto they are giving away copies of these three to all attendees. Mind you, these are developer copies, not production copies, so maybe that doesn't help your client. A larger question emerges, in this context. Why is your client moving to SQL 2005 (or 2008 for that matter)? If SQL 2000 does everything required, why move? I am a huge fan of the improvements in 2005, but if you don't need them, why migrate? SQL 2000 is perhaps the most rock-solid product Microsoft ever delivered, and if you cannot point to a concrete reason to move past it, stay where you are, in the comfort zone. hth, A. On 1/18/08, Gustav Brock wrote: > > Hi Arthur > > Thanks. I think I can stick with DTS as the tasks will be quite simple. > But where do I go? I located this: > > Microsoft SQL Server 2000 DTS Designer Components > > The Microsoft SQL Server 2000 Data Transformation Services (DTS) package > designer is a design tool used by developers and administrators of SQL > Server 2005 servers to edit and maintain existing DTS packages until they > can be upgraded or recreated in the SQL Server 2005 Integration Services > package format. After installing this download, SQL Server 2005 users can > continue to edit and maintain existing DTS packages from the Object Explorer > in SQL Server 2005 Management Studio and from the Execute DTS 2000 Package > Task Editor in Business Intelligence Development Studio, without needing to > reinstall the SQL Server 2000 tools. The DTS package designer in this > download was formerly accessed from the Data Transformation Services node in > SQL Server 2000 Enterprise Manager. > > and downloaded and installed the file "SQLServer2005_DTS.msi". > > But now what? Close reading reveils "existing", so can't a new DTS package > be created? > I relaunched my "Microsoft SQL Server Management Studio Express" but the > only item regarding DTS was found under Providers: DTSPackageDSO ... > > /gustav > > From Gustav at cactus.dk Fri Jan 18 10:18:40 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 18 Jan 2008 17:18:40 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi Arthur Well, we don't have a SQL Server 2000 here except for the MSDE engine which I believe came with poor management, if any. On the other hand, we do have the 2005 Standard from the Action Pack - just never installed it as we haven't had anything to use it for. I could do so, of course, including the SSIS, and - as I understand - then create a package. But could I move that package to the client's SQL Server 2005 Express installation without licensing issues? It should be added, that the cost of even a basic Standard license with 5 CALs is prohibitive and that the database will be some hundred MB only, thus the Express version fits well. Finally, the client doesn't have any SQL Server installed, so there is nothing to migrate. That said, the client would probably not have any use for the new fancy features of 2005, and the user count will be of less than five, thus the MSDE could be used if just looking at the database need only. But I've heard nothing bad of 2005 so that would be my first choice. The client doesn't care - wouldn't even know what I was talking about. /gustav >>> fuller.artful at gmail.com 18-01-2008 16:51:06 >>> I could be wrong and this is "off the top of my forehead", as it were, but I think that to go where you wish to go, you need a box with SQL 2000 and SQL 2005 installed. Then you can create the DTS pkgs in 2000 and run them in 2005 should you wish to do so. Another alternative, which I'm sure applies to Europe as well as North America, is to attend the roll-out for SQL 2008, VS 2008 and SharePoint 2008. Here in Toronto they are giving away copies of these three to all attendees. Mind you, these are developer copies, not production copies, so maybe that doesn't help your client. A larger question emerges, in this context. Why is your client moving to SQL 2005 (or 2008 for that matter)? If SQL 2000 does everything required, why move? I am a huge fan of the improvements in 2005, but if you don't need them, why migrate? SQL 2000 is perhaps the most rock-solid product Microsoft ever delivered, and if you cannot point to a concrete reason to move past it, stay where you are, in the comfort zone. hth, A. On 1/18/08, Gustav Brock wrote: > > Hi Arthur > > Thanks. I think I can stick with DTS as the tasks will be quite simple. > But where do I go? I located this: > > Microsoft SQL Server 2000 DTS Designer Components > > The Microsoft SQL Server 2000 Data Transformation Services (DTS) package > designer is a design tool used by developers and administrators of SQL > Server 2005 servers to edit and maintain existing DTS packages until they > can be upgraded or recreated in the SQL Server 2005 Integration Services > package format. After installing this download, SQL Server 2005 users can > continue to edit and maintain existing DTS packages from the Object Explorer > in SQL Server 2005 Management Studio and from the Execute DTS 2000 Package > Task Editor in Business Intelligence Development Studio, without needing to > reinstall the SQL Server 2000 tools. The DTS package designer in this > download was formerly accessed from the Data Transformation Services node in > SQL Server 2000 Enterprise Manager. > > and downloaded and installed the file "SQLServer2005_DTS.msi". > > But now what? Close reading reveils "existing", so can't a new DTS package > be created? > I relaunched my "Microsoft SQL Server Management Studio Express" but the > only item regarding DTS was found under Providers: DTSPackageDSO ... > > /gustav From fuller.artful at gmail.com Fri Jan 18 10:40:08 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 18 Jan 2008 11:40:08 -0500 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: References: Message-ID: <29f585dd0801180840k7b435de5pd0470dce18dc4267@mail.gmail.com> Gustav, Packages are YOUR creation not MS's. You can deploy your own creations as far and wide as you please. Just don't fill my kitchen with them! LOL. On 1/18/08, Gustav Brock wrote: > > Hi Arthur > > Well, we don't have a SQL Server 2000 here except for the MSDE engine > which I believe came with poor management, if any. > > On the other hand, we do have the 2005 Standard from the Action Pack - > just never installed it as we haven't had anything to use it for. > I could do so, of course, including the SSIS, and - as I understand - then > create a package. But could I move that package to the client's SQL Server > 2005 Express installation without licensing issues? It should be added, that > the cost of even a basic Standard license with 5 CALs is prohibitive and > that the database will be some hundred MB only, thus the Express version > fits well. > Finally, the client doesn't have any SQL Server installed, so there is > nothing to migrate. That said, the client would probably not have any use > for the new fancy features of 2005, and the user count will be of less than > five, thus the MSDE could be used if just looking at the database need only. > But I've heard nothing bad of 2005 so that would be my first choice. The > client doesn't care - wouldn't even know what I was talking about. > > /gustav > > >>> fuller.artful at gmail.com 18-01-2008 16:51:06 >>> > I could be wrong and this is "off the top of my forehead", as it were, but > I > think that to go where you wish to go, you need a box with SQL 2000 and > SQL > 2005 installed. Then you can create the DTS pkgs in 2000 and run them in > 2005 should you wish to do so. > > Another alternative, which I'm sure applies to Europe as well as North > America, is to attend the roll-out for SQL 2008, VS 2008 and SharePoint > 2008. Here in Toronto they are giving away copies of these three to all > attendees. Mind you, these are developer copies, not production copies, so > maybe that doesn't help your client. > > A larger question emerges, in this context. Why is your client moving to > SQL > 2005 (or 2008 for that matter)? If SQL 2000 does everything required, why > move? I am a huge fan of the improvements in 2005, but if you don't need > them, why migrate? SQL 2000 is perhaps the most rock-solid product > Microsoft > ever delivered, and if you cannot point to a concrete reason to move past > it, stay where you are, in the comfort zone. > > hth, > A. > > On 1/18/08, Gustav Brock wrote: > > > > Hi Arthur > > > > Thanks. I think I can stick with DTS as the tasks will be quite simple. > > But where do I go? I located this: > > > > Microsoft SQL Server 2000 DTS Designer Components > > > > The Microsoft SQL Server 2000 Data Transformation Services (DTS) package > > designer is a design tool used by developers and administrators of SQL > > Server 2005 servers to edit and maintain existing DTS packages until > they > > can be upgraded or recreated in the SQL Server 2005 Integration Services > > package format. After installing this download, SQL Server 2005 users > can > > continue to edit and maintain existing DTS packages from the Object > Explorer > > in SQL Server 2005 Management Studio and from the Execute DTS 2000 > Package > > Task Editor in Business Intelligence Development Studio, without needing > to > > reinstall the SQL Server 2000 tools. The DTS package designer in this > > download was formerly accessed from the Data Transformation Services > node in > > SQL Server 2000 Enterprise Manager. > > > > and downloaded and installed the file "SQLServer2005_DTS.msi". > > > > But now what? Close reading reveils "existing", so can't a new DTS > package > > be created? > > I relaunched my "Microsoft SQL Server Management Studio Express" but the > > only item regarding DTS was found under Providers: DTSPackageDSO ... > > > > /gustav > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From markamatte at hotmail.com Fri Jan 18 10:55:42 2008 From: markamatte at hotmail.com (Mark A Matte) Date: Fri, 18 Jan 2008 16:55:42 +0000 Subject: [dba-SQLServer] SQL7 to SQL2005... In-Reply-To: <758E92433C4F3740B67BE4DD369AF5775C564E@ex2k3.corp.tnco-inc.com> References: <758E92433C4F3740B67BE4DD369AF5775C564E@ex2k3.corp.tnco-inc.com> Message-ID: Hello All, I currently use SQL Server 7. I installed MS Visual Web Developer Express...and it added a folder MS SQL Server 2005. In the Folder under "Configuration Tools" it has SQL Server Configuration Manager...which I have no idea what it is. There doesn't seem to be a place to manage tables/SPs. Is the folder misleading or does this mean SQL Server 2005 has been installed? SQL7 and Enterprise Manager still seem to be working properly. Any thoughts? Thanks, Mark A. Matte > Date: Fri, 18 Jan 2008 10:47:29 -0500 > From: JRojas at tnco-inc.com > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer] SQL7 to SQL2005 > > Hi All, > > I was reading the SSIS thread and it got me wondering if there are any > good books out there for learning what is different between 7 and 2005 > and how to migrate from the two? > Any recommendations? > > Joe Rojas > Information Technology Manager > Symmetry Medical TNCO > 15 Colebrook Blvd > Whitman MA 02382 > 781.447.6661 x7506 > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > _________________________________________________________________ Need to know the score, the latest news, or you need your Hotmail?-get your "fix". http://www.msnmobilefix.com/Default.aspx From robert at webedb.com Fri Jan 18 11:09:28 2008 From: robert at webedb.com (Robert L. Stewart) Date: Fri, 18 Jan 2008 11:09:28 -0600 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: References: Message-ID: <200801181714.m0IHEnP9007970@databaseadvisors.com> Maybe because they stop supporting it in April of this year. Sounds like a good reason to me. Another alternative no one has talked about is to get the developer version and install it on a machine there. It will have SSIS on it if you do the install of that portion of SQL Server. At 10:55 AM 1/18/2008, you wrote: >Date: Fri, 18 Jan 2008 10:51:06 -0500 >From: "Arthur Fuller" >Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, > DTS >To: "Discussion concerning MS SQL Server" > >Message-ID: > <29f585dd0801180751s47dfead1rbef3e2a9ace38fe3 at mail.gmail.com> >Content-Type: text/plain; charset=ISO-8859-1 > > >A larger question emerges, in this context. Why is your client moving to SQL >2005 (or 2008 for that matter)? If SQL 2000 does everything required, why >move? I am a huge fan of the improvements in 2005, but if you don't need >them, why migrate? SQL 2000 is perhaps the most rock-solid product Microsoft >ever delivered, and if you cannot point to a concrete reason to move past >it, stay where you are, in the comfort zone. > >hth, >A. From Gustav at cactus.dk Fri Jan 18 12:14:10 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 18 Jan 2008 19:14:10 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi Arthur and Robert Just realised what the SQL Server Configuration Manager is for ... It showed that I have two SQL 2005 Servers installed locally, SQLEXPRESS and MSSQLSERVER. Of these, the first is the Express edition I guess (from a previous install of Visual Studio 2005 Express) and the second must be the developer version installed with VS2005 Standard. The second wasn't running. I started it and somewhere I noticed a tip to create a DTS package: Run DTSWizard from Start Menu, Run. That wizard connected happily to a server and offered to save and run the created SSIS package ... OK, and yes it did. Success! Now I need to find out how to get to that saved package ... /gustav >>> fuller.artful at gmail.com 18-01-2008 17:40:08 >>> Gustav, Packages are YOUR creation not MS's. You can deploy your own creations as far and wide as you please. Just don't fill my kitchen with them! LOL. On 1/18/08, Gustav Brock wrote: > > Hi Arthur > > Well, we don't have a SQL Server 2000 here except for the MSDE engine > which I believe came with poor management, if any. > > On the other hand, we do have the 2005 Standard from the Action Pack - > just never installed it as we haven't had anything to use it for. > I could do so, of course, including the SSIS, and - as I understand - then > create a package. But could I move that package to the client's SQL Server > 2005 Express installation without licensing issues? It should be added, that > the cost of even a basic Standard license with 5 CALs is prohibitive and > that the database will be some hundred MB only, thus the Express version > fits well. > Finally, the client doesn't have any SQL Server installed, so there is > nothing to migrate. That said, the client would probably not have any use > for the new fancy features of 2005, and the user count will be of less than > five, thus the MSDE could be used if just looking at the database need only. > But I've heard nothing bad of 2005 so that would be my first choice. The > client doesn't care - wouldn't even know what I was talking about. > > /gustav > > >>> fuller.artful at gmail.com 18-01-2008 16:51:06 >>> > I could be wrong and this is "off the top of my forehead", as it were, but > I > think that to go where you wish to go, you need a box with SQL 2000 and > SQL > 2005 installed. Then you can create the DTS pkgs in 2000 and run them in > 2005 should you wish to do so. > > Another alternative, which I'm sure applies to Europe as well as North > America, is to attend the roll-out for SQL 2008, VS 2008 and SharePoint > 2008. Here in Toronto they are giving away copies of these three to all > attendees. Mind you, these are developer copies, not production copies, so > maybe that doesn't help your client. > > A larger question emerges, in this context. Why is your client moving to > SQL > 2005 (or 2008 for that matter)? If SQL 2000 does everything required, why > move? I am a huge fan of the improvements in 2005, but if you don't need > them, why migrate? SQL 2000 is perhaps the most rock-solid product > Microsoft > ever delivered, and if you cannot point to a concrete reason to move past > it, stay where you are, in the comfort zone. > > hth, > A. > > On 1/18/08, Gustav Brock wrote: > > > > Hi Arthur > > > > Thanks. I think I can stick with DTS as the tasks will be quite simple. > > But where do I go? I located this: > > > > Microsoft SQL Server 2000 DTS Designer Components > > > > The Microsoft SQL Server 2000 Data Transformation Services (DTS) package > > designer is a design tool used by developers and administrators of SQL > > Server 2005 servers to edit and maintain existing DTS packages until they > > can be upgraded or recreated in the SQL Server 2005 Integration Services > > package format. After installing this download, SQL Server 2005 users can > > continue to edit and maintain existing DTS packages from the Object Explorer > > in SQL Server 2005 Management Studio and from the Execute DTS 2000 Package > > Task Editor in Business Intelligence Development Studio, without needing to > > reinstall the SQL Server 2000 tools. The DTS package designer in this > > download was formerly accessed from the Data Transformation Services node in > > SQL Server 2000 Enterprise Manager. > > > > and downloaded and installed the file "SQLServer2005_DTS.msi". > > > > But now what? Close reading reveils "existing", so can't a new DTS package > > be created? > > I relaunched my "Microsoft SQL Server Management Studio Express" but the > > only item regarding DTS was found under Providers: DTSPackageDSO ... > > > > /gustav From fuller.artful at gmail.com Fri Jan 18 12:21:24 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 18 Jan 2008 13:21:24 -0500 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: References: Message-ID: <29f585dd0801181021w2bd1b16am2bddd56ede105f4b@mail.gmail.com> There is a very subtle little checkbox in the installer, and it defaults to True, which means that you want to install the Express Edition. Why MS decided to default it to True, I don't know, but it causes myriad downstream problems. You have been bitten by said "feature". As to the saved pkg, that depends upon where you decided to save it (file system or inside the DB). A. On 1/18/08, Gustav Brock wrote: > > Hi Arthur and Robert > > Just realised what the SQL Server Configuration Manager is for ... > It showed that I have two SQL 2005 Servers installed locally, SQLEXPRESS > and MSSQLSERVER. Of these, the first is the Express edition I guess (from a > previous install of Visual Studio 2005 Express) and the second must be the > developer version installed with VS2005 Standard. > > The second wasn't running. I started it and somewhere I noticed a tip to > create a DTS package: Run DTSWizard from Start Menu, Run. > That wizard connected happily to a server and offered to save and run the > created SSIS package ... OK, and yes it did. Success! > > Now I need to find out how to get to that saved package ... > > /gustav > From Gustav at cactus.dk Fri Jan 18 13:19:41 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 18 Jan 2008 20:19:41 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi Arthur OK, I'll have a closer look. Perhaps I should just clean it up and install the SQL Server 2005 Standard. /gustav >>> fuller.artful at gmail.com 18-01-2008 19:21:24 >>> There is a very subtle little checkbox in the installer, and it defaults to True, which means that you want to install the Express Edition. Why MS decided to default it to True, I don't know, but it causes myriad downstream problems. You have been bitten by said "feature". As to the saved pkg, that depends upon where you decided to save it (file system or inside the DB). A. On 1/18/08, Gustav Brock wrote: > > Hi Arthur and Robert > > Just realised what the SQL Server Configuration Manager is for ... > It showed that I have two SQL 2005 Servers installed locally, SQLEXPRESS > and MSSQLSERVER. Of these, the first is the Express edition I guess (from a > previous install of Visual Studio 2005 Express) and the second must be the > developer version installed with VS2005 Standard. > > The second wasn't running. I started it and somewhere I noticed a tip to > create a DTS package: Run DTSWizard from Start Menu, Run. > That wizard connected happily to a server and offered to save and run the > created SSIS package ... OK, and yes it did. Success! > > Now I need to find out how to get to that saved package ... > > /gustav From markamatte at hotmail.com Fri Jan 18 14:17:25 2008 From: markamatte at hotmail.com (Mark A Matte) Date: Fri, 18 Jan 2008 20:17:25 +0000 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: References: Message-ID: Gustav, In reading your last post mentioning "SQL Server Configuration Manager"...below is my other post concerning this. I'm at a point where I'm not sure what I have installed? ************I currently use SQL Server 7. I installed MS Visual Web Developer Express...and it added a folder MS SQL Server 2005. In the Folder under "Configuration Tools" it has SQL Server Configuration Manager...which I have no idea what it is. There doesn't seem to be a place to manage tables/SPs. Is the folder misleading or does this mean SQL Server 2005 has been installed? SQL7 and Enterprise Manager still seem to be working properly. Any thoughts? Thanks, Mark A. Matte > Date: Fri, 18 Jan 2008 19:14:10 +0100 > From: Gustav at cactus.dk > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS > > Hi Arthur and Robert > > Just realised what the SQL Server Configuration Manager is for ... > It showed that I have two SQL 2005 Servers installed locally, SQLEXPRESS and MSSQLSERVER. Of these, the first is the Express edition I guess (from a previous install of Visual Studio 2005 Express) and the second must be the developer version installed with VS2005 Standard. > > The second wasn't running. I started it and somewhere I noticed a tip to create a DTS package: Run DTSWizard from Start Menu, Run. > That wizard connected happily to a server and offered to save and run the created SSIS package ... OK, and yes it did. Success! > > Now I need to find out how to get to that saved package ... > > /gustav > >>>> fuller.artful at gmail.com 18-01-2008 17:40:08>>> > Gustav, > > Packages are YOUR creation not MS's. You can deploy your own creations as > far and wide as you please. Just don't fill my kitchen with them! LOL. > > On 1/18/08, Gustav Brock wrote: >> >> Hi Arthur >> >> Well, we don't have a SQL Server 2000 here except for the MSDE engine >> which I believe came with poor management, if any. >> >> On the other hand, we do have the 2005 Standard from the Action Pack - >> just never installed it as we haven't had anything to use it for. >> I could do so, of course, including the SSIS, and - as I understand - then >> create a package. But could I move that package to the client's SQL Server >> 2005 Express installation without licensing issues? It should be added, that >> the cost of even a basic Standard license with 5 CALs is prohibitive and >> that the database will be some hundred MB only, thus the Express version >> fits well. >> Finally, the client doesn't have any SQL Server installed, so there is >> nothing to migrate. That said, the client would probably not have any use >> for the new fancy features of 2005, and the user count will be of less than >> five, thus the MSDE could be used if just looking at the database need only. >> But I've heard nothing bad of 2005 so that would be my first choice. The >> client doesn't care - wouldn't even know what I was talking about. >> >> /gustav >> >>>>> fuller.artful at gmail.com 18-01-2008 16:51:06>>> >> I could be wrong and this is "off the top of my forehead", as it were, but >> I >> think that to go where you wish to go, you need a box with SQL 2000 and >> SQL >> 2005 installed. Then you can create the DTS pkgs in 2000 and run them in >> 2005 should you wish to do so. >> >> Another alternative, which I'm sure applies to Europe as well as North >> America, is to attend the roll-out for SQL 2008, VS 2008 and SharePoint >> 2008. Here in Toronto they are giving away copies of these three to all >> attendees. Mind you, these are developer copies, not production copies, so >> maybe that doesn't help your client. >> >> A larger question emerges, in this context. Why is your client moving to >> SQL >> 2005 (or 2008 for that matter)? If SQL 2000 does everything required, why >> move? I am a huge fan of the improvements in 2005, but if you don't need >> them, why migrate? SQL 2000 is perhaps the most rock-solid product >> Microsoft >> ever delivered, and if you cannot point to a concrete reason to move past >> it, stay where you are, in the comfort zone. >> >> hth, >> A. >> >> On 1/18/08, Gustav Brock wrote: >>> >>> Hi Arthur >>> >>> Thanks. I think I can stick with DTS as the tasks will be quite simple. >>> But where do I go? I located this: >>> >>> Microsoft SQL Server 2000 DTS Designer Components >>> >>> The Microsoft SQL Server 2000 Data Transformation Services (DTS) package >>> designer is a design tool used by developers and administrators of SQL >>> Server 2005 servers to edit and maintain existing DTS packages until they >>> can be upgraded or recreated in the SQL Server 2005 Integration Services >>> package format. After installing this download, SQL Server 2005 users can >>> continue to edit and maintain existing DTS packages from the Object Explorer >>> in SQL Server 2005 Management Studio and from the Execute DTS 2000 Package >>> Task Editor in Business Intelligence Development Studio, without needing to >>> reinstall the SQL Server 2000 tools. The DTS package designer in this >>> download was formerly accessed from the Data Transformation Services node in >>> SQL Server 2000 Enterprise Manager. >>> >>> and downloaded and installed the file "SQLServer2005_DTS.msi". >>> >>> But now what? Close reading reveils "existing", so can't a new DTS package >>> be created? >>> I relaunched my "Microsoft SQL Server Management Studio Express" but the >>> only item regarding DTS was found under Providers: DTSPackageDSO ... >>> >>> /gustav > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > _________________________________________________________________ Climb to the top of the charts!? Play the word scramble challenge with star power. http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan From ssharkins at gmail.com Sun Jan 20 13:06:50 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 20 Jan 2008 14:06:50 -0500 Subject: [dba-SQLServer] SQL Server LIKE and non-string data types Message-ID: <001c01c85b97$9e002ca0$4b3a8343@SusanOne> I expected the following statement to fail USE AdventureWorks SELECT ProductID, Weight FROM Production.Product WHERE Weight LIKE '4%' But it works. The documentation implies that LIKE won't work with non-string data types and that you must use CAST to convert them first -- but this works as expected without CAST. Weight is a decimal data type. I'm using SQL Server Express (2005) so I'm wondering if this is a version thing -- maybe 2005 forces an implicit conversion? Susan Harkins From stuart at lexacorp.com.pg Sun Jan 20 22:47:26 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 21 Jan 2008 14:47:26 +1000 Subject: [dba-SQLServer] SQL Server LIKE and non-string data types In-Reply-To: <001c01c85b97$9e002ca0$4b3a8343@SusanOne> References: <001c01c85b97$9e002ca0$4b3a8343@SusanOne> Message-ID: <4794B07E.21175.4C822E@stuart.lexacorp.com.pg> What documentation are you referring to? >From SQL Server 2000 BOL: LIKE ....... "If any of the arguments are not of character string data type, Microsoft? SQL ServerTM converts them to character string data type, if possible." (Don't have v7 documentation available here, but I'm pretty sure it was the same back then.) Cheers, Stuart On 20 Jan 2008 at 14:06, Susan Harkins wrote: > I expected the following statement to fail > > USE AdventureWorks > SELECT ProductID, Weight > FROM Production.Product > WHERE Weight LIKE '4%' > > But it works. The documentation implies that LIKE won't work with non-string > data types and that you must use CAST to convert them first -- but this > works as expected without CAST. Weight is a decimal data type. I'm using SQL > Server Express (2005) so I'm wondering if this is a version thing -- maybe > 2005 forces an implicit conversion? > > Susan Harkins > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From Gustav at cactus.dk Mon Jan 21 01:50:23 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 21 Jan 2008 08:50:23 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi Mark I'm no expert in SQL Server and I have no running installations of version 7 (except the MSDE which came without administration tools). To me it looks like you do have SQL Server 2005 Express installed from the MS Visual Web Developer Express. The "SQL Server Configuration Manager" should be located under "Configuration Tools" under your Start menu entry "Microsoft SQL Server 2005". /gustav >>> markamatte at hotmail.com 18-01-2008 21:17:25 >>> Gustav, In reading your last post mentioning "SQL Server Configuration Manager"...below is my other post concerning this. I'm at a point where I'm not sure what I have installed? ************I currently use SQL Server 7. I installed MS Visual Web Developer Express...and it added a folder MS SQL Server 2005. In the Folder under "Configuration Tools" it has SQL Server Configuration Manager...which I have no idea what it is. There doesn't seem to be a place to manage tables/SPs. Is the folder misleading or does this mean SQL Server 2005 has been installed? SQL7 and Enterprise Manager still seem to be working properly. Any thoughts? Thanks, Mark A. Matte > Date: Fri, 18 Jan 2008 19:14:10 +0100 > From: Gustav at cactus.dk > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS > > Hi Arthur and Robert > > Just realised what the SQL Server Configuration Manager is for ... > It showed that I have two SQL 2005 Servers installed locally, SQLEXPRESS and MSSQLSERVER. Of these, the first is the Express edition I guess (from a previous install of Visual Studio 2005 Express) and the second must be the developer version installed with VS2005 Standard. > > The second wasn't running. I started it and somewhere I noticed a tip to create a DTS package: Run DTSWizard from Start Menu, Run. > That wizard connected happily to a server and offered to save and run the created SSIS package ... OK, and yes it did. Success! > > Now I need to find out how to get to that saved package ... > > /gustav From tomlough at eircom.net Mon Jan 21 02:07:28 2008 From: tomlough at eircom.net (Thomas O Loughlin) Date: Mon, 21 Jan 2008 08:07:28 -0000 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: References: Message-ID: <008001c85c04$aa046b20$fe0d4160$@net> Gustav, AFAIK, the Express version of SQL doesn't come with the GUI management tools. The configuration manager is used primarily for security & configuration, e.g. active protocols, services, etc. You can download the version of Sql Management studio from : http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D- 94B8-5A0F62BF7796&displaylang=en but this isn't typically included in the VWD install Tom -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 21 January 2008 07:50 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Hi Mark I'm no expert in SQL Server and I have no running installations of version 7 (except the MSDE which came without administration tools). To me it looks like you do have SQL Server 2005 Express installed from the MS Visual Web Developer Express. The "SQL Server Configuration Manager" should be located under "Configuration Tools" under your Start menu entry "Microsoft SQL Server 2005". /gustav >>> markamatte at hotmail.com 18-01-2008 21:17:25 >>> Gustav, In reading your last post mentioning "SQL Server Configuration Manager"...below is my other post concerning this. I'm at a point where I'm not sure what I have installed? ************I currently use SQL Server 7. I installed MS Visual Web Developer Express...and it added a folder MS SQL Server 2005. In the Folder under "Configuration Tools" it has SQL Server Configuration Manager...which I have no idea what it is. There doesn't seem to be a place to manage tables/SPs. Is the folder misleading or does this mean SQL Server 2005 has been installed? SQL7 and Enterprise Manager still seem to be working properly. Any thoughts? Thanks, Mark A. Matte > Date: Fri, 18 Jan 2008 19:14:10 +0100 > From: Gustav at cactus.dk > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS > > Hi Arthur and Robert > > Just realised what the SQL Server Configuration Manager is for ... > It showed that I have two SQL 2005 Servers installed locally, SQLEXPRESS and MSSQLSERVER. Of these, the first is the Express edition I guess (from a previous install of Visual Studio 2005 Express) and the second must be the developer version installed with VS2005 Standard. > > The second wasn't running. I started it and somewhere I noticed a tip to create a DTS package: Run DTSWizard from Start Menu, Run. > That wizard connected happily to a server and offered to save and run the created SSIS package ... OK, and yes it did. Success! > > Now I need to find out how to get to that saved package ... > > /gustav _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Gustav at cactus.dk Mon Jan 21 02:45:41 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 21 Jan 2008 09:45:41 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi Tom Thanks. By second thought, I remember having installed the SQL Server 2005 Express editon as well. Perhaps that is from where the manager origins. /gustav >>> tomlough at eircom.net 21-01-2008 09:07:28 >>> Gustav, AFAIK, the Express version of SQL doesn't come with the GUI management tools. The configuration manager is used primarily for security & configuration, e.g. active protocols, services, etc. You can download the version of Sql Management studio from : http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D- 94B8-5A0F62BF7796&displaylang=en but this isn't typically included in the VWD install Tom -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 21 January 2008 07:50 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Hi Mark I'm no expert in SQL Server and I have no running installations of version 7 (except the MSDE which came without administration tools). To me it looks like you do have SQL Server 2005 Express installed from the MS Visual Web Developer Express. The "SQL Server Configuration Manager" should be located under "Configuration Tools" under your Start menu entry "Microsoft SQL Server 2005". /gustav >>> markamatte at hotmail.com 18-01-2008 21:17:25 >>> Gustav, In reading your last post mentioning "SQL Server Configuration Manager"...below is my other post concerning this. I'm at a point where I'm not sure what I have installed? ************I currently use SQL Server 7. I installed MS Visual Web Developer Express...and it added a folder MS SQL Server 2005. In the Folder under "Configuration Tools" it has SQL Server Configuration Manager...which I have no idea what it is. There doesn't seem to be a place to manage tables/SPs. Is the folder misleading or does this mean SQL Server 2005 has been installed? SQL7 and Enterprise Manager still seem to be working properly. Any thoughts? Thanks, Mark A. Matte > Date: Fri, 18 Jan 2008 19:14:10 +0100 > From: Gustav at cactus.dk > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS > > Hi Arthur and Robert > > Just realised what the SQL Server Configuration Manager is for ... > It showed that I have two SQL 2005 Servers installed locally, SQLEXPRESS and MSSQLSERVER. Of these, the first is the Express edition I guess (from a previous install of Visual Studio 2005 Express) and the second must be the developer version installed with VS2005 Standard. > > The second wasn't running. I started it and somewhere I noticed a tip to create a DTS package: Run DTSWizard from Start Menu, Run. > That wizard connected happily to a server and offered to save and run the created SSIS package ... OK, and yes it did. Success! > > Now I need to find out how to get to that saved package ... > > /gustav From ssharkins at gmail.com Mon Jan 21 09:26:40 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 21 Jan 2008 10:26:40 -0500 Subject: [dba-SQLServer] SQL Server LIKE and non-string data types References: <001c01c85b97$9e002ca0$4b3a8343@SusanOne> <4794B07E.21175.4C822E@stuart.lexacorp.com.pg> Message-ID: <012001c85c42$07675ab0$4b3a8343@SusanOne> Thanks for replying -- so the conversion is implicit then? Here's a link to a microsoft article: http://msdn2.microsoft.com/en-us/library/ms187928.aspx Thumb down about 3/4's of the way and you'll see some examples using CAST with LIKE -- reading this I assumed that the following wouldn't work, but it did: USE AdventureWorks SELECT ProductID, Weight / 454 As Poundage FROM Production.Products WHERE WeightUnitMeasureCode = 'G' AND Weight / 454 = '1%' I don't know whether the documentation is misleading/incorrect or I'm misunderstanding the example. So far, I've not been able to generate a LIKE that doesn't work without an explicit conversion. Susan H. ----- Original Message ----- From: "Stuart McLachlan" To: "Discussion concerning MS SQL Server" Sent: Sunday, January 20, 2008 11:47 PM Subject: Re: [dba-SQLServer] SQL Server LIKE and non-string data types What documentation are you referring to? >From SQL Server 2000 BOL: LIKE ....... "If any of the arguments are not of character string data type, Microsoft? SQL ServerTM converts them to character string data type, if possible." (Don't have v7 documentation available here, but I'm pretty sure it was the same back then.) Cheers, Stuart On 20 Jan 2008 at 14:06, Susan Harkins wrote: > I expected the following statement to fail > > USE AdventureWorks > SELECT ProductID, Weight > FROM Production.Product > WHERE Weight LIKE '4%' > > But it works. The documentation implies that LIKE won't work with > non-string > data types and that you must use CAST to convert them first -- but this > works as expected without CAST. Weight is a decimal data type. I'm using > SQL > Server Express (2005) so I'm wondering if this is a version thing -- maybe > 2005 forces an implicit conversion? > > Susan Harkins > > _______________________________________________ > 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 Gustav at cactus.dk Mon Jan 21 09:48:09 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 21 Jan 2008 16:48:09 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi all How do you use SSIS with Visual Studio 2005? I understand that VS is the "new" environment for creating SSIS packages, and that "SQL Server Business Intelligence Development Studio" should be the tool for this. That's fine - I do have that menu entry under the menu "Microsoft SQL Server 2005". However, when I click that, Visual Studio launches - and that's it. No special tools, no wizards, no SSIS-something. Just plain VS. What to do? /gustav >>> Gustav at cactus.dk 18-01-2008 15:40:43 >>> Hi all I'm new to DTS and thought I had a job for this for a scheduled job for importing/exporting some data. Then this page: http://msdn2.microsoft.com/en-us/library/ms141026.aspx tells that: Integration Services replaces Data Transformation Services (DTS), which was first introduced as a component of SQL Server 7.0. Is that so? And even worse, this page: http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx indicates that SSIS is not available with the SQL Server Express edition. So our client will have to purchase a SQL Server Standard Edition? Or would there be another simple method to run a scheduled job? It's only about retrieving data from some Access tables and writing some others to another database without user intervention. /gustav From Mwp.Reid at qub.ac.uk Mon Jan 21 09:56:57 2008 From: Mwp.Reid at qub.ac.uk (Martin W Reid) Date: Mon, 21 Jan 2008 15:56:57 +0000 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: References: Message-ID: Is there anything available when you go to create a new project?? Martin Martin WP Reid Information Services Queen's University Riddel Hall 185 Stranmillis Road Belfast BT9 5EE Tel : 02890974465 Email : mwp.reid at qub.ac.uk ________________________________________ From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock [Gustav at cactus.dk] Sent: 21 January 2008 15:48 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Hi all How do you use SSIS with Visual Studio 2005? I understand that VS is the "new" environment for creating SSIS packages, and that "SQL Server Business Intelligence Development Studio" should be the tool for this. That's fine - I do have that menu entry under the menu "Microsoft SQL Server 2005". However, when I click that, Visual Studio launches - and that's it. No special tools, no wizards, no SSIS-something. Just plain VS. What to do? /gustav >>> Gustav at cactus.dk 18-01-2008 15:40:43 >>> Hi all I'm new to DTS and thought I had a job for this for a scheduled job for importing/exporting some data. Then this page: http://msdn2.microsoft.com/en-us/library/ms141026.aspx tells that: Integration Services replaces Data Transformation Services (DTS), which was first introduced as a component of SQL Server 7.0. Is that so? And even worse, this page: http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx indicates that SSIS is not available with the SQL Server Express edition. So our client will have to purchase a SQL Server Standard Edition? Or would there be another simple method to run a scheduled job? It's only about retrieving data from some Access tables and writing some others to another database without user intervention. /gustav _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Gustav at cactus.dk Mon Jan 21 10:21:38 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 21 Jan 2008 17:21:38 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi Martin Yes, all the usual (default) stuff. /gustav >>> Mwp.Reid at qub.ac.uk 21-01-2008 16:56:57 >>> Is there anything available when you go to create a new project?? Martin Martin WP Reid Information Services Queen's University Riddel Hall 185 Stranmillis Road Belfast BT9 5EE Tel : 02890974465 Email : mwp.reid at qub.ac.uk ________________________________________ From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock [Gustav at cactus.dk] Sent: 21 January 2008 15:48 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Hi all How do you use SSIS with Visual Studio 2005? I understand that VS is the "new" environment for creating SSIS packages, and that "SQL Server Business Intelligence Development Studio" should be the tool for this. That's fine - I do have that menu entry under the menu "Microsoft SQL Server 2005". However, when I click that, Visual Studio launches - and that's it. No special tools, no wizards, no SSIS-something. Just plain VS. What to do? /gustav >>> Gustav at cactus.dk 18-01-2008 15:40:43 >>> Hi all I'm new to DTS and thought I had a job for this for a scheduled job for importing/exporting some data. Then this page: http://msdn2.microsoft.com/en-us/library/ms141026.aspx tells that: Integration Services replaces Data Transformation Services (DTS), which was first introduced as a component of SQL Server 7.0. Is that so? And even worse, this page: http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx indicates that SSIS is not available with the SQL Server Express edition. So our client will have to purchase a SQL Server Standard Edition? Or would there be another simple method to run a scheduled job? It's only about retrieving data from some Access tables and writing some others to another database without user intervention. /gustav From ssharkins at gmail.com Mon Jan 21 10:24:43 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 21 Jan 2008 11:24:43 -0500 Subject: [dba-SQLServer] CHECK example Message-ID: <019a01c85c4a$22ab8320$4b3a8343@SusanOne> I swear, I haven't been able to do anything in SQL Server this weekend. ;( I want to add a simple CHECK constraint, programmatically to a column and I've reviewed the syntax for ALTER TABLE And CONSTRAINT and it's clear as mud. TableName: dbo.PostalCodes ColumnName: PostalCodeExtended DataType: varchar(9) Constraint definition: (PostalCodeExtended LIKE '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]') I just can't get it -- I can't find anyplace in the syntax to actually define the constraint. Susan H. From Mwp.Reid at qub.ac.uk Mon Jan 21 10:25:53 2008 From: Mwp.Reid at qub.ac.uk (Martin W Reid) Date: Mon, 21 Jan 2008 16:25:53 +0000 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: References: Message-ID: In my VS 2005 if I select File New Project right at the top of the list is Business Development Project. This is mainly to do with reporting services. Martin Martin WP Reid Information Services Queen's University Riddel Hall 185 Stranmillis Road Belfast BT9 5EE Tel : 02890974465 Email : mwp.reid at qub.ac.uk ________________________________________ From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock [Gustav at cactus.dk] Sent: 21 January 2008 16:21 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Hi Martin Yes, all the usual (default) stuff. /gustav >>> Mwp.Reid at qub.ac.uk 21-01-2008 16:56:57 >>> Is there anything available when you go to create a new project?? Martin Martin WP Reid Information Services Queen's University Riddel Hall 185 Stranmillis Road Belfast BT9 5EE Tel : 02890974465 Email : mwp.reid at qub.ac.uk ________________________________________ From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock [Gustav at cactus.dk] Sent: 21 January 2008 15:48 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Hi all How do you use SSIS with Visual Studio 2005? I understand that VS is the "new" environment for creating SSIS packages, and that "SQL Server Business Intelligence Development Studio" should be the tool for this. That's fine - I do have that menu entry under the menu "Microsoft SQL Server 2005". However, when I click that, Visual Studio launches - and that's it. No special tools, no wizards, no SSIS-something. Just plain VS. What to do? /gustav >>> Gustav at cactus.dk 18-01-2008 15:40:43 >>> Hi all I'm new to DTS and thought I had a job for this for a scheduled job for importing/exporting some data. Then this page: http://msdn2.microsoft.com/en-us/library/ms141026.aspx tells that: Integration Services replaces Data Transformation Services (DTS), which was first introduced as a component of SQL Server 7.0. Is that so? And even worse, this page: http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx indicates that SSIS is not available with the SQL Server Express edition. So our client will have to purchase a SQL Server Standard Edition? Or would there be another simple method to run a scheduled job? It's only about retrieving data from some Access tables and writing some others to another database without user intervention. /gustav _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at gmail.com Mon Jan 21 10:40:12 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Mon, 21 Jan 2008 11:40:12 -0500 Subject: [dba-SQLServer] Fw: CHECK example Message-ID: <01d601c85c4c$4fef93b0$4b3a8343@SusanOne> As usual, nevermind... Thanks anyway! Susan H. >I swear, I haven't been able to do anything in SQL Server this weekend. ;( > > I want to add a simple CHECK constraint, programmatically to a column and > I've reviewed the syntax for ALTER TABLE And CONSTRAINT and it's clear as > mud. > > TableName: dbo.PostalCodes > ColumnName: PostalCodeExtended > DataType: varchar(9) > Constraint definition: (PostalCodeExtended LIKE > '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]') > > I just can't get it -- I can't find anyplace in the syntax to actually > define the constraint. > > Susan H. From Gustav at cactus.dk Mon Jan 21 11:01:54 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 21 Jan 2008 18:01:54 +0100 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Message-ID: Hi Martin Oh, right (or left it is) - I have been starring at the right pane only ... Thanks! And right, reporting items only - too sad. I have to install the Standard version and I was about to but Office 2007 have eaten up my diskspace. Have you done any work with SSIS packages? /gustav >>> Mwp.Reid at qub.ac.uk 21-01-2008 17:25:53 >>> In my VS 2005 if I select File New Project right at the top of the list is Business Development Project. This is mainly to do with reporting services. Martin Martin WP Reid Information Services Queen's University Riddel Hall 185 Stranmillis Road Belfast BT9 5EE Tel : 02890974465 Email : mwp.reid at qub.ac.uk ________________________________________ From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock [Gustav at cactus.dk] Sent: 21 January 2008 16:21 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Hi Martin Yes, all the usual (default) stuff. /gustav >>> Mwp.Reid at qub.ac.uk 21-01-2008 16:56:57 >>> Is there anything available when you go to create a new project?? Martin Martin WP Reid Information Services Queen's University Riddel Hall 185 Stranmillis Road Belfast BT9 5EE Tel : 02890974465 Email : mwp.reid at qub.ac.uk ________________________________________ From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock [Gustav at cactus.dk] Sent: 21 January 2008 15:48 To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS Hi all How do you use SSIS with Visual Studio 2005? I understand that VS is the "new" environment for creating SSIS packages, and that "SQL Server Business Intelligence Development Studio" should be the tool for this. That's fine - I do have that menu entry under the menu "Microsoft SQL Server 2005". However, when I click that, Visual Studio launches - and that's it. No special tools, no wizards, no SSIS-something. Just plain VS. What to do? /gustav >>> Gustav at cactus.dk 18-01-2008 15:40:43 >>> Hi all I'm new to DTS and thought I had a job for this for a scheduled job for importing/exporting some data. Then this page: http://msdn2.microsoft.com/en-us/library/ms141026.aspx tells that: Integration Services replaces Data Transformation Services (DTS), which was first introduced as a component of SQL Server 7.0. Is that so? And even worse, this page: http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx indicates that SSIS is not available with the SQL Server Express edition. So our client will have to purchase a SQL Server Standard Edition? Or would there be another simple method to run a scheduled job? It's only about retrieving data from some Access tables and writing some others to another database without user intervention. /gustav From accessd at shaw.ca Mon Jan 21 16:23:48 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 21 Jan 2008 14:23:48 -0800 Subject: [dba-SQLServer] MS SQL and SQL express In-Reply-To: References: Message-ID: Hi All: Has anyone had experience with MS SQL Reports? Comments? MTIA Jim From fuller.artful at gmail.com Mon Jan 21 17:21:41 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 21 Jan 2008 18:21:41 -0500 Subject: [dba-SQLServer] MS SQL and SQL express In-Reply-To: References: Message-ID: <29f585dd0801211521h1e8842abs3ec9eed0d2fbcc36@mail.gmail.com> If you mean SQL 2005 Reporting Services, they are fantastic. Features I've wanted for years, and had no easy way to deliver: effortless crosstabs; drillowns; smart parameters; web interface. For starters. Arthur On 1/21/08, Jim Lawrence wrote: > > Hi All: > > Has anyone had experience with MS SQL Reports? Comments? > > MTIA > Jim > From jlawrenc1 at shaw.ca Mon Jan 21 19:15:59 2008 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Mon, 21 Jan 2008 17:15:59 -0800 Subject: [dba-SQLServer] MS SQL and SQL express In-Reply-To: <29f585dd0801211521h1e8842abs3ec9eed0d2fbcc36@mail.gmail.com> References: <29f585dd0801211521h1e8842abs3ec9eed0d2fbcc36@mail.gmail.com> Message-ID: <9C85DD50E2A9431A9B146F8370B31A5E@creativesystemdesigns.com> Thanks Arthur... now it is time to start some serious investigation. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Monday, January 21, 2008 3:22 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] MS SQL and SQL express If you mean SQL 2005 Reporting Services, they are fantastic. Features I've wanted for years, and had no easy way to deliver: effortless crosstabs; drillowns; smart parameters; web interface. For starters. Arthur On 1/21/08, Jim Lawrence wrote: > > Hi All: > > Has anyone had experience with MS SQL Reports? Comments? > > MTIA > Jim > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From markamatte at hotmail.com Tue Jan 22 10:15:43 2008 From: markamatte at hotmail.com (Mark A Matte) Date: Tue, 22 Jan 2008 16:15:43 +0000 Subject: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS In-Reply-To: <008001c85c04$aa046b20$fe0d4160$@net> References: <008001c85c04$aa046b20$fe0d4160$@net> Message-ID: Thanks, I think thats what has happened. MS Visual Web Developer Express did install SQL Server 2005, but not the GUI....I think??? I'm goinmg to try the instal of SQL Management below. Thanks, Mark A. Matte > From: tomlough at eircom.net > To: dba-sqlserver at databaseadvisors.com > Date: Mon, 21 Jan 2008 08:07:28 +0000 > Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS > > Gustav, > > AFAIK, the Express version of SQL doesn't come with the GUI management > tools. The configuration manager is used primarily for security & > configuration, e.g. active protocols, services, etc. > You can download the version of Sql Management studio from : > http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D- > 94B8-5A0F62BF7796&displaylang=en > but this isn't typically included in the VWD install > > Tom > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav > Brock > Sent: 21 January 2008 07:50 > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS > > Hi Mark > > I'm no expert in SQL Server and I have no running installations of version 7 > (except the MSDE which came without administration tools). > To me it looks like you do have SQL Server 2005 Express installed from the > MS Visual Web Developer Express. The "SQL Server Configuration Manager" > should be located under "Configuration Tools" under your Start menu entry > "Microsoft SQL Server 2005". > > /gustav > >>>> markamatte at hotmail.com 18-01-2008 21:17:25>>> > > Gustav, > > In reading your last post mentioning "SQL Server Configuration > Manager"...below is my other post concerning this. I'm at a point where I'm > not sure what I have installed? > > ************I currently use SQL Server 7. I installed MS Visual Web > Developer Express...and it added a folder MS SQL Server 2005. In the Folder > under "Configuration Tools" it has SQL Server Configuration Manager...which > I have no idea what it is. There doesn't seem to be a place to manage > tables/SPs. Is the folder misleading or does this mean SQL Server 2005 has > been installed? SQL7 and Enterprise Manager still seem to be working > properly. > > Any thoughts? > Thanks, > > Mark A. Matte > > >> Date: Fri, 18 Jan 2008 19:14:10 +0100 >> From: Gustav at cactus.dk >> To: dba-sqlserver at databaseadvisors.com >> Subject: Re: [dba-SQLServer] SSIS, SQL Server Integration Services, DTS >> >> Hi Arthur and Robert >> >> Just realised what the SQL Server Configuration Manager is for ... >> It showed that I have two SQL 2005 Servers installed locally, SQLEXPRESS > and MSSQLSERVER. Of these, the first is the Express edition I guess (from a > previous install of Visual Studio 2005 Express) and the second must be the > developer version installed with VS2005 Standard. >> >> The second wasn't running. I started it and somewhere I noticed a tip to > create a DTS package: Run DTSWizard from Start Menu, Run. >> That wizard connected happily to a server and offered to save and run the > created SSIS package ... OK, and yes it did. Success! >> >> Now I need to find out how to get to that saved package ... >> >> /gustav > > > > _______________________________________________ > 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 > _________________________________________________________________ Need to know the score, the latest news, or you need your Hotmail?-get your "fix". http://www.msnmobilefix.com/Default.aspx From fhtapia at gmail.com Tue Jan 22 13:04:41 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 22 Jan 2008 11:04:41 -0800 Subject: [dba-SQLServer] MS SQL and SQL express In-Reply-To: <29f585dd0801211521h1e8842abs3ec9eed0d2fbcc36@mail.gmail.com> References: <29f585dd0801211521h1e8842abs3ec9eed0d2fbcc36@mail.gmail.com> Message-ID: 2nd, with 2005 Reporting Services they took care of a lot of issues that were problematic in Sql Server 2000 Reporting Services. Very much welcomed improvements. On Jan 21, 2008 3:21 PM, Arthur Fuller wrote: > If you mean SQL 2005 Reporting Services, they are fantastic. Features I've > wanted for years, and had no easy way to deliver: effortless crosstabs; > drillowns; smart parameters; web interface. For starters. > > Arthur > > On 1/21/08, Jim Lawrence wrote: > > > > Hi All: > > > > Has anyone had experience with MS SQL Reports? Comments? > > > > MTIA > > Jim > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From john at winhaven.net Wed Jan 23 13:58:52 2008 From: john at winhaven.net (John Bartow) Date: Wed, 23 Jan 2008 13:58:52 -0600 Subject: [dba-SQLServer] DBA Award Announcement - Bryan Carbonnell Message-ID: <200801231958.m0NJwkZF002102@databaseadvisors.com> It is with great pleasure that the Board of Directors for Database Advisors, Inc. presents Bryan Carbonell with a Special Service Award in deep appreciation for all that he has done for Database Advisors as List Master. We value his dedication, professionalism and the sharing of his talents and we look forward to continuing our work together. Award link: http://www.winhaven.net/misc/BryanCarbonnell.htm John Bartow, President Database Advisors, Inc. Email: mailto:president at databaseadvisors.com Website: http://www.databaseadvisors.com From john at winhaven.net Wed Jan 23 14:00:27 2008 From: john at winhaven.net (John Bartow) Date: Wed, 23 Jan 2008 14:00:27 -0600 Subject: [dba-SQLServer] DBA Award Announcement - Jim Lawrence Message-ID: <200801232000.m0NK0Oin003206@databaseadvisors.com> It is with great pleasure that the Board of Directors for Database Advisors, Inc. presents Jim Lawrence with a Special Service Award in deep appreciation for all that he has done for Database Advisors as List Master. We value his dedication, professionalism and the sharing of his talents and we look forward to continuing our work together. http://www.winhaven.net/misc/JimLawrence.htm John Bartow, President Database Advisors, Inc. Email: mailto:president at databaseadvisors.com Website: http://www.databaseadvisors.com From garykjos at gmail.com Wed Jan 23 14:59:50 2008 From: garykjos at gmail.com (Gary Kjos) Date: Wed, 23 Jan 2008 14:59:50 -0600 Subject: [dba-SQLServer] [dba-OT] DBA Award Announcement - Bryan Carbonnell In-Reply-To: <200801231958.m0NJwkZF002102@databaseadvisors.com> References: <200801231958.m0NJwkZF002102@databaseadvisors.com> Message-ID: Yes, THANK YOU BRYAN! GK On 1/23/08, John Bartow wrote: > It is with great pleasure that the Board of Directors for Database Advisors, > Inc. presents Bryan Carbonell with a Special Service Award in deep > appreciation for all that he has done for Database Advisors as List Master. > We value his dedication, professionalism and the sharing of his talents and > we look forward to continuing our work together. > > Award link: http://www.winhaven.net/misc/BryanCarbonnell.htm > > John Bartow, President > Database Advisors, Inc. > Email: mailto:president at databaseadvisors.com > Website: http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-OT mailing list > dba-OT at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-ot > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From garykjos at gmail.com Wed Jan 23 15:00:34 2008 From: garykjos at gmail.com (Gary Kjos) Date: Wed, 23 Jan 2008 15:00:34 -0600 Subject: [dba-SQLServer] [dba-OT] DBA Award Announcement - Jim Lawrence In-Reply-To: <200801232000.m0NK0Oin003206@databaseadvisors.com> References: <200801232000.m0NK0Oin003206@databaseadvisors.com> Message-ID: Yes, THANK YOU JIM! GK On 1/23/08, John Bartow wrote: > It is with great pleasure that the Board of Directors for Database Advisors, > Inc. presents Jim Lawrence with a Special Service Award in deep appreciation > for all that he has done for Database Advisors as List Master. We value his > dedication, professionalism and the sharing of his talents and we look > forward to continuing our work together. > > http://www.winhaven.net/misc/JimLawrence.htm > > John Bartow, President > Database Advisors, Inc. > Email: mailto:president at databaseadvisors.com > Website: http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-OT mailing list > dba-OT at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-ot > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From Gustav at cactus.dk Fri Jan 25 05:02:16 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 25 Jan 2008 12:02:16 +0100 Subject: [dba-SQLServer] Performance of .Net Code in SQL Server 2005 Message-ID: Hi all I came across this interesting article: http://www.novicksoftware.com/coding-in-sql/Vol3/cis-v3-N14-performannce-of-dot-net-code-sql-server-2005.htm But is anyone here running .Net code in SQL Server? A client has an mdb file with poorly designed tables and sloppy data. The task is to clean these and transfer them to SQL Server tables with a better structure. I'm not so familiar in T-SQL, so I created queries in Access to test and view the possible output. A typical query contains code like this: SELECT .. IIf(InStrRev([dessNr],"-")>0 And IsNumeric(Right([dessNr],1)),Left([dessNr],InStrRev([dessNr],"-")-1),[dessNr]) AS dessinNoBase T-SQL knows nothing about InStrRev so I looked for options on how to translate such functions. One option is to use .Net code. Speed is not important (small tables). How do I approach this? Well, the top links at that page link to presentations on: SQLCLR Programming with SQL Server 2005 Still, has anyone been working with this? /gustav From fuller.artful at gmail.com Tue Jan 29 05:40:54 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 29 Jan 2008 06:40:54 -0500 Subject: [dba-SQLServer] UPSERT Message-ID: <29f585dd0801290340r4cabfabao8376d209d6836d21@mail.gmail.com> I just read an interesting piece by Roy Ernest (see http://www.sqlservercentral.com/articles/T-SQL/61773/) on UPSERT, the author's term for the fastest way to handle a common problem: if a row exists, update it; if not, insert it. He shows that the common way of doing this (I plead guilty) requires two disk hits, when only one is necessary most of the time. For details, see the URL above, but the general idea is this: try the update first, then examine the value of @@rowcount. If it's zero, the row doesn't exist, so do the insert. I have always checked for the row first, but I now see the error of my ways. Arthur From markamatte at hotmail.com Tue Jan 29 12:10:43 2008 From: markamatte at hotmail.com (Mark A Matte) Date: Tue, 29 Jan 2008 18:10:43 +0000 Subject: [dba-SQLServer] UPSERT In-Reply-To: <29f585dd0801290340r4cabfabao8376d209d6836d21@mail.gmail.com> References: <29f585dd0801290340r4cabfabao8376d209d6836d21@mail.gmail.com> Message-ID: Arthur, I am fairly new to SQL Server...and have not had this issue...but with the scenario outlined below, lets switch it. If my records were typically inserts with the occasional update...do you think we could reverse the order in the SP as long as "WHERE TicketNumber = @Parm3" was known and a PK?...or is the insert failing due to PK different than '0 records affected'? Thanks, Mark A. Matte > Date: Tue, 29 Jan 2008 06:40:54 -0500 > From: fuller.artful at gmail.com > To: dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer] UPSERT > > I just read an interesting piece by Roy Ernest (see > http://www.sqlservercentral.com/articles/T-SQL/61773/) on UPSERT, the > author's term for the fastest way to handle a common problem: if a row > exists, update it; if not, insert it. He shows that the common way of doing > this (I plead guilty) requires two disk hits, when only one is necessary > most of the time. > > For details, see the URL above, but the general idea is this: try the update > first, then examine the value of @@rowcount. If it's zero, the row doesn't > exist, so do the insert. I have always checked for the row first, but I now > see the error of my ways. > > Arthur > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > _________________________________________________________________ Climb to the top of the charts!?Play the word scramble challenge with star power. http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan From fuller.artful at gmail.com Tue Jan 29 12:19:35 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 29 Jan 2008 13:19:35 -0500 Subject: [dba-SQLServer] UPSERT In-Reply-To: References: <29f585dd0801290340r4cabfabao8376d209d6836d21@mail.gmail.com> Message-ID: <29f585dd0801291019l2d710affl40bdf7bcb6f6e55c@mail.gmail.com> You may have a point here, Mark. Or at least enough reason for me to do a quick test. On 1/29/08, Mark A Matte wrote: > > > Arthur, > > I am fairly new to SQL Server...and have not had this issue...but with the > scenario outlined below, lets switch it. If my records were typically > inserts with the occasional update...do you think we could reverse the order > in the SP as long as "WHERE TicketNumber = @Parm3" was known and a PK?...or > is the insert failing due to PK different than '0 records affected'? > > Thanks, > > Mark A. Matte > From pcs at azizaz.com Wed Jan 30 20:25:11 2008 From: pcs at azizaz.com (pcs at azizaz.com) Date: Thu, 31 Jan 2008 12:25:11 +1000 (EST) Subject: [dba-SQLServer] Parameter Input for Bit Value Message-ID: <20080131122511.DND84265@dommail.onthenet.com.au> Hi, What's the best practice for setting up the sql syntax so that a parameter for a bit column can provide all three options: 0 (False) 1 (True) 0 or 1 (Both) like in: AND BRS.DiscardFlag = (@p2_DiscardFlagValue) Fiddling with various options, I stopped at AND BRS.DiscardFlag in (@DiscardFlagValueA , @DiscardFlagValueB) so parsed in values must be AND BRS.DiscardFlag in (1,1) to only return records where flag is TRUE AND BRS.DiscardFlag in (0,0) to only return records where flag is FALSE AND BRS.DiscardFlag in (0,1) to return all records irrespective of Flag value Is there another (better) way? Regards Borge From stuart at lexacorp.com.pg Wed Jan 30 22:18:47 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 31 Jan 2008 14:18:47 +1000 Subject: [dba-SQLServer] Parameter Input for Bit Value In-Reply-To: <20080131122511.DND84265@dommail.onthenet.com.au> References: <20080131122511.DND84265@dommail.onthenet.com.au> Message-ID: <47A1D8C7.19041.33B20D9A@stuart.lexacorp.com.pg> I'd use only one parameter and another value for "All". (All = 2?) Then you can just use: DECLARE @DiscardFlag INT ...... AND (DiscardFlag = @Discard OR @Discard = 2) On 31 Jan 2008 at 12:25, pcs at azizaz.com wrote: > Hi, > What's the best practice for setting up the sql syntax so > that a parameter for a bit column can provide all three > options: > 0 (False) > 1 (True) > 0 or 1 (Both) > > like in: > > AND > BRS.DiscardFlag = (@p2_DiscardFlagValue) > > Fiddling with various options, I stopped at > > AND > BRS.DiscardFlag in (@DiscardFlagValueA , @DiscardFlagValueB) > > so parsed in values must be > > AND > BRS.DiscardFlag in (1,1) > > to only return records where flag is TRUE > > AND > BRS.DiscardFlag in (0,0) > > to only return records where flag is FALSE > > AND > BRS.DiscardFlag in (0,1) > > to return all records irrespective of Flag value > > Is there another (better) way? > > Regards > Borge > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From Gustav at cactus.dk Thu Jan 31 04:00:27 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 31 Jan 2008 11:00:27 +0100 Subject: [dba-SQLServer] Parameter Input for Bit Value Message-ID: Hi Borge How about using one parameter to check for and another for the discard flag: AND (BRS.DiscardFlag = @p1_DiscardFlagValue Or @p2_DiscardFlagAny) /gustav >>> pcs at azizaz.com 31-01-2008 03:25:11 >>> Hi, What's the best practice for setting up the sql syntax so that a parameter for a bit column can provide all three options: 0 (False) 1 (True) 0 or 1 (Both) like in: AND BRS.DiscardFlag = (@p2_DiscardFlagValue) Fiddling with various options, I stopped at AND BRS.DiscardFlag in (@DiscardFlagValueA , @DiscardFlagValueB) so parsed in values must be AND BRS.DiscardFlag in (1,1) to only return records where flag is TRUE AND BRS.DiscardFlag in (0,0) to only return records where flag is FALSE AND BRS.DiscardFlag in (0,1) to return all records irrespective of Flag value Is there another (better) way? Regards Borge