Search code examples
sqlsql-serverssisado.netexecute-sql-task

SSIS 2017 "Execute SQL Task" fails Could not find stored procedure


I'am using SSIS with an ADO.NET connection to Azure. Within SSIS I want to execute a procedure with one input and 2 output parameters. The input parameter is a static value. The Procedure works with T-SQL within SSMS.

I setup the "Execute SQL Task" as followed

General

  • SQLStatement: METRICE_VAULT.GP_1001_GENERIC_PRE_PROCESS 2, @INSTANCE, @PROCESS_STATUS
  • IsQueryStoredProcedure: True
  • ConnectionType: ADO.NET
  • ResultSet: None
  • SQLSourceType: Direct input

Parameter Mapping enter image description here

enter image description here

When I execute the "Execute SQL Task" I received the following error

Must declare the scalar variable "@". Possible failure reason: Problem with the query, "ResultSet" property not set correctly..

Update

After adding parameters name i am receiving the following error:

Execute SQL Task] Error: Executing the query "METRICE_VAULT.GP_1001_GENERIC_PRE_PROCESS 2, @INS..." failed with the following error: "Could not find stored procedure 'METRICE_VAULT.GP_1001_GENERIC_PRE_PROCESS 2, @INSTANCE ,@PROCESS_STATUS'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.


Solution

  • Below is the way to configure your parameters and properties. Set IsQueryStoredProcedure property to True and instead of writing exec ProcName you just have to give ProcName in sqlstatment if you are using ADO.NET Connection.

    enter image description here

    enter image description here