Showing posts with label variable. Show all posts
Showing posts with label variable. Show all posts

Thursday, March 22, 2012

Error description

I want to club the ErrorDescription system variable property in OnError.

And I want to send this whole ErrorDescription variable on onTaskFailed.

Can you please suggest how to club this errordescription on OnError event

In the data flow, you can use a script component to grab the description:

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

Public Class ScriptMain
Inherits UserComponent

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
'Use the incoming error number as a parameter to GetErrorDescription
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode)
End Sub

End Class|||

What do you mean by club?

The above the script will return your error description.

|||

Leo,

It would be better to insert the error descriptions into a custom table on Onerror event with System::ExecutionInstanceGUID to assosiate/identify with the package run instance. Or enable logging for the package with SQL server provider for Onerror. Then you can query the custom table or dbo.sysdtslog90 table using System::ExecutionInstanceGUID to fetch the errors for email notification, etc.

Above suggestion assumes you are using SQL Server.

good luck.

|||

hellomahesh wrote:

Leo,

It would be better to insert the error descriptions into a custom table on Onerror event with System::ExecutionInstanceGUID to assosiate/identify with the package run instance. Or enable logging for the package with SQL server provider for Onerror. Then you can query the custom table or dbo.sysdtslog90 table using System::ExecutionInstanceGUID to fetch the errors for email notification, etc.

Above suggestion assumes you are using SQL Server.

good luck.

This sounds good, except, how do you propose he gets the errorDescription? This isn't the same as the error message.|||

but onerorr event doesn't insert one row for single error for ex"no row yeilded during lookup. It inserts multiple (atleast 6-10).

thete are some unnecessary rows as well like "

thread "WorkThread0" has exited with error code 0xC0047039

But I want to send only related error message as an email that too on OnTaskFailed.

suggestions..?