links have more detailed information, but I have included some texts from pages (just in case, links remain dead)
IN:
While we are uploading a text file to SQL Server via SSIS, we have a provision to skip any number of leading lines from the source and load the data on the SQL server. Is there any provision to do the same for an Excel file.
For me, the source Excel file has some description in the leading 5 lines, I want to skip it and start loading data from line 6. Please tell us about it.
BUT:
The easiest way would be to give each row a number (a bit like an identifier in SQL Server), and then use conditional split to filter everything where the number <= 5
IN:
I have an SSIS package that imports data from an Excel file starting from the 7th row.
Unlike the same operation with the csv file ('Header Rows to Skip' in Connection Manager Editor), I cannot find a way to ignore the first 6 lines of the Excel file connection.
I assume that the answer may be in one of the data stream Transformation objects, but I am not very familiar with it.
BUT:
Question Log in and rate 1 Log in to vote rbhro, in fact there were 2 fields in the top 5 lines with some data that, it seems to me, were prevented by the importer completely ignoring these lines.
Anyway, I found a solution to my problem.
In my original Excel object, I used "SQL Command" as the "Data Access" Mode '(it pops up when I double-click on the Excel Source object). From there, I was able to create a query (button "Build query"), so that only the records that I need are enough. Something like this: SELECT F4, F5, F6 FROM [Spreadsheet $] WHERE (F4 IS NOT) AND (F4 <> 'TheHeaderFieldName')
Note. At first I tried ISNUMERIC instead of "IS NOT NULL", but which for some reason was not supported.
In my particular case, I was only interested in lines in which F4 was not NULL (and, fortunately, F4 did not contain any garbage in the first 5 lines). I could skip the entire title bar (line 6) with the second WHERE clause.
So, perfectly clean your data source. All I had to do was now add a data conversion object between the source and the target (everything needed to convert from unicode to table), and it worked.