Forum Discussion

JānisB's avatar
JānisB
Frequent Visitor
1 year ago
Solved

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.

6 Replies

  • Rename your stored procedure to something less fancy, like 'AAADB-N-P'

    • JānisB's avatar
      JānisB
      Frequent Visitor

      'AAADB_N_P' is not the name of a procedure.

      I guess that #AAADB_N_P is the name of a temporary table for the procedure.

      Procedure: [PBI].[sp_Rergher_HI_AZIDV_OPK_Ipaasg]

      Procedure is made by a third party

      • lbendlin's avatar
        lbendlin
        Super User

        Try running this with a SP in the default schema.

  • JānisB's avatar
    JānisB
    Frequent Visitor

    The problem is using temporary tables for the procedure. This problem is not solved.

     

    The solution is using table variables instead of temporary tables.