I am saving my query results into a table my_table
in SQL server 2008 and then want to insert the data from the table into an excel 2007 file. Below is the query I am using-
INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\testing.xls;',
'SELECT Name, Date FROM [Sheet1$]')
SELECT a, b FROM my_table
GO
It is showing following error
Msg 7308, Level 16, State 1, Line 1
OLE 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.
How can I get this fixed? P.S. Ad Hoc Distributed Queries seem to be enabled on my system.