Showing posts with label employee. Show all posts
Showing posts with label employee. Show all posts

Sunday, March 25, 2012

Exporting data to excel from T-SQL Resultset

I have started just using SSIS. I needed to transfer result set from SQL statements like SELECT * FROM Employee to excel spreadsheet. One way of getting this is using import and export wizard from management studio.

As my sql statement is complex joining many tables. I am wondering wheteher there are other best ways to deal such type of transformations.

I am sure this is very simple question but yours feedback will be much appreciated.

You can use a SQL statement in an OLE DB source and then you can hook that OLE DB source up to an Excel destination.|||

Notice that the Excel file must exists by the time the dataflow is reached and that if there is data on it; the new execution will append the new rows at the end of the existing ones; but youc an create a new excel file on each run (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=941982&SiteID=1)

There ahve been interesting discussion on this forum about diffrent escenarios involvong excel destination and source. make sure you use the search option at the top of this page

sql