Forum Discussion
Error retrieving data from a data source with stored procedure
Hi,
Pipeline > Copy data activity > Source SQL Server > Use query = Stored procedure
(on-premises connection)
Procedure: [PBI].[sp_Rergher_HI_AZIDV_OPK_Ipaasg] (if it matters)
Procedure is made by third party
Preview data works correctly!
Error appears during pipeline Run process:
Failure happened on 'Source' side. ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed with the following error: 'Invalid object name '#AAADB_N_P'.',Source=,''Type=System.Data.SqlClient.SqlException,Message=Invalid object name '#AAADB_N_P'.,Source=.Net SqlClient Data Provider,SqlErrorNumber=208,Class=16,ErrorCode=-2146232060,State=0,Errors=[{Class=16,Number=208,State=0,Message=Invalid object name '#AAADB_N_P'.,},],'
I guess that #AAADB_N_P is a temporary table for the procedure on the server side.
What is a problem and how to solve it?
The problem is using temporary tables for the procedure. This problem is not solved.
The solution is using table variables instead of temporary tables.