Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS: START IMPORT AT LINE X 1

Status
Not open for further replies.

PrgrmsAll

Programmer
Apr 8, 2003
180
US
I have a simple DTS package that imports data from an Excel spreadsheet. Everything is fine and works as expected. The only problem is that I really don't want the first 10 rows of the worksheet since these are just useless header lines and not the actual data. The actual data columns start on line 11. Is there a way, on either the transformation (or something else) that I can have the import start at line 11? I know when importing to Access from Excel, this is supported, so I would assume SQLServer can handle it too, just not sure where to set the properties. Thanks in advance.
 
3 options
option 1, rename file to csv
change source to text in properties specify skip 10 rows

option 2 In Transform Data Task properties/options there is afirst row and last row text box

option 3
use a staging table and delete the rows you don't want before moving the data to the 'real' table

“I sense many useless updates in you... Useless updates lead to fragmentation... Fragmentation leads to downtime...Downtime leads to suffering..Fragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" --
 
Thanks for this. Option 2 (using first and last row) is perfect. How can I leave the last row param open-ended? That is, I want to set the first row to 11 and the last row to whatever the last row might be. It seems 0 and blank do not work (last row must be greater than first row). If I set to Excel's worksheet max (65536), will I get unwanted empty records?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top