how to assign Varchar(max) to string variable by using Execute Sql Task in SSIS
DECLARE @Col1List VARCHAR(MAX)
SELECT
@Col1List = ISNULL(@Col1List,'')
+
''''
+
LTRIM(RTRIM(Col1))
+
''''
+
','
FROM
MY_COL1_TABLE
SELECT
LTRIM(RTRIM(LEFT(@Col1List,LEN(@Col1List)-1)))
Ref:http://social.msdn.microsoft.com/Forums/en/transactsql/thread/ecd5c16f-2878-40ed-8d1b-91f3cb77b107
how to assign Col1List value to string variable in ssis using Execute Sql Task
ilikemicrosoft