简体   繁体   中英

Exporting column records from .CSV to multiple table in SQL Server using SSIS

I have a requirement to create a batch solution using SSIS package.

I am new to SSIS hence exploring this to implement my scenario.

Scenario:

  1. An external system will dump data into .CSV file on weekly basis on specific directory on server.
  2. An SSIS package will be scheduled to run on weekly basis to read that .CSV file path on server and write those data in multiple table in SQL Server.

Task: The source .CSV file with set of columns belong to different tables in SQL Server. Those column and data in that row should be mapped to specific columns in different tables.

My thought to ask community -

  1. What alternatives SSIS provides which allows me to segregate each column in .CSV file and map them to different table in SQL Server?
  2. In .CSV I have eleven columns. As per SQL table structure, those eleven columns are distributed into four separate tables.

I appreciate any productive advise to implement the solution.

UPDATE: Below things so far I setup/tried

  1. I created new SSI package successfully. In Data flow so far as a source I setup the variables to read path and file name.
  2. I setup OLE DB datasource as destination and establish connection to server.
  3. I believe I have reached by completing setup with .CSV as a source to read columns, but I am still exploring what would be ideal destination or how OLE DB would help to consume records in different tables.
  4. I went through Multicast and Import Columns options. I understand that the Multicast is mainly used to share or output data to different destinations.

you can create four OLE DB destinations and using multicast you can route your data. so basically multicast will pass all the 11 tables to all four destinations and there you can map only required column with your tables. Let me know if you have any confusion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM