SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Exporting to Excel Gives Strange Error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jbates99
Constraint Violating Yak Guru

385 Posts

Posted - 03/07/2013 :  19:55:07  Show Profile  Reply with Quote
Hi,
I'm using 2008 R2 and Excel 2010.

I want to export some rows to an Excel sheet. I could use an SSIS package but I wanted to do it all within a job if possible.

When I run my query, which outputs the resultset to an Excel worksheet, I get this error:

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.

Any ideas?
Thanks, Jack

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 03/07/2013 :  20:15:44  Show Profile  Visit russell's Homepage  Reply with Quote
Use SSIS and execute that via SQL Agent Job.
Go to Top of Page

jbates99
Constraint Violating Yak Guru

385 Posts

Posted - 03/07/2013 :  21:21:09  Show Profile  Reply with Quote
Well, I may have to use SSIS. But I would like to know if there is a solution to the error message.
Thanks for your reply, Russell. Jack
Go to Top of Page

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 03/08/2013 :  11:44:07  Show Profile  Visit russell's Homepage  Reply with Quote
We'd have to see your query, but the error message is pretty clear.

When you said you don't want to use SSIS because you want this in a job I assumed you didn't know you that you CAN use it in a job...in fact that's the most common way SSIS is used.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000