<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: SSIS Variables Do Not Like Varchar(MAX)</title>
	<atom:link href="http://blog.boxedbits.com/archives/6/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.boxedbits.com/archives/6</link>
	<description>( ... more specifically about BI with Microsoft products )</description>
	<lastBuildDate>Wed, 01 Feb 2012 21:00:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gibson</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-3587</link>
		<dc:creator>Gibson</dc:creator>
		<pubDate>Tue, 23 Aug 2011 20:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-3587</guid>
		<description>I just attempted this with an ADO.Net connection instead of OLEDB and the results were no different.  It still fails with ADO.Net.</description>
		<content:encoded><![CDATA[<p>I just attempted this with an ADO.Net connection instead of OLEDB and the results were no different.  It still fails with ADO.Net.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johnny</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-3578</link>
		<dc:creator>Johnny</dc:creator>
		<pubDate>Fri, 29 Jul 2011 10:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-3578</guid>
		<description>SOLUTION: 

This is a limitation of OLEDB.
Use ADO.net connection rather than OLEDB connection.</description>
		<content:encoded><![CDATA[<p>SOLUTION: </p>
<p>This is a limitation of OLEDB.<br />
Use ADO.net connection rather than OLEDB connection.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhi</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-3571</link>
		<dc:creator>Abhi</dc:creator>
		<pubDate>Mon, 04 Apr 2011 06:22:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-3571</guid>
		<description>I want to print more than 8000 character in my store procedure so i am using varchar(max) instead of varchar(8000). But still it is showing only 8000 characters. Please help me how to get all characters.</description>
		<content:encoded><![CDATA[<p>I want to print more than 8000 character in my store procedure so i am using varchar(max) instead of varchar(8000). But still it is showing only 8000 characters. Please help me how to get all characters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SSIS and the limit of 8000 chars in a string variable &#124; BI-Bloggers</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-3495</link>
		<dc:creator>SSIS and the limit of 8000 chars in a string variable &#124; BI-Bloggers</dc:creator>
		<pubDate>Sun, 26 Sep 2010 17:35:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-3495</guid>
		<description>[...] then found this blog entry http://blog.boxedbits.com/archives/6 (Langstons&#8217;s answer) which led to a working solution although it is more a [...]</description>
		<content:encoded><![CDATA[<p>[...] then found this blog entry <a href="http://blog.boxedbits.com/archives/6 (Langstons&#8217;s" rel="nofollow">http://blog.boxedbits.com/archives/6 (Langstons&#8217;s</a> answer) which led to a working solution although it is more a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-3370</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Wed, 03 Feb 2010 10:52:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-3370</guid>
		<description>Actually, I am trying to do just that with a 600 char varchar (from a varchar(1000) field) string, and it is failing.

The SQL-string is loading well in the Object Variable, together with some ID fields. When I display the Object contents the string is shown complete and correct. The next step is to loop through the rows in the Object variable. There, each row is read and fed to separate variables. This step is not working, the foreach loop can&#039;t seem to read the long string properly, and when I MsgBox the variable it just shows a blank.

Jamies blog posts are no longer available either (I saved hyperlinks instead of downloading the pages...).

Any ideas ?</description>
		<content:encoded><![CDATA[<p>Actually, I am trying to do just that with a 600 char varchar (from a varchar(1000) field) string, and it is failing.</p>
<p>The SQL-string is loading well in the Object Variable, together with some ID fields. When I display the Object contents the string is shown complete and correct. The next step is to loop through the rows in the Object variable. There, each row is read and fed to separate variables. This step is not working, the foreach loop can&#8217;t seem to read the long string properly, and when I MsgBox the variable it just shows a blank.</p>
<p>Jamies blog posts are no longer available either (I saved hyperlinks instead of downloading the pages&#8230;).</p>
<p>Any ideas ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Langston</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-3143</link>
		<dc:creator>Langston</dc:creator>
		<pubDate>Wed, 08 Jul 2009 18:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-3143</guid>
		<description>.ToString() doesn&#039;t work. See my post below for a solution.</description>
		<content:encoded><![CDATA[<p>.ToString() doesn&#8217;t work. See my post below for a solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Langston</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-3142</link>
		<dc:creator>Langston</dc:creator>
		<pubDate>Wed, 08 Jul 2009 18:25:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-3142</guid>
		<description>See my post below for solution.</description>
		<content:encoded><![CDATA[<p>See my post below for solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Langston</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-3141</link>
		<dc:creator>Langston</dc:creator>
		<pubDate>Wed, 08 Jul 2009 18:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-3141</guid>
		<description>@Tom VdP: You have to assign it to an Object variable because the string variable will not accept varchar(max) result sets. I found that the .ToString() method doesn&#039;t work after you save the result set to an SSIS object variable. All that does is return the data type, not the value of the string itself.

@Tom VdP: Rather than use a script task to execute the SQL, which is more extensive to code and less modular, I found a simpler approach.

To All,
Basically, you have to use a ForEach Loop to &quot;shred&quot; the object variable saved from the SQL Task. See here for details on how to do that (credit Jamie Thompson - SSIS guru): http://blogs.conchango.com/jamiethomson/archive/2005/07/04/SSIS-Nugget_3A00_-Execute-SQL-Task-into-an-object-variable-_2D00_-Shred-it-with-a-Foreach-loop.aspx

Once you have your varchar(max) results saved to the Object variable, you loop through it, which in some cases will be only once if all you needed was a single string value in the first place. In the loop&#039;s variable mappings, you map the results from the object variable to an SSIS string variable, and VIOLA! The string value from your varchar(max) result set is now saved to an SSIS string variable.

The strange part is that I do not know why the ForEach loop properly stores the string value of the varchar(max) result set to an SSIS string variable, but you cannot do it in a script task. But hey, this works, so I aint complaining. BTW, this workaround is confirmed in SSIS 2008, although I cannot imagine it would not work in 2005.</description>
		<content:encoded><![CDATA[<p>@Tom VdP: You have to assign it to an Object variable because the string variable will not accept varchar(max) result sets. I found that the .ToString() method doesn&#8217;t work after you save the result set to an SSIS object variable. All that does is return the data type, not the value of the string itself.</p>
<p>@Tom VdP: Rather than use a script task to execute the SQL, which is more extensive to code and less modular, I found a simpler approach.</p>
<p>To All,<br />
Basically, you have to use a ForEach Loop to &#8220;shred&#8221; the object variable saved from the SQL Task. See here for details on how to do that (credit Jamie Thompson &#8211; SSIS guru): <a href="http://blogs.conchango.com/jamiethomson/archive/2005/07/04/SSIS-Nugget_3A00_-Execute-SQL-Task-into-an-object-variable-_2D00_-Shred-it-with-a-Foreach-loop.aspx" rel="nofollow">http://blogs.conchango.com/jamiethomson/archive/2005/07/04/SSIS-Nugget_3A00_-Execute-SQL-Task-into-an-object-variable-_2D00_-Shred-it-with-a-Foreach-loop.aspx</a></p>
<p>Once you have your varchar(max) results saved to the Object variable, you loop through it, which in some cases will be only once if all you needed was a single string value in the first place. In the loop&#8217;s variable mappings, you map the results from the object variable to an SSIS string variable, and VIOLA! The string value from your varchar(max) result set is now saved to an SSIS string variable.</p>
<p>The strange part is that I do not know why the ForEach loop properly stores the string value of the varchar(max) result set to an SSIS string variable, but you cannot do it in a script task. But hey, this works, so I aint complaining. BTW, this workaround is confirmed in SSIS 2008, although I cannot imagine it would not work in 2005.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom VdP</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-2752</link>
		<dc:creator>Tom VdP</dc:creator>
		<pubDate>Wed, 11 Mar 2009 19:45:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-2752</guid>
		<description>Valentin, are you sure you need an Object variable ?  Anyway, try the .ToString() method, that should do it, I would say.</description>
		<content:encoded><![CDATA[<p>Valentin, are you sure you need an Object variable ?  Anyway, try the .ToString() method, that should do it, I would say.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom VdP</title>
		<link>http://blog.boxedbits.com/archives/6/comment-page-1#comment-2751</link>
		<dc:creator>Tom VdP</dc:creator>
		<pubDate>Wed, 11 Mar 2009 19:43:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.boxedbits.com/archives/6#comment-2751</guid>
		<description>Indeed, the SSIS Exec SQL Task is too limited.  We ran into this limitation too and worked around it by using a Script Task to execute the SQL.  Strings in the Script Tasks are not limited to that silly 8000 characters limit.</description>
		<content:encoded><![CDATA[<p>Indeed, the SSIS Exec SQL Task is too limited.  We ran into this limitation too and worked around it by using a Script Task to execute the SQL.  Strings in the Script Tasks are not limited to that silly 8000 characters limit.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

