Buenos días señores, al ejecutar un sp creado para crear un .xls y llenarlo de datos de una consulta, me da el siguiente error:
Mens 7308, Nivel 16, Estado 1, Procedimiento MiSPexcel, Línea 13
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.


El sp es el siguiente:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER PROCEDURE [dbo].[MiSPexcel]
--@operacion varchar(25)
AS
declare @YaDia nvarchar (10)


set @YaDia=convert(nvarchar(4),datepart(year, getdate())) + '/' + convert(nvarchar(2),datepart(month, getdate())) + '/' + convert(nvarchar(2),
datepart(day, getdate()))


insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\testing.xls;', 'SELECT FECHA FROM [SheetName$]') select FECHA from tabla1
where (len(tabla1.ORIGEN)>0 or LEN(tabla1.DESTINO)>0) and tabla1.FECHA>=@YaDia
Like it on Facebook, +1 on Google, Tweet it or share this topic on other bookmarking websites.
You do not have permissions to reply to this topic.
Powered by CjForum