June 11, 2010 at 9:39 am
Hello all,
In a script component, one can access a column's value by using Row.MyColumnName. I was wondering, is there a way I can dynamically access columns at run time?
I have a check procedure which identifies columns that have dirty data and stores the name of the column in an arraylist. The action performed on the dirty data will be the same for each column I want to implement a cleaning procedure on every column stored in my arraylist. Something like:
For each ColumnName as string in myArrayList
Row.(ColumnName) = MyScrubFunction
Next
Of course the above is incorrect, but I wanted to show what I'm trying to do. Can this or something like this be done?
Thanks,
Strick
June 11, 2010 at 1:38 pm
I had looked at this in both SQL 2005 and 2008 and the column list is not enumerable in a script component without using a REALLY convoluted .Net reflection process. This causes terrible performance. Did I say terrible, I meant horrible.. You are better off writing a custom data-flow task to do this.
CEWII
June 14, 2010 at 7:16 am
If you can use third-party solutions, check the commercial CozyRoc Script Component Plus. It is an extension of the standard Script Component and you can access the list of columns at runtime. Also the extension doesn't use reflection and the performance is excellent.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply