Monday, May 4, 2009

FAQ : How to import MS Excel 2007 data to SQL Server

Import data from Office 2007 Excel to SQL Server

SELECT * INTO YourTableName FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=C:\YourExcelfilename.xlsx', [Sheet1$])

Import data from Office 2003 Excel to SQL Server

SELECT * INTO YourTableName
FROM OPENROWSET ('Microsoft.Jet.OLEDB.4.0','Excel 8.0; Database=c:\bb.xls',
'SELECT * FROM [Sheet1$]') AS XL

No comments:

 
Locations of visitors to this page