Friday, March 23, 2012

How can I output subset of a table to a flat file in SSIS?

Hi All,

I have a table A. I need output subset of a table A to a flat file using query, like:

select A.* from A inner join B on... ..... inner join C......where left(A.id, 3) = B.sid.... AND B.num between 100 and 200).

How can I do this in SSIS? Which data flow item I may need?

Thanks

Well there are several ways you could approach this.

One possibility is to use a "Data Reader Source" item. In the Advanced Editor of this item, under the Component Properties tab, you may specify a SqlCommand.

Another possible way is to use the "OLE DB Source" item. Double click the item to view the "OLE DB Source editor". Change the data access mode to "SQL command". Some controls will appear that can assist you with entering and validating your SQL statement.

|||

SSISy Boy wrote:

Well there are several ways you could approach this.

One possibility is to use a "Data Reader Source" item. In the Advanced Editor of this item, under the Component Properties tab, you may specify a SqlCommand.

Another possible way is to use the "OLE DB Source" item. Double click the item to view the "OLE DB Source editor". Change the data access mode to "SQL command". Some controls will appear that can assist you with entering and validating your SQL statement.

Thanks, it works!

No comments:

Post a Comment