[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to use scripting component  as transformation in SSIS

Posted on 2016-10-17
2
Medium Priority
?
72 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
Megan Brooks earned 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

In couple weeks ago, I encountered an extremely difficult problem while deploying 2008 SSIS packages to a new environment (SQL Server 2014 standard).  My scenario is: We have one C# application that is calling 2008R2 SSIS packages to load text fi…
My client has a dictionary table. They're defining a list of standard naming convention. Now, they are requiring my team to provide us a mechanism how to match new incoming data with existing data in their system.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

650 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