Professional Documents
Culture Documents
com – Free SQL Server Articles
Using Temporary Tables with SSIS
Many people keep on asking on different SQL Server forums on how to use a temporary table
using in an SSIS Package, below mentioned is a mechanism that I have learned and been using
for long time for now, below it is…
We are going to take this to achieve this goal, we have to create a temporary table, insert some
data into it, and using data flow task which we shall dump this data into a permanent table.
We shall take the below script for this,
Create table ##TempTable(Id int identity(1,1),FName nvarchar(100),LName nvarchar(100))
9. Now create an OLEDB Destination connection with a suitable data source, use the create new
table option to create a table for the dump.
That’s it, now right click on the package and say execute, zoom it goes…
1 Using Temporary Tables with SSIS | http://www.sqllike.com – Free SQL
Server Articles
http://www.sqllike.com – Free SQL Server Articles
Now let’s see how we have to convert the global temporary table to a local temporary table.
10. Select the execute sql task, and then properties and under expressions we have our sql query,
here, at every place replace”##” with “#”.
11. Now go to the data flow task, and in the properties, custom properties, you will find the sql
query in “sqlCommand” property, change it here as well.
That’s it, now we have a package with Local Temporary Table as well.
Horray!!! Reached our Goal….
2 Using Temporary Tables with SSIS | http://www.sqllike.com – Free SQL
Server Articles