//
you're reading...
SQL Server

SSIS Execute SQL Task – “Parameter name is unrecognized”

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 !

ldix19

Advertisements

About ldgaller

Accomplished Data Warehouse Architect, DBA and Software Architect with over 15 years of professional experience and demonstrated success designing and implementing solutions that improve business functionality and productivity. Highly diverse technical background with proven ability to design, develop and implement technology on an enterprise level. I approach all projects with passion, diligence, integrity, and exceptional aptitude.

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: