Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Import From Flat File

Author  Topic 

learntsql

524 Posts

Posted - 2009-11-05 : 01:55:10
Hi,
I have to import data from Flat File(text file) to OLEDB.
How Can i skip first/last/middle n number of rows.from text file while importing into SQL Server table.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-05 : 03:55:03
I would import the data from file into a staging table first.
From there you can then take only the wanted records into the destination table.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-11-05 : 04:46:17
Or look at the Conditional Split Data Flow item.
Go to Top of Page

learntsql

524 Posts

Posted - 2009-11-05 : 23:46:22
How to Use Conditional Split Transformation,how to add count() to seperate the specific rows.
Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-11-06 : 07:27:48
To get the row number, you can use: http://sqlis.com/post/Row-Number-Transformation.aspx

Then use this new column in the Conditional split expressions to re-direct the rows.
Go to Top of Page
   

- Advertisement -