How to redirect error records from script component task?
Hi, i am loading a text file having 18993 records. The data in the file is something like :
9991N7395,N,204039191,GLUNT,GEORGE,J,,,000025.40,-00011.49,-00011.49,,201012,S5803075,14;17,,000,,204039191A,,
so as you can see its a comma delimited file. now i have created a package that loads the data from text to sql and i am using a derived column, script componet task in data flow. when i execute my package, the script component task turns red but it
loads 16990 records. Now, i dont understand how do i find out which records are not getting loaded coz i cant go through each record in text file. So i am wondering how do i redirect the rows from the script component task? coz i didnt see anything in
there. I was also thinking to match the records from text and from sql.
Thanks
June 24th, 2011 5:11pm
you can add another output for script component , name it as BadDataOutput, then add columns as you need under it,
in the script component code, you can use try-catch structure and in the catch fill the BadDataOutput row with current data row.
then you can connect the BadDataOutput from script component to a flat file destination to find out and troubleshoot error.http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
June 24th, 2011 5:16pm
With a script component, I wouldn't bother trying to redirect error rows. I'd use Try-Catch as Reza suggests, but use ComponentMetaData.FireError calls to report why the script had an error.
Talk to me now on
June 24th, 2011 5:53pm
Hi Reza, Thanks for your reply. Do you have any example on this?
Free Windows Admin Tool Kit Click here and download it now
June 24th, 2011 9:21pm
Here is an example of how to create an extra output column and redirect rows to it:
http://microsoft-ssis.blogspot.com/2010/12/conditional-multicast-script.html
And here is an example of a try catch and firing events:
http://microsoft-ssis.blogspot.com/2011/02/script-task-and-component-logging.html
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
June 25th, 2011 2:05am
Please check this :
http://deepaksqlmsbusinessintelligence.blogspot.com/2011/06/how-to-redirect-rows-based-on-condition.htmlhttp://deepaksqlmsbusinessintelligence.blogspot.com/ Happy to help! Thanks. Regards and good Wishes, Deepak.
Free Windows Admin Tool Kit Click here and download it now
June 25th, 2011 4:35am