SSIS Excel to SQL import — First 6 rows of the file contains header-related information

爷,独闯天下 提交于 2019-12-02 00:12:06

You can set OpenRowset property of Excel Data Source (Properties window, OpenRowset in Custom Properties section) to value similar to Sheet1$a6:j, where a is first column with your data, j is last column with data and 6 is usually row with header just before data. Data should start in next row. You can also set last row to be read by setting value similar to Sheet1$a6:j20.
Note that first given row is sometimes treated as header row and sometimes as first row with data. For example with excel:


when I set OpenRowset to Sheet1$a3:j third row is treated as header row:


but when I set OpenRowset to Sheet1$a3:j8 this row is treated as first data row:


Strange.
Venaikat

try this ,

Instead of using SSIS yuou can use OPENROWSET function in sql server, the below query execute step by step, because we need to set all the required options to be correct in sql server , before using OPENROWSET function,

--execute step by step to process excel data into sqlserver using OPENROWSET/OPENDATASOURCE
sp_configure
sp_configure 'show advanced options',1
reconfigure
sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
SELECT * INTO XLImport8 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\StatusReport.xls', 'SELECT * FROM [Sheet1$]')
select * from XLImport8 

Thanks,

Venkat.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!