SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


how to generate records automatically from csv to sqlserver table using ssis etl


how to generate records automatically from csv to sqlserver table using ssis etl

Author
Message
rams.kola
rams.kola
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 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
Sigerson
Sigerson
Say Hey Kid
Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)

Group: General Forum Members
Points: 685 Visits: 1232
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
rams.kola
rams.kola
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 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.
Attachments
globalkeys.xls (16 views, 19.00 KB)
Sigerson
Sigerson
Say Hey Kid
Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)Say Hey Kid (685 reputation)

Group: General Forum Members
Points: 685 Visits: 1232
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search