Hi,
I have several CSV files that need to be added to an SQL database, each having its own separate table with the same name as the CSV file. The files do not all have the same columns.
To summarize, what I need to do is:
- Get the file name (This gives the table name for my DDL script)
- Get column information from file (The Flat File Connection Manager gives both i.e. the column names as well as suggested types for each of the columns. I want to use these in my dynamically generated DDL script)
- Create the table using the generated script
- Load all data from file to destination table
My main concern is STEP 2. How do I get the column names and their types (as suggested by SSIS) to generate a dynamic DDL for each file that comes in? A script task? If yes, then how exactly?
There is something similar to my concern mentioned here but I'm unable to drive my way towards a solution with what has been suggested there.
TIA!