简体   繁体   中英

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在此处输入图片说明

在此处输入图片说明

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.

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.

在此处输入图片说明

在此处输入图片说明

Since you are using ADO.NET You must specify the parameter name. As example:

METRICE_VAULT.GP_1001_GENERIC_PRE_PROCESS 2,@param1, @param2

And don't use parameter index in parameter mapping tab as shown in the screenshot.

Additional Information

You can refer to the following official documentation for more details and examples:

Update 1

Try using a fully qualified name:

<database name>.<schema name>.<stored procedure name> 

Or add a USE <database> command before the stored procedure execution.

将参数的方向更改为 INPUT。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM