Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 SSIS Task Failure

Author  Topic 

Haarish
Starting Member

30 Posts

Posted - 2009-07-03 : 06:05:12
Hi All,

I have created a task where I do a Lookup of the column values from a Flat file Source with a table. I have re-directed the unmatched values to the Lookup's Error Output. I have added two Row Count tasks, one before and one after the Lookup task. If the numbers are not the same then fail the task. But I can't figure how to direct the task to fail.

My code is like
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
'
' Add your code here
'
'compare the rows in both the input files
If (Variables.Va1 <> Variables.Var2) Then
'This is where I need the task to fail!
End If
End Sub

Can you tell me how to do this?

Thanks,
Haarish.

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-07-03 : 06:32:09
is there nothing like raiserror equivelent in vb.net to force the error
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-07-03 : 09:09:21
Try this statement:
Dts.TaskResult = ScriptResults.Failure

Fred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Haarish
Starting Member

30 Posts

Posted - 2009-07-06 : 00:50:53
Thank you guys, managed to raise an event and stopped the package on failure!
Go to Top of Page
   

- Advertisement -