<?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: The Script Transformation part 1 &#8211; a simple Transformation</title>
	<atom:link href="http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/</link>
	<description>James Beresford on Microsoft BI and Consulting in Sydney, Australia</description>
	<lastBuildDate>Mon, 06 Feb 2012 16:00:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: BI Monkey</title>
		<link>http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/comment-page-1/#comment-12090</link>
		<dc:creator>BI Monkey</dc:creator>
		<pubDate>Mon, 12 Sep 2011 09:34:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.bimonkey.com/?p=566#comment-12090</guid>
		<description>Off the top of my head, no - this may be easier in C# but I&#039;m not a great coder so I wouldn&#039;t take my word for it.</description>
		<content:encoded><![CDATA[<p>Off the top of my head, no &#8211; this may be easier in C# but I&#8217;m not a great coder so I wouldn&#8217;t take my word for it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil</title>
		<link>http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/comment-page-1/#comment-12041</link>
		<dc:creator>Phil</dc:creator>
		<pubDate>Fri, 09 Sep 2011 16:53:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.bimonkey.com/?p=566#comment-12041</guid>
		<description>Hi,

I was wondering if there was a way to reference the output columns through an array and not the variable names?

I need to assign values to output columns based on certain conditions that are met. This is all within a loop.

                        if (whatfield == 0)
                        {
                            Row.ColumnA = &quot;&quot;;
                            whatfield++;
                        }
                        else if (whatfield == 1)
                        {
                            Row.ColumnB = &quot;&quot;;
                            whatfield++;
                        }
                        else ...

As you can see this is pain staking to do for every field that comes in and can not be used in other projects without changing the names for the new project.

Is this even possible?

Thanks

Phil

I would rather do Row.ColumnArray[value] = &quot;&quot;; and just loop through the output columns.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I was wondering if there was a way to reference the output columns through an array and not the variable names?</p>
<p>I need to assign values to output columns based on certain conditions that are met. This is all within a loop.</p>
<p>                        if (whatfield == 0)<br />
                        {<br />
                            Row.ColumnA = &#8220;&#8221;;<br />
                            whatfield++;<br />
                        }<br />
                        else if (whatfield == 1)<br />
                        {<br />
                            Row.ColumnB = &#8220;&#8221;;<br />
                            whatfield++;<br />
                        }<br />
                        else &#8230;</p>
<p>As you can see this is pain staking to do for every field that comes in and can not be used in other projects without changing the names for the new project.</p>
<p>Is this even possible?</p>
<p>Thanks</p>
<p>Phil</p>
<p>I would rather do Row.ColumnArray[value] = &#8220;&#8221;; and just loop through the output columns.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BI Monkey</title>
		<link>http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/comment-page-1/#comment-11345</link>
		<dc:creator>BI Monkey</dc:creator>
		<pubDate>Fri, 12 Aug 2011 11:52:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.bimonkey.com/?p=566#comment-11345</guid>
		<description>Hi Peter

You&#039;re going to need a mix of components to achieve this result, though I&#039;m not sure SSIS is the best tool for the job - SSRS is much more suited to this. 

If you absolutely must use SSIS, you will have to :
a) Use a script component in the Control Flow to create your spreadsheet and populate the header
b) use the script component in the Data Flow to populate (but not format) the alternating rows of data
c) use another Script component in the Control Flow to apply formatting

That&#039;s pretty ugly - SSIS would not be my tool of choice here.</description>
		<content:encoded><![CDATA[<p>Hi Peter</p>
<p>You&#8217;re going to need a mix of components to achieve this result, though I&#8217;m not sure SSIS is the best tool for the job &#8211; SSRS is much more suited to this. </p>
<p>If you absolutely must use SSIS, you will have to :<br />
a) Use a script component in the Control Flow to create your spreadsheet and populate the header<br />
b) use the script component in the Data Flow to populate (but not format) the alternating rows of data<br />
c) use another Script component in the Control Flow to apply formatting</p>
<p>That&#8217;s pretty ugly &#8211; SSIS would not be my tool of choice here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/comment-page-1/#comment-11086</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Wed, 10 Aug 2011 15:52:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.bimonkey.com/?p=566#comment-11086</guid>
		<description>Hi,

I hope you could give me some ideas.
I have some experience with SSIS, but never done anything like that.

I was tasked with generating a non-standard excel export (via SSIS), something that looks more like a custom made access (or crystal) report.

First, it does not have a standard header - instead it has three header rows with some cells being blank. Most of the data in this header is static, but some will be dynamic.

Second, the actual data output would consist of 2 lines (excel rows) per each data record. The problem is that the first and the second row (of each pair) would contain different data and be formatted differently (currency vs. numeric).
 
So, it looks like I would need to generate each output row and format its cells on the fly.
Is SSIS Data Flow Transformation Script Component the right tool for this task? Could it be used to format each cell individually?

