ADO.NET ignores parameter names when IsQueryStoreProcedure is set to True.
I use the "Execute SQL Task" to call a stored procedure with optional parameters via ADO.NET .
The following situation occurs with all providers except System.Data.SqlClient.
for example, there is a stored procedure dbo.spCallMe @p1 = null, @p2 = null, @p3 = null
I enter in SQLStatment [dbo] .[spCallMe]
IsQueryStoredProcedure is true
In the Parameter Mapping tab, I compare only two parameters.:
var1 -> @p1 and var3 -> @p3
However!
When completing the task, the provider changes the mapping to sequential:
var1 -> @p1 and var3 -> @p2 !!
And in general, you can specify any parameter names in the mapping, and even numbers. This will work and also pass parameters according to the order in which they are defined in the stored procedure.
The parameter names are taken into account only by the provider "Net Provider\SqlClient Data Provider"
All the others ADO.NET the providers behave the same way as if I were using OleDb or sql script (IsQueryStoredProcedure is false).
Is this a bug or a feature?
Please note that in the documentation https://free.blessedness.top/en-us/sql/integration-services/control-flow/execute-sql-task?view=sql-server-ver17
There are no details about this in the "Use parameters with stored procedures" section.