Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

A very strange error of Script component, my nightmare

$
0
0

Hi everyone,

I would like to get your opinions about a very strange error of Script Component in SSIS.

I use SSIS 2008.

For Example, I have: 

Column A1, A2, A3 in table A
Column B1, B2, B3 in table B
Column C1, C2, 0C3 in table C
At the beginning of Data Flow, I use Data Source as OLEDB to execute a query in which table A will join with table B and C at columns that are diferent from the columns above. And the result set returned about more than 100.000 rows.

For Example: Select A1, A2, A3 from A 
join B on A.A4=B.B4
join C on A.A4=C.C4

As we all knew, in Data Flow, data will be processed row by row, and there is a script component, inside it I process some user requirement for column A3 of table A, and format it with a new value, I wrap them by a try...catch statement.

For Example, I demonstrate this as follows:

A3="http://tuoitre.com.vn/tintucnonghoingayhomnay/chuot_de_ra_voi.html"

A3Final="tuoitre.com.vn"

In Script component, I declare a new column named A3Final andI write C# code as follows:

try{

//Process A3 from table A

Row.A3Final=Format(A3)

}

catch
{

Row.A3Final='';

}

After the Script Component above, I then created a Derived Column, I created a new column named MyNewColumn, For Example:

MyNewColumn=A1+'-'+A2+'-'+A3Final

Here is the issue. I do not understand why before data go into the script component, the row number displaying in SSIS when we run the package in Visual Studio is 100.000, but after it went through the script component with code above, the Row is 90.000. I do not know where the rest 10.000 rows go.

And when the package finished, I event more shocked when seeing many MyNewColumn values was wrong. The A3Final in MyNewColumn has been assigned a value from a rows that I do not know which row.

I then invited some colleagues in my team to see this issue, and we spent almost a day, but we could not explain why this happened. In theory with the code in SSIS, this could not be wrong, but in fact, It was wrong. I concern whether this is a bug of Scipt Component???

Please give me your idea.

Thanks,


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>