Home
Manage Your Code
Snippet: READ EXCELL (SQL)
Title: READ EXCELL Language: SQL
Description: Read Excell file into Sql Server Views: 389
Author: elameen elsayed Date Added: 10/5/2011
Copy Code  
EXECUTE sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
GO

EXECUTE sp_configure 'Ad Hoc Distributed Queries', '1'
RECONFIGURE WITH OVERRIDE
GO

EXECUTE sp_configure 'show advanced options', 0
RECONFIGURE WITH OVERRIDE
GO
--insert into tbAll
SELECT *
FROM
OPENROWSET
('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=C:\Documents and Settings\administrator\Desktop\MRG1.xlsx;Extended Properties=Excel 12.0 XML;HDR=YES',
'SELECT * FROM [Sheet1$]')
--load 2008