How to find a dataflow task executed suceesfully or not.
Hi All,
How we can find out a Dataflow task executed successfully or not.
Basically after the dataflow i need to have a check whether dataflow task executed successfully or not.
If successfull then only I have to move with other tasks.If not I have to stop the execution there itself.
How can i do this.
Thanks, A2H
October 25th, 2010 8:08am
Hi, On failure of any task , the package will be stopped. So your aim of "stopping the execution on failure" is taken care inherently. Right click on the task and go to the advanced editor. There, you can edit the outcome of failure, ( error configuration
) . By default, package fails if the task fails. However, if what you mean is, you want to check if any rows have been inserted or not, then you can have a rowcount inside the dft, and assign the value to a variable. And in the control flow, on the task following
the DFT, define a constraint checking whether the rowcount variable > 0--Mark the thread as answered if one of the replies answers your question. Thank you
Free Windows Admin Tool Kit Click here and download it now
October 25th, 2010 8:17am
A2H,
Use
Precedence Constraints to make the flow of your package components based on Success, Failure and conditional.
While Executing the package from BIDS, you can identify it based on the color of the component, it would be Yellow while execution, Green on Success and Red on Failure.-Manivannan
October 25th, 2010 8:25am
you mean that you want to create a FLOW? (if task1 was successful go to task2 )
if yes, you should user PRECEDENCE CONSTRAINT .
just drag the green arrow from task1 to task2 . this means that if task1 done successfully control flow will go to task2.
there are other options to do flow based on precedence constraint.
you can right click on the green arrow and select Failure or Completion. you can also Edit it and set an expression for a conditional control flow.http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
October 25th, 2010 8:25am
You can use precedence constraint (by default it is configured for Success, means if the task is successfull then only the other task will be executed). At control flow connect the other task with data flow task.Nitesh Rai- Please mark the post as answered if it answers your question
October 25th, 2010 8:33am
Hi All,
My Problem is I have delete statement in Oledb Command inside the DataFlow task.
I have to check if the delete statement execute successfully or not.
Thanks, A2H
Free Windows Admin Tool Kit Click here and download it now
October 25th, 2010 8:35am
Hi All,
My Problem is I have delete statement in Oledb Command inside the DataFlow task.
I have to check if the delete statement execute successfully or not.
Thanks, A2H
if you want to catch the ROW which cause the error, you can use ERROR OUTPUT in oledb command and connect it to a flat file destination or something to save BAD rows to there.
http://www.rad.pasfu.com
October 25th, 2010 8:39am
Hi All,
How we can find out a Dataflow task executed successfully or not.
Basically after the dataflow i need to have a check whether dataflow task executed successfully or not.
If successfull then only I have to move with other tasks.If not I have to stop the execution there itself.
How can i do this.
Thanks, A2H
You can divert the flow of any task using precedence control on their success and failure.
1.You can find your succession of the task by task color turns green :) for further confirmation you can have logging.
2.Based on the success and failure of the data flow task you need to divert the package.So you need configure one more precedence from Data flow task. For example., drag precedence to any task you desired, initially the precedence will be green set to change
its property to failure.
Please see the image for the detailed information.
In case of Success
In case of failure
Free Windows Admin Tool Kit Click here and download it now
October 25th, 2010 10:19am
I would like to know what exactly you mean by "Delete statement execute successfully or not". You mean, you want to check if atleast one row has been deleted? If so, after the delete query, check if @@Rowcount > 0. If it is greater, it means
atleast 1 row has been deleted. If it is 0, then no row has been deleted.--Mark the thread as answered if one of the replies answers your question. Thank you
October 25th, 2010 12:02pm
Hi Deepak,
Basically in delete statement ,If any error occurs while deleting Mulitple records(Lets say Foreign key Constraint).I need to have rollback transaction and I have to stop the exection there itself.
Thanks, A2H
Free Windows Admin Tool Kit Click here and download it now
October 25th, 2010 12:06pm
Hi Deepak,
Basically in delete statement ,If any error occurs while deleting Mulitple records(Lets say Foreign key Constraint).I need to have rollback transaction and I have to stop the exection there itself.
Thanks, A2H
you can use transaction to do whole data flow in a transaction.
you should set TransactionOption property of data flow task to Requiredhttp://www.rad.pasfu.com
October 25th, 2010 12:28pm
Another thing you could do is put your delete query in a try catch block.
DECLARE @ErrMsg Varchar(max)
BEGIN TRY
BEGIN TRANSACTION
delete query
COMMIT
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
SET @ErrMsg = Error_Description
Raiserror(@ErrMsg) -- this will return the task failure to SSIS
END CATCH--Mark the thread as answered if one of the replies answers your question. Thank you
Free Windows Admin Tool Kit Click here and download it now
October 25th, 2010 1:09pm