Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Parsing an ADO result set into a comma separated string in SSIS Expand / Collapse
Author
Message
Posted Thursday, September 02, 2010 12:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Yesterday @ 6:06 AM
Points: 1, Visits: 50
Hello,
try this select (this pivots rows to one string row):
select stuff((select top 10 ',"' + code + '"' from Products order by code for XML path('')), 1, 1, '');
Post #979319
Posted Tuesday, April 09, 2013 10:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 09, 2013 11:55 AM
Points: 1, Visits: 3
Hi. I have tried to following your example posted here verbatim, however, whenever I execute my package it fails on the Execute SQL Task within the Foreach loop. I get the following error
"Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query ""SELECT '"+@[User::FileList]+","+@[User::MissingFi..." failed with the following error: "Incorrect syntax near '+'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Execute SQL Task"

What should I look for that I may have overlooked earlier?

My variables
name datatype value
sql_str String "SELECT '"+@[User::FileList]+", "+@[User::MissingFileName]+'" as FileList"
MissingFiles Object
MissingFileName String
FileList String
Post #1440447
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse