Thursday, 21 June 2012

Query Excel data from Sql server

1. Download drivers and install in Sql server

select * from
'Excel 12.0;Database=D:\temp\temp.xlsx;',
'SELECT * FROM [Sheet1$]')
3. if user is not sysadmin, locate the provider in following registry path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Providers\

and add 
Value name: DisallowAdHocAccess
   Data type:  REG_DWORD
   Radix:      Hex
   Value: 0

No comments:

Post a Comment