I am trying to get and store in a variable a value from the E1 column in an excel sheet with an execute SQL task like this:
However I am getting the error:
Unsupported data type on result set binding 0.
I set up the variable as String.
any suggestion?
When using a normal select statement, example SELECT * From blabla
, it doesn't return a Single value (Single row may be used when using aggregate functions).
So you have to Select Full Result Set
and mapp the result to a Variable of type System.Object
.
After that add a script task, select the variable in the ReadOnly Variables, then in the script task, create a variable of type IEnumerable
and assign to it the value of the package variable:
Dim dt = Dts.Variables.Item("User::Result").Value
'Dt(0)(0) will contains the value
Or you can achieve this using a Script Task
instead of Execute SQL Task
, just check my answer here: