Solved

How to use scripting component  as transformation in SSIS

Posted on 2016-10-17
2
52 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 15

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

729 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