Monday, February 17, 2014

Populate varchar(max) or nvarchar(max) to SSIS string variable

How to import varchar(max) into SSIS string variable.

Database table

clip_image002

SSIS Varaibles
clip_image004

SSIS query result set object
clip_image006

The foreach loop has to have something in it otherwise the variables don’t get populated.

clip_image008

Execute SQL Task set up. There is only one record returned from the query. Make sure the the SQLStatement handles NULLs via ISNULL(xxx,'') or COALESCE(xxx,'')

clip_image010

clip_image012

Foreach loop setup.

clip_image014

clip_image016