Friday, February 24, 2012

AutoGenerate Table Schema in SSIS

I have a database that has few tables whose table Schema changes oftenly based on a flat file specification and I wanted to automate the process where I drop the table and recreate it with the new schema using an SSIS package. Any Ideas on how I can achieve this?SSIS can't handle changing metadata. Once built, it's set. (Unless you edit it and resave it.) Unless you are going to build the package using .Net, I don't believe this is possible.|||

Leo Mwangi wrote:

I have a database that has few tables whose table Schema changes oftenly based on a flat file specification and I wanted to automate the process where I drop the table and recreate it with the new schema using an SSIS package. Any Ideas on how I can achieve this?

Are you just wanting to drop and recreate the table, or do you want to populate it with data as well? If you want to populate it, Phil's comment applies. If you just want to drop and recreate the table based on info from a flat file, you could use a script task to read the file, create the appropriate SQL statements to DROP and CREATE the table and store them in variables, then call them from an Execute SQL task.

|||True statement, John!|||I want to drop and recreate them then push data. I think i have a working script which I will be pushing using script task. thanks for the suggestions guys.

No comments:

Post a Comment