Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Importing csv with multiple values in a column to SQL table

$
0
0

Hi,

I have a csv file with the following format:

9-Jan-03SMC100;MC101;MC128CAPITAL BUILDERIFOHELMC100 0.0;MC101 0.0;MC128 0.0
1-Jan-00MB02;C02;MC04;MC23UNIVERSAL RETIREMENT PROGRAMMEPUPHILB02 13276.17;C02 13462.17;MC04 12726.15;MC23 11952.31
8-Aug-12MMC200;MC201;MC228CAPITAL BUILDER FUND
IFOGHELDMC200 0.0;MC201 0.0;MC228 0.0

I want to insert this data into SQL table in the following format:

9-Jan-03SMC100CAPITAL BUILDERIFOHELMC100 0.0
9-Jan-03SMC101CAPITAL BUILDERIFOHELMC101 0.0
9-Jan-03SMC128CAPITAL BUILDERIFOHELMC128 0.0
1-Jan-00MB02UNIVERSAL RETIREMENT PROGRAMMEPUPHILB02 13276.17
1-Jan-00MC02UNIVERSAL RETIREMENT PROGRAMMEPUPHILC02 13462.17
1-Jan-00MMC04UNIVERSAL RETIREMENT PROGRAMMEPUPHILMC04 12726.15
1-Jan-00MMC23UNIVERSAL RETIREMENT PROGRAMMEPUPHILMC23 11952.31
8-Aug-12MMC200CAPITAL BUILDER FUNDIFOGHELDMC200 0.0
8-Aug-12MMC201CAPITAL BUILDER FUNDIFOGHELDMC201 0.0
8-Aug-12MMC228CAPITAL BUILDER FUNDIFOGHELDMC228 0.0

Is there any way to do this in SSIS package?

I can do this using a Script Task and writing a code to loop through each line in the csv file. But that would be very messy.

Please suggest a simpler way to do this.

Thanks!!


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>