I need to exctract data from multiple CSV files and store the data in SQL database table.
structure of data is not in same in CSV files. Number of columns and order of columns is different in CSV files. Same way, structure for all the destination database tables will not be the same. It will be according to the corresponding CSV file.
I am using execute sql task approach. I mean to use a foreach loop to loop through csv files and put an execute sql task inside foreach loop and make a BCP command dynamically to load data from csv file to sql server destination table. As using
BCP we don't need to worry about structure of data.
But, I am seeing few issues:
Execute SQL task runs the sql query. Then, how can we create a common query to get the data from csv files.
View Complete Post