question

sutharrameshkumar avatar image
sutharrameshkumar asked

Import the .csv file data in two table using SSIS package

Need to import the .csv file in sql using SSIS. The file format is given below: "HDR","00000001","14072014","111555" "1P","USA","CIS","0510001212","CIS","10","INV0001","14072014","100.45","INR","01","50","14072014","121212","100.45","PAID","" "1P","USA","CIS","0510001213","CIS","10","INV0002","14072014","200.45","INR","01","50","14072014","121212","200.45","PAID","" "TRL","2","300.90","" Description : Row starting with HDR(Contains invoicenumber,date,time) is header need to be inserted in Payment table. Row Starting with 1P is payment detail need to be inserted in PaymentDetail table. Row starting with TRL(Contains total invoicedetail items, and sum of invoiceamount) is trailor need to be inserted in Payment table. Please help to resolve this issue. I am new new SSIS.
ssiscsvimport
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fatherjack avatar image Fatherjack ♦♦ commented ·
Can you take a moment the format the sample data please? How many lines of data are you including? Use the formatting options in the toolbar so we can understand your data and give you an answer.
0 Likes 0 ·

1 Answer

·
sutharrameshkumar avatar image
sutharrameshkumar answered
Hi Jack, The first line in paymentheader 1p are payment detail trl is footer which contains total number of records(2), and ivoicetotal(300.90) "HDR","00000001","14072014","111555" "1P","USA","CIS","0510001212","CIS","10","INV0001" "1P","USA","CIS","0510001213","CIS","10","INV0002" "TRL","2","300.90","" I want to insert paymentheader and footer in payment table and other line items(1p) in paymentdetail table by using paymentid as primary key in payment table and same as foreign key in paymentdetail. paymentid should be generated and then it should be used in paymentdetail as reference.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.