Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically create table in SSIS data flow

Tags:

ssis

How can I have an SSIS data flow create a table that doesn't exist? Every time I try to run the package, it gives me an error saying that the destination table doesn't exist.

like image 705
divided Avatar asked Aug 29 '11 18:08

divided


People also ask

How do I create a dynamic table in SSIS?

Scenario: Download Script You received flat files or text files or csv files in one of the source folder. You need to write an SSIS Package that should read the file columns and create table and load the data from file. Once data is loading move the file to archive folder. The table will be created with name of file.


2 Answers

Since you want your package to create a table and then populate it, you can create one using the Execute SQL task. Just give it the script to create your table.

If you do not have the option of using an Execute SQL or Script task, then you can use a Script Component, but since it executes for every row, you'll have to get creative to have it execute only once.

Also, when you run this package, SSIS going to crib about the table not being found during Validation.

To counter that, in the package properties, in data-flow that populates the table, set Delay Validation property to True

like image 102
Raj More Avatar answered Nov 09 '22 10:11

Raj More


WHy not create the table in the step before the dataflow in an execute SQL task?

like image 35
HLGEM Avatar answered Nov 09 '22 10:11

HLGEM