jwcolby
jwcolby at colbyconsulting.com
Thu Mar 20 11:38:27 CDT 2008
>You can strip, concatenate, and update all in one query Yea, I suppose. I wanted to clean up the fields themselves, and given how little I really know I thought it best to just do the data cleanup in one step, then build a new column and do the append in a second step. I could be here all day trying to get anything more complex that this done "all in one step". Besides, I really need to take the time to learn the pieces. Thanks to everyone who has helped out this morning. 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 Paul Nielsen Sent: Thursday, March 20, 2008 12:30 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Diving off the deep end You can strip, concatenate, and update all in one query IN the airline reservation system, in one query I pivoted the 200 incoming comma delimited flights into a table using a UDF, left joined with the existing flight cache, parsed the flight data, calculated the number of legs in the flight and inserted the result into a table variable. In SQL Server it's generally better to do as much as possible in as few set-based operations as possible. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, March 20, 2008 10:14 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Diving off the deep end I'm getting there. I now have a query running stripping the leading zeros from three fields that I will then need to append together to get a single address field. So much of this stuff is easy enough if you do it all the time. My problem is that I am just spread too thin. John W. Colby Colby Consulting www.ColbyConsulting.com