Wednesday, 28 October 2015

Import Data from excel Sheet


 EXEC sp_configure 'Show Advanced Options', 1
RECONFIGURE


EXEC sp_configure 'Ad Hoc Distributed Queries', 1
RECONFIGURE


EXEC sp_MSSet_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1


EXEC sp_MSSet_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1



USE SLBSOFTWARE

select * FROM   OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0 Xml;HDR=YES;Database=D:\DataMigrationFiles\New Data.xlsx',
'SELECT * FROM [Sheet2$]')




Please note we need to run the SSMS with Super user.



No comments:

Post a Comment

Featured post

Getting Started With SOLR

Getting Started with Solr ·           Features o    Hit highlighting o    Auto correction o    Faceted Search o    Multi lan...