I have a execute sql task in SSIS that I try to store a string value
this is the query
Declare @IdList nvarchar(max)
select @IdList = coalesce( @IdList + ''',''', '') + ID from table
Select @IdList = '''' + @IdList
Select @IdList
The result looks like
'abc','bcd','def','fds'
and I try to store this value into String variable in SSIS
result set: single row
result name: 0
Variable Name: String_Contact
this is the error I got
[Execute SQL Task] Error: The value type (__ComObject) can only be converted to variables of type Object.
[Execute SQL Task] Error: An error occurred while assigning a value to variable "String_Contact": "The type of the value (DBNull) being assigned to variable "User::String_Contact" differs from the current variable type (String). Variables may not change type during execution. Variable types are strict, except for variables of type Object.
".
Anyone know what's the issue?
thanks