﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Garima Sharma  / Parsing an ADO result set into a comma separated string in SSIS / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 17:17:00 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>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 variablesname                datatype   valuesql_str              String       "SELECT '"+@[User::FileList]+", "+@[User::MissingFileName]+'" as FileList"MissingFiles        Object             MissingFileName  String              FileList              String</description><pubDate>Tue, 09 Apr 2013 10:08:41 GMT</pubDate><dc:creator>stephen.bray</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>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, '');</description><pubDate>Thu, 02 Sep 2010 00:53:39 GMT</pubDate><dc:creator>petr.novak</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>[quote][b]sknox (9/1/2010)[/b]hr_sn, I expect we'll see your article on how to do this in T-SQL soon? :-P[/quote]There's already so many article available to create CSV using SQL and IMO no need of one more, you just need to use search on this site. </description><pubDate>Wed, 01 Sep 2010 18:53:43 GMT</pubDate><dc:creator>hr_sn</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>[quote][b]Jeff Moden (9/1/2010)[/b][hr][quote][b]sknox (9/1/2010)[/b][hr].... your explanation as to why you did this in SSIS is a great example of how "best" practices sometimes are NOT the best solution for a particular business need.[/quote]By no stretch of the imagination is the way this task was accomplished in the article the "best" way to do this even for "particular" business needs.  I also state that "Business needs" should never stipulate "how" within the realm of data processing once the data is inside the server with the possible exception of what is required security wise.Further, what business needs?  The author simply stated "I recently had a need to build a package... " and that's quite far from anything known as a "particular business need".[/quote]Hiya Jeff,I hate to speak for someone else but I think what skonx may have referenced as my business need was based on my first reply. One thing that I do agree with is that this isn't necessarily the "Best" solution but as I mentioned at the start of my article, "I wanted to see if there were other ways to do simple programming using simple SSIS control flow components". This was more of an exploratory mission aiming to see what kind of fun things we can do with SSIS. It was a fun exercise that I thought was worth sharing.  :-)Cheers,Garima</description><pubDate>Wed, 01 Sep 2010 13:53:54 GMT</pubDate><dc:creator>Garima Sharma</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>[quote][b]sknox (9/1/2010)[/b][hr].... your explanation as to why you did this in SSIS is a great example of how "best" practices sometimes are NOT the best solution for a particular business need.[/quote]By no stretch of the imagination is the way this task was accomplished in the article the "best" way to do this even for "particular" business needs.  I also state that "Business needs" should never stipulate "how" within the realm of data processing once the data is inside the server with the possible exception of what is required security wise.Further, what business needs?  The author simply stated "I recently had a need to build a package... " and that's quite far from anything known as a "particular business need".</description><pubDate>Wed, 01 Sep 2010 13:33:04 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>Nice article and i would use the same technique in a DW environments when i have to pull information from different sources. But would be curious to see alternate methods to accomplish this, if any.Thanks,</description><pubDate>Wed, 01 Sep 2010 11:50:03 GMT</pubDate><dc:creator>AmolNaik</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>[quote][b]Jeff Moden (9/1/2010)[/b][hr]I'm a bit torn on this one...The article is nicely written with good clear graphics examples but I just wouldn't do this task this way.  On the other hand, if you look deeper, there are some decent techniques shown that could be used for other things in the future.[/quote]I agree.</description><pubDate>Wed, 01 Sep 2010 07:33:04 GMT</pubDate><dc:creator>Alvin Ramard</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>This is a good article, and your explanation as to why you did this in SSIS is a great example of how "best" practices sometimes are NOT the best solution for a particular business need.hr_sn, I expect we'll see your article on how to do this in T-SQL soon? :-P</description><pubDate>Wed, 01 Sep 2010 07:23:11 GMT</pubDate><dc:creator>sknox</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>Hi There,The reason we wanted to do this in SSIS was because we pull data from a lot of various sources in our data warehouse and instead of relying on SQL logic which could have varied by database server or version, I wanted to do this on our ETL side of things. Thanks!Garimahttp://edw.northwestern.edu</description><pubDate>Wed, 01 Sep 2010 06:54:24 GMT</pubDate><dc:creator>Garima Sharma</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>I'm a bit torn on this one...The article is nicely written with good clear graphics examples but I just wouldn't do this task this way.  On the other hand, if you look deeper, there are some decent techniques shown that could be used for other things in the future.</description><pubDate>Wed, 01 Sep 2010 06:41:58 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>I would rather build the CSV using SQL at first place</description><pubDate>Wed, 01 Sep 2010 00:53:05 GMT</pubDate><dc:creator>hr_sn</dc:creator></item><item><title>Parsing an ADO result set into a comma separated string in SSIS</title><link>http://www.sqlservercentral.com/Forums/Topic978505-2779-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/SSIS/70875/"&gt;Parsing an ADO result set into a comma separated string in SSIS&lt;/A&gt;[/B]</description><pubDate>Wed, 01 Sep 2010 00:05:42 GMT</pubDate><dc:creator>Garima Sharma</dc:creator></item></channel></rss>