all groups > sql server dts > july 2005 >
You're in the

sql server dts

group:

SSIS - Column Iteration in Script Component



Re: SSIS - Column Iteration in Script Component Allan Mitchell
7/30/2005 12:00:00 AM
sql server dts: When you say iterate? and what do you mean by a recordset row?

You can loop over a recordset in the Control Flow.

You can attach a source to the Script component, have it ast as a transform
and you can perform operations on the row.

What exactly do you want to do as there may be better ways to do it then
that script component.


--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


[quoted text, click to view]

SSIS - Column Iteration in Script Component Gary Michaels
7/30/2005 7:44:03 AM
Is it possible to iterate through the columns (or fields) in a recordset row
using the script component? I am working with a table that has over 50
columns of similar type data fields and need to perform some calculations on
Re: SSIS - Column Iteration in Script Component Gary Michaels
7/30/2005 11:32:02 AM
Currently we are looping through the rows in the script component from a sql
table as the source. Some of the columns are modified as we move through the
transformation, basically unpivoting the data (using the unpivot control
works but some things still require some code).
Because there are so many columns (e.g., Interval_1, Inteval_2,....,
Interval50) it would be great if we could refer to the fields as
row(colno).value instead of row.Interval_1. I looked around and found some
examples using the pipeline buffer but we couldn't get it to work. Of course
part of the problem is that we can't figure out how to do line-by-line
debugging yet.

Does this make any sense yet?




[quoted text, click to view]
Re: SSIS - Column Iteration in Script Component Gary Michaels
7/30/2005 1:48:02 PM
Thanks. But what about the line-by-line debugging of the script component?


[quoted text, click to view]
Re: SSIS - Column Iteration in Script Component Allan Mitchell
7/30/2005 8:43:36 PM
I have to say that I have never used an ordinal number for columns simply
because although in DTS it was faster, it was always prone to being
invlidated and if you can do the ordinal number thing in SSIS I would
imagine it suffers the same fate.


--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


[quoted text, click to view]

Re: SSIS - Column Iteration in Script Component Allan Mitchell
7/30/2005 10:28:12 PM
Debugging the Script component as a transform is not currently possible. it
will allow you to set a breakpoint but when the Data Floe task runs the
breakpoint is silently removed. I have asked MS to make this more apprent
and less silent.



--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


[quoted text, click to view]

Re: SSIS - Column Iteration in Script Component Darren Green
8/1/2005 8:59:55 AM
Log it on MSDN Product Feedback.. The pre-generated code does not allow
this, but it would be a simple change to include an Item indexer. In fact it
is there, but not exposed, and you cannot edit the generated code to fix it,
although this would probably be a bad idea since it would get overwritten.


[quoted text, click to view]

RE: SSIS - Column Iteration in Script Component David Hassell
9/17/2007 6:24:03 AM
I have a similar issue, I have 26 columns in the input buffer and based on
some conditions I need to copy the data from the input0buffer to an
output1buffer. I would like to be able to loop through the input buffer with
a for loop similar to what would be used in ado "for i = 0 to rs.fields.count
-1" etc. to copy them instead I am currently doing the outrow.addrow() :
outrow.field = inrow.field.

I am very new to .Net and though I may be wrong it seems a huge miss to me.


[quoted text, click to view]
AddThis Social Bookmark Button