| Author |
Topic |
|
jimoomba
Yak Posting Veteran
90 Posts |
Posted - 2012-03-27 : 04:40:34
|
| Hi All,Iam trying to export sql server table data to excel in the following manner :Enable Ad Hoc Distributed QueriesEXEC sp_configure 'show advanced options', 1;GORECONFIGURE;GOEXEC sp_configure 'Ad Hoc Distributed Queries', 1;GORECONFIGURE;GOAfter enabling it, we can proceed further to write the query for exporting the SQL Serer Data.Export into Excel Query:INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\test\test.xls;', 'SELECT FirstName, LastName FROM [Sheet1$]') SELECT FirstName,LastName FROM UsersGOBut iam gettying the below error. kindly help me on the same Msg 7308, Level 16, State 1, Line 1OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode. kindly help me on the same.Thanks,Ramrams |
|
|
rajarajan
Starting Member
48 Posts |
Posted - 2012-03-27 : 05:32:33
|
| Can check this http://support.microsoft.com/kb/306397/EN-US/ |
 |
|
|
jimoomba
Yak Posting Veteran
90 Posts |
Posted - 2012-03-27 : 05:44:35
|
| hi raj,thanks for the reply, but no luck yaarrams |
 |
|
|
rajarajan
Starting Member
48 Posts |
Posted - 2012-03-27 : 05:47:27
|
| wat is the error u get? did u try the link |
 |
|
|
rajarajan
Starting Member
48 Posts |
Posted - 2012-03-27 : 09:33:48
|
| Can u check u have permission to do that, basically OPENROWSET is off |
 |
|
|
jimoomba
Yak Posting Veteran
90 Posts |
Posted - 2012-03-28 : 01:54:00
|
| hi rajan,sorry for late reply. yes i have permissions for openrowset bot i think jet provider does not support x64 sql server machinesthanksrams |
 |
|
|
rajarajan
Starting Member
48 Posts |
Posted - 2012-03-28 : 02:43:43
|
| did u try with link server . once u can able to create linkserver it will work |
 |
|
|
jimoomba
Yak Posting Veteran
90 Posts |
Posted - 2012-03-28 : 03:11:13
|
| hi rajan,iam a newbie to this field. could you just help me with the query using link server. that would be so helpful for me if you could do so.Thanksrams |
 |
|
|
rajarajan
Starting Member
48 Posts |
|
|
jimoomba
Yak Posting Veteran
90 Posts |
Posted - 2012-03-28 : 05:43:39
|
| hi raj,thanks for the reply. iam getting the new error like :OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Unspecified error".Msg 7303, Level 16, State 1, Line 1Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".rams |
 |
|
|
|