Thanks,
Peter</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I hope you could give me some ideas.<br />
I have some experience with SSIS, but never done anything like that.</p>
<p>I was tasked with generating a non-standard excel export (via SSIS), something that looks more like a custom made access (or crystal) report.</p>
<p>First, it does not have a standard header &#8211; instead it has three header rows with some cells being blank. Most of the data in this header is static, but some will be dynamic.</p>
<p>Second, the actual data output would consist of 2 lines (excel rows) per each data record. The problem is that the first and the second row (of each pair) would contain different data and be formatted differently (currency vs. numeric).</p>
<p>So, it looks like I would need to generate each output row and format its cells on the fly.<br />
Is SSIS Data Flow Transformation Script Component the right tool for this task? Could it be used to format each cell individually?</p>
<p>Thanks,<br />
Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BI Monkey</title>
		<link>http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/comment-page-1/#comment-2376</link>
		<dc:creator>BI Monkey</dc:creator>
		<pubDate>Thu, 02 Sep 2010 08:24:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.bimonkey.com/?p=566#comment-2376</guid>
		<description>That sounds very odd indeed, and not behaviour i&#039;ve ever seen. I hate to say it, but my first suspect would be the script. Some other common sense checks - is the data definitely getting into the component? Are the data sizes of the fields correct?</description>
		<content:encoded><![CDATA[<p>That sounds very odd indeed, and not behaviour i&#8217;ve ever seen. I hate to say it, but my first suspect would be the script. Some other common sense checks &#8211; is the data definitely getting into the component? Are the data sizes of the fields correct?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kate</title>
		<link>http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/comment-page-1/#comment-2370</link>
		<dc:creator>Kate</dc:creator>
		<pubDate>Wed, 01 Sep 2010 17:03:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.bimonkey.com/?p=566#comment-2370</guid>
		<description>I&#039;m hoping you can help - I have a script task to accomplish exporting a varying number of columns to a flat file.  The number of columns are returned correctly, but the data in the rows is not complete.  In most cases, the last row is truncated somewhere in one of the fields but the location isn&#039;t always the same field.  In other cases, the file ends prior to the last row from my data table so the last rows are missing and the last row that does display is truncated.  I can&#039;t find any reason or solution.  Any thoughts?</description>
		<content:encoded><![CDATA[<p>I&#8217;m hoping you can help &#8211; I have a script task to accomplish exporting a varying number of columns to a flat file.  The number of columns are returned correctly, but the data in the rows is not complete.  In most cases, the last row is truncated somewhere in one of the fields but the location isn&#8217;t always the same field.  In other cases, the file ends prior to the last row from my data table so the last rows are missing and the last row that does display is truncated.  I can&#8217;t find any reason or solution.  Any thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BI Monkey</title>
		<link>http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/comment-page-1/#comment-421</link>
		<dc:creator>BI Monkey</dc:creator>
		<pubDate>Tue, 29 Sep 2009 22:36:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.bimonkey.com/?p=566#comment-421</guid>
		<description>Hi Amarjot...  if I understand correctly you are asking if it is possible to dynamically set the number outputs on a script transform. The answer to that is no - the number of inputs / outputs is fixed at design time and cannot be changed during runtime.

If you want to handle a flat file that has a varying number of columns, your best bet is to open that file in a script task that has enough outputs to handle all possible outcomes, and use the script to populate the output columns needed.</description>
		<content:encoded><![CDATA[<p>Hi Amarjot&#8230;  if I understand correctly you are asking if it is possible to dynamically set the number outputs on a script transform. The answer to that is no &#8211; the number of inputs / outputs is fixed at design time and cannot be changed during runtime.</p>
<p>If you want to handle a flat file that has a varying number of columns, your best bet is to open that file in a script task that has enough outputs to handle all possible outcomes, and use the script to populate the output columns needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amarjot</title>
		<link>http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/comment-page-1/#comment-418</link>
		<dc:creator>Amarjot</dc:creator>
		<pubDate>Tue, 29 Sep 2009 14:15:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.bimonkey.com/?p=566#comment-418</guid>
		<description>Hi,

Thank you for the article. I want to know if there is a way we can add input columns to the script transformation task. I am working with flat files which have variable columns ranging from 50 to 250. All these columns have same data type.

I was trying to use Unpivot task but then again I have to check all the columns manually.

I will truly appreciate any help or thoughts on this.

Thanks
Amarjot</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thank you for the article. I want to know if there is a way we can add input columns to the script transformation task. I am working with flat files which have variable columns ranging from 50 to 250. All these columns have same data type.</p>
<p>I was trying to use Unpivot task but then again I have to check all the columns manually.</p>
<p>I will truly appreciate any help or thoughts on this.</p>
<p>Thanks<br />
Amarjot</p>
]]></content:encoded>
	</item>
</channel>
</rss>

