sql - Assign String variable in SSIS -
sql - Assign String variable in SSIS -
i have execute sql task in ssis seek store string value
this query
declare @idlist nvarchar(max) select @idlist = coalesce( @idlist + ''',''', '') + id table select @idlist = '''' + @idlist select @idlist
the result looks
'abc','bcd','def','fds'
and seek store value string variable in ssis
result set: single row result name: 0 variable name: string_contact
this error got
[execute sql task] error: value type (__comobject) can converted variables of type object. [execute sql task] error: error occurred while assigning value variable "string_contact": "the type of value (dbnull) beingness assigned variable "user::string_contact" differs current variable type (string). variables may not alter type during execution. variable types strict, except variables of type object.
".
anyone know what's issue?
thanks
try alter info type of variable string object.
if assign varchar(max) string [ssis] variable. there might chance of overflow error since strings in ssis limited 8000 chars in length.
but can assign nvarchar(max) object.
you can process object using each loop container setting enumerator "for each ado enumerator" or script task
datatable dt = new datatable(); oledbdataadapter oleda = new oledbdataadapter(); oleda.fill(dt, dts.variables["user::variable"].value);
use dt regular datatable.
resources:
how read object type variable in script task
using ssis object variable result set enumerator
execute sql task object variable - shred foreach loop
mapping total resultset execute sql task object variable
to utilize variable in sqlstatement property follow this thread.
sql ssis
Comments
Post a Comment