Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

how to generate records automatically from csv to sqlserver table using ssis etl Expand / Collapse
Author
Message
Posted Tuesday, April 16, 2013 3:37 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, August 14, 2013 2:48 AM
Points: 13, Visits: 208
Hi All,

i have one requirement in ssis. I have one csv file (source) having one column called UOM (Unit of Measure) contains 3 values (like cc,vv,lb). My Target is sqlserver table. name of the table is dimglobalkeys having empty data. columns in my target table is (1)globalkeyid (2)UOM (3)recordtype.. I want to load my target table. how means..source having one column with 3 values. each value will generate 20 records in my target table. how...?? that is my requirement. kindly let me know how to solve my requirement....


Regards,
MSBI_Ram
Post #1442660
Posted Wednesday, April 17, 2013 8:20 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 7:07 AM
Points: 271, Visits: 822
Can you give example data showing the CSV data, and how that should go into the SQL Server table?

Sigerson

"No pressure, no diamonds." - Thomas Carlyle
Post #1443290
Posted Thursday, April 18, 2013 5:41 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, August 14, 2013 2:48 AM
Points: 13, Visits: 208
I'am having one csv file (dimglobalkeys.csv) contains only one column (unitofmeasure) having 68 records. my destination is table called dimglobalkeys having no data. i have insert scripts to insert the data in destination.but this script has to read from csv file having unitofmeasure column and insert into the target table.

am attaching the source csv file.
Target table name also contains the column unitofmeasure. This column has to read the data coming from csv file and load it into destination. CSV file having only one column unitofmeasure.


  Post Attachments 
globalkeys.xls (10 views, 19.50 KB)
Post #1443755
Posted Thursday, April 18, 2013 6:27 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 7:07 AM
Points: 271, Visits: 822
I still don't know the structure of the dimglobalkeys Table, so I still can't help much. You should always post as much information as you can in the body of your post. We need to know:

1. The structure of your SQL Server table
2. Is this a one to one import of the CSV rows into an equal number of rows in the matching table?

If 1-to-1, SQL Server can import it for you. In SSMS, right-click on the database name, select Tasks... and on the Tasks popup menu select Import... A wizard will appear.

Your data source is Flat File Source. Enter the file name and path of the XL file. After enter the instance and database name and you'll see a list of destination tables in your database. Check the box of the one you want to load the CSV to. From then on, you can just keep accepting the defaults and let it run. If you don't get the results you want at first, you can just truncate the SQL table and run the import again.


Sigerson

"No pressure, no diamonds." - Thomas Carlyle
Post #1443794
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse