October 25, 2010 at 11:40 am
Guys,
How to skip more than 2 rows in excel as source( case 1 first row has column names, but i dont need that header and i wanted to import data from row 3 onwards, case 2: i have data from 3rd row onwards, without header),
i dont see any properly like flat files, skip no of rows etc.
appreciate your help.
thnx!
October 26, 2010 at 6:39 am
You can still configure the Excel connection manager to skip the header, but you can't configure it to skip additional rows.
You can try to add a conditional split to remove the unnecessary rows manually. (or you can put everything in a staging table and remove the unwanted rows with a DELETE statement)
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 26, 2010 at 7:58 am
If you inject a row number into you data flow, then by using the condition split transform you can control which rows go to your destination and which don't.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
October 26, 2010 at 8:58 am
Here is a snippet of code (copied from a post long ago, by Jeff Moden)
It works for me
/*Import Excel OpenRowsetSelect data from excel
note Sheet1$a4:C start at row 4 using columns a thru c */
SELECT *
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Temp\Test2.xls;HDR=yes',
'SELECT * FROM [Sheet1$a4:c]')
October 27, 2010 at 10:12 am
If you'r able to convert the original excel file into a flat file of some format, you can opt to skip any number of data rows and/or the header row, as needed, in the connection manager. The other option, as mentioned above, is to do a conditional split based on the first field to discard unnecessary records after the header.
October 31, 2010 at 10:10 pm
Thank you All,
we did similar to Daz.. suggession
Cheers
RB
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply