Ever see this “Execute SQL Task] Error: Executing the query “XYZ” failed with the following error: “Parameter name is unrecognized.”. Possible failure reasons: Problems with the query, “ResultSet” property not set correctly, parameters not set correctly, or connection not established correctly”.
This is one of those often overlooked errors resulting from forgetting to override the ssis designer defaults. I personally have been burned by this more times then I care to admit…
The answer to this is to change the Parameter Name value in the Parameter Mapping screen from the default “NewParameterName” to the correct ordinal of your parameter.
Given the following query
SELECT theID, theName, theDescription FROM dbo.theTable WHERE theID = ?
Assuming my parameter is an integer variable named User::the_ID. Choose the following values on the Parameter Mapping Screen
Variable Name – User::the_ID
Direction – Input
Data Type – LONG
Parameter Name – 0
Parameter Size – -1
Originally the default Parameter Name will be “NewParameterName”. Simply change this to the ordinal position of your variable marker (“?”)
Bonn Appetit !