1
I am developing a project where in one of my execute sql task has a query,
select stuff((select ',' + campo from tabela FOR XML PATH(''))1,1,'') as resultado
this query returns so
| resultado |
|1,5,3,6,7,9,6,4|
and I’m putting this value inside an X variable that is the String type within my SSIS package.
by doing so he returns me the error:
[Execute SQL Task] Error: An error occurred while assigning a value to variable "X": "The type of the value (DBNull) being assigned to variable "User::X" differs from the current variable type (String). Variables may not change type during execution. Variable types are strict, except for variables of type Object.
".
[Execute SQL Task] Error: The value type (__ComObject) can only be converted to variables of type Object.
Your query returned empty for some reason. In your previous question I suggested that you rethink what you want to do in this package using other components, such as Lookup or Derived column. Maybe if you explain what exactly you want to do.
– gmsantos
There is no way to use the lookup because I am inside the Control Flow, and I have solved it now. the error was that the query did not return String, so I had to use a cast or Convert to resolve.
– OMM