Introduction:
In this article we are going to import excel data into sql server table using linked servers and distributed queries.
Main:
Linked Server:
You can easily configure excel workbook as linked server.For further more information Click Here,
SELECT * INTO XLImport FROM OPENQUERY(LINK, 'SELECT * FROM [Table1$]') |
Distributed Queries:
SELECT * INTO XLImport FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Table1$]') |
Conclusion:
Hope this helps,
Happy coding.