Vinh Ton
Vinh Ton

Reputation: 107

Is it possible to dynamically create a table from as SSIS source

Objective: automate creating a table along with all its columns and data types given a SSIS source

My guess is:

1) Pointing Sources to a Destination to a SQL command

enter image description here

2) Using Select * into ... Problem is I don't know what the from equivalent of a source is

enter image description here

Alternative) Store results in Recordset and pass on to Execute SQL task. Problem then is how to access that result from execute sql task enter image description here

Upvotes: 2

Views: 4864

Answers (2)

Hadi
Hadi

Reputation: 37313

I think you should use a Recordset Destination to store data into an System.Object Variable, Then use a Script Task (starts after that Data Flow Task is executed) in which you will select the System.Object Variable as ReadOnly Variable. and you will write your own code to insert the Recordset to SQL using System.Data.SqlClient.SQLCommand Object

You can refer to one of these links

Upvotes: 2

Krismorte
Krismorte

Reputation: 632

If you need just the structure of table use this trick

select top 0 * into NewTable from YourTable

Upvotes: 1

Related Questions