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.
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.