Export to Excel (64 bit)

  • 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

  • Hi,

    I am having the same issue.

    Did you find a solution to this problem?

    Please let me know.

    Thanks.

    AM

  • Here are a couple of options:

    1) Use SSRS - create a report based on the stored procedure. From there, you can export to Excel or even schedule it to run and deliver the report by email in several formats.

    2) Use SSIS - create a data flow that uses an OLEDB connection to the database and a destination of Excel.

    3) Install a 32-bit instance and use a linked server configuration to the 64-bit version.

    I know there are probably more ways to go, but those are the ones I can think of now.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply