February 23, 2009 at 10:47 am
All,
I have data coming in a column in the following format
02968-01999-00013 - 9.The length of the data is not fixed,but 1 thing for sure is the last 4 char of the data consist of ' - 9'.I need to come up with the best way to get rid of the last 4 char of the data coming in.I have a table with 50 000 rows and this figure is going to increase over time.What is the fastest way to do this and be able to implement it in SSIS ?
February 23, 2009 at 11:05 am
SELECT SUBSTRING('02968-01999-00013 - 9',1,CHARINDEX(' ','02968-01999-00013 - 9')-1)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 23, 2009 at 11:09 am
Thanks Jeff,
How can I accomplish this in SSIS? ...as the script required passing the value of data each time.Is there anyway to pass the column name instead ?
February 23, 2009 at 11:38 am
Yes... just sub a column name in the place of the string literal in both places.
So far as exactly how to do it in SSIS, I don't know because I do all my ETL using T-SQL... I don't even know how to spell "SSIS".
--Jeff Moden
Change is inevitable... Change for the better is not.
February 23, 2009 at 11:39 am
p.s. You may have better luck if you posted this on the SSIS forum.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 23, 2009 at 11:41 am
Thanks Jeff, I shall do that.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply