When trying to use an input variable in my Execute SQL Task I was getting the following error:"Parameter name is unrecognized." and the package obviously failed.
After some playing around I noticed that it had something to do with the difference in variable mapping declaration based on your connection type.
Based on your connection type you have to choose the correct name in your Parameter Mapping window.
Here is a little overview (credits go to Kirk Haselden):
OLEDB takes ? in the query and a number as name (0, 1, ...)
ODBC takes ? in the query and a number as name (1, 2, ...)
ADO takes ? in the query and a @Variable as name
ADO.Net takes @Variable in both the query and the name
Also make sure to choose the correct datatype for the parameter!
Subscribe to:
Post Comments (Atom)
9 comments:
Thanks dude. You have no idea how nuts I was going trying to figure out why this wouldn't work.
I know the feeling, that's why I decided to blog it ;-)
Many many thank yous. You saved me from having throw my laptop out the window.
You're welcome Heather.
I'm glad I saved at least one person in this world from throwing his laptop out of the window :-)
thanks so much! was alomost gng to pull out my hair!
I know the feeling :-)
Thanks a lot! very helpful.
This seems to be a popular post.
Glad to be of help to all of you!
Thanks a lot. Your post is still helping people :-) Me in this case.
Post a Comment