简体   繁体   中英

Export temp table to excel in SSIS

Hi everyone I have small doubt in SSIS package:

I am using a stored procedure which is giving set of records, finally these records will be saved in temp table.

The thing is now I want this records to be exported to excel, so I planned to use SSIS package to do that. Now the problem is how will I define the OLE DB source in SSIS, because since am using #temptable at the runtime in stored procedure it will not be displayed in source of SSIS.

Kindly suggest to Export temp table to Excel files.

That fact that you're using a temp table is not likely to matter too much. Is your temp table used in the stored procedure logic which outputs a select statement? If yes, then in your OLE DB source set Data Access Mode to SQL Command and call the store procedure ( EXEC myStoredProcedure ).

Using a #temptable can be problematic in SSIS. If you need to access a temp table in different data flows or transformations, then you will need to used the global ##temptable .

Review this question , the answer goes into great detail on using temp tables.

Another Reference: SSIS: Using temporary tables

You can use Execute SQL Task to execute the stored procedure, load the data into the temp table.

You can access the temp table with Query command instead of select from the drop-down list.

Remember set up the connection manager's property RetainSameConnection as TRUE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM