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


How to import top row only and ignore other rows using SSIS


How to import top row only and ignore other rows using SSIS

Author
Message
dbman
dbman
Say Hey Kid
Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)

Group: General Forum Members
Points: 677 Visits: 1537
Hi,

I want to import flat files into a sql table. I only require the top row each time a file is imported. How can i set up my SSIS package to import that row only.

The format of the files is:

3178593|M120|010|3206304|AF-01566|20130917|1123|3

0007|900548|00002|||00000.000|TOS

0013|3043213|00001|||00000.000|EOE

0014|270652|00001|75-104||00000.000|TOS

Thanks
dbman
dbman
Say Hey Kid
Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)

Group: General Forum Members
Points: 677 Visits: 1537
Any idea? I believe i can use the conditional Split. But I am struggling to find a way to use this.
Tee Time
Tee Time
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1067 Visits: 465
What are you importing into, SQL Server? How many records in the flat file?
Tee Time
Tee Time
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1067 Visits: 465
have a look at this. Read the first N rows
dbman
dbman
Say Hey Kid
Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)

Group: General Forum Members
Points: 677 Visits: 1537
Thanks for your reply. I am trying to import a flat file into an SQL Server table.

The file structure is as follows:


3178593|M120|010|3206304|AF-01566|20130917|1123|3

0007|900548|00002|||00000.000|TOS

0013|3043213|00001|||00000.000|EOE

0014|270652|00001|75-104||00000.000|TOS


I am only interested in importing the first row. On a daily basis i may have multiple files, but the only row I am interested in importing is the top row.
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