Solved

How to use scripting component  as transformation in SSIS

Posted on 2016-10-17
2
43 Views
Last Modified: 2016-10-27
Hi Guys,
I want to perform some operations for each record from the source and then do some operations in scripting component. I also want to catch the error and save the error in a log table and if no error then insert record in destination table.

Is there any tutorial on this?  I need a starting point though, I assume there would be some sort of variables i would need to use?

regards
0
Comment
Question by:shah36
2 Comments
 
LVL 14

Accepted Solution

by:
Megan Brooks earned 500 total points
ID: 41859616
It sounds like you want to use implement a transformation where the data is processed row by row but which can, in effect, provide an error output if internal processing fails.

You can implement more than one output on the transformation, and send "good" rows to one output and "bad" rows to the other. This assumes that your code can trap any execution errors internally, which should be straightforward to do using ordinary error handling.

It has been a few years since I have written one of these but I believe you can use a synchronous transformation with multiple outputs and exclusion groups to do what you want to do.

The DirectToRow method, called within your script, lets you select the output to use for each input row, and you would use it to send to one output on success and another on failure. The two types of insert can then be performed in downstream components, one on each output. Exclusion groups are the key to, in effect, "branching" within the data flow following execution of the script component.

Have a look at the above link (select the version of SSIS that you are using) and see if that is what you are looking for, given the approach that I suggested above.
0
 

Author Closing Comment

by:shah36
ID: 41861870
Thank you so much for your help. Yes that's what i needed.

Regards,

Ali
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes, you need to use PIVOT in SSIS to ensure your data matches the output requirements of your users. So, what is PIVOT and what is SSIS and how can that help ? Firstly a quick explanation of those acronyms as described by Microsoft :   M…
This is my first ever Article on EE or elsewhere; therefore, please bear with me if I have some discrepancies in my writing. I read many articles and questions related to "how to pass values to SSIS packages at run-time?"  Hence, this common ques…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question