Conrad Jagger
Conrad Jagger

Reputation: 91

How do I handle exceptions thrown from VB.NET class library within SSIS package?

We are using a library created in VB.NET in SSIS - Script Task to carry out various database related activities.

How do I force the SSIS package to fail when the VB.NET class library invoke from within the package throws an exception?

Upvotes: 0

Views: 783

Answers (1)

milivojeviCH
milivojeviCH

Reputation: 1608

http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/4ca66ffa-0005-40fe-96aa-58b1959a8120/

"Depending on how you have the rest of your package configured, you have the following options (maybe more):

  1. Return failure using (C#) Dts.TaskResult = (int)ScriptResults.Failure;, or (VB.Net) Dts.TaskResult = CInt(ScriptResults.Failure)
  2. Throw an error with (C#) throw new Exception(), or (VB.Net) Throw (New Exception())

Option 1 requires that the rest of your components be connected to the Script via a Success precedence constraint."

Upvotes: 2

Related Questions