Answered by:
Extracting Data from SSIS

Question
-
Hi
I am trying to extract data from the source table and I need only a partial data in a column( similar to substring(colA,1,3) ).. How do I do this in SSIS DFT. In the source editor I'm using table or view for the data access mode and not the sql command. Any help on this is greatly appreciated.
Thanks
AmbikaWednesday, October 21, 2009 4:12 PM
Answers
-
Hi
Errr...change to use the SQL Command then!
I am trying to extract data from the source table and I need only a partial data in a column( similar to substring(colA,1,3) ).. How do I do this in SSIS DFT. In the source editor I'm using table or view for the data access mode and not the sql command. Any help on this is greatly appreciated.
Thanks
Ambika
http://sqlblog.com/blogs/jamie_thomson/ | http://jamiethomson.spaces.live.com/ | @jamiet- Proposed as answer by Sudeep Raj Wednesday, October 21, 2009 5:16 PM
- Marked as answer by AmbikaSowmyan Wednesday, October 21, 2009 8:59 PM
Wednesday, October 21, 2009 5:09 PM
All replies
-
You can't do that with the table access mode, but you can modify the column contents later in the Data Flow with a Derived Column transformation.
However, the best way to accomplish what you need is to use the SQL Command mode instead of the Table mode - for several reasons. First, you retrieve less data - at least a few characters per row less. You should also use the SQL Command mode so that you don't use SELECT *, which is pretty much what the Table mode does. Only pick the columns you want - use the query builder button to do that. I think you'll find you'll use fewer columns when you do that as well. Second, if you trim down the column later in the data flow, you'll either chop it up "in place" in the same column its in, or create a new column. If you chop it up "in place", the column still has the original data type specification - the data in it is reduced, but the space taken in memory for it is still the same, and you will probably get a truncation warning when inserting. If you create a new column to hold the reduced-size information, you've just added more to the memory requirements of processing your data - albeit only three characters per row...
Wednesday, October 21, 2009 4:26 PM -
Hi
Errr...change to use the SQL Command then!
I am trying to extract data from the source table and I need only a partial data in a column( similar to substring(colA,1,3) ).. How do I do this in SSIS DFT. In the source editor I'm using table or view for the data access mode and not the sql command. Any help on this is greatly appreciated.
Thanks
Ambika
http://sqlblog.com/blogs/jamie_thomson/ | http://jamiethomson.spaces.live.com/ | @jamiet- Proposed as answer by Sudeep Raj Wednesday, October 21, 2009 5:16 PM
- Marked as answer by AmbikaSowmyan Wednesday, October 21, 2009 8:59 PM
Wednesday, October 21, 2009 5:09 PM -
Thanks all of you.. I just wanted to make sure I wasnt missing anything... since I am new to SSIS I wasnt sure if there was any other solution other than using sql command.Wednesday, October 21, 2009 9:01 PM