SQL Server – Stored Procedure in SSIS Lookup Transformation Editor

sql serversql-server-2008-r2ssis

Can you use a stored procedure as the source for Lookup Transaction because it seems to fail on the EXEC statement?

Best Answer

I would suggest trying to put the stored procedure logic into a view or table-valued function, which could then be referenced in the lookup.

If that can't be done, then you can use the ugly workaround you already discovered:

SELECT * FROM OPENQUERY(LoopBackServer, N'EXEC db.dbo.procedurename;');