Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i use Parameter Mapping in Execute SQL Task in SSIS?

I am trying to retrieve the value of Key from a table with a simple select statement in SSIS through Execute SQL Task. But have no luck figuring out this error.

I have used one input variable with string data type and used this variable in parameter mapping in Execute SQL Task.

Executing the query "SELECT cast([Key] as Int) FROM Table where column = ?" failed with the following error: "An error occurred while extracting the result into a variable of type (DBTYPE_I4)". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Note : Datatype for Key column is tinyint

like image 880
David Avatar asked Dec 04 '22 03:12

David


1 Answers

This message occurs when the default datatype for the parameters remains as 'LONG' instead of whatever is necessary... In your case, this should be 'BYTE'

parameter mapping

like image 151
Michael K Avatar answered Dec 23 '22 16:12

Michael K