Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Export to Excel

Author  Topic 

thekiwi
Starting Member

4 Posts

Posted - 2010-01-20 : 22:12:40

Hi

Have had to transfer a website from SQL2000 to SQL2008 on Windows Server 2008 (64 bit).

Been reading articles about the issues around OLEDB on a 64 bit platform.

Basically all I need to do is export some data from SQL Server into Excel via a Stored Procedure so that some reports can be EMailed from the website.

At the moment I cant find a way to do this.

With something as simple as:

select * FROM OPENROWSET (
'Microsoft.Jet.OLEDB.4.0' ,
'Excel 8.0;Database=MySheet.xls;HDR=YES' ,
'SELECT * FROM [Sheetname$' )
gives the error:

Msg 7308, Level 16, State 1, Line 3
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.

Ive tried
Microsoft.ACE.OLEDB.12.0 etc etc but no luck.

Can someone please suggest a way in which one can export some data from SQL into "some format" for Emailing.

Cheers

Craig
   

- Advertisement -