Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Report DTS Error Code and Description

By philcart,

This stored procedure extract the error code and description form the DTS package log tables in the msdb database.

You just pass it the package name, step name and the time that the step started ( because you could end up with many entries in the log ) and it will return the Error Code and the Error Description.

Sample of output,
ErrCode    ErrDesc                              
---------- -------------------------------------------------
0x8004043B Step Error Source: Microsoft Data Transformation Services (DTS) Package
Step Error Description:The task reported failure on execution. (Microsoft OLE DB Provider for SQL Server (80040e14): INSERT failed because the following SET options have incorrect settings: 'ARITHABORT'.)
Step Error code: 8004043B
Step Error Help File:sqldts80.hlp
Step Error Help Context ID:1100

I use this procedure in the on completion action for each step in a DTS package that does many parrallel data loads. Then I log the returned error and description to a table which is checked at the end of the package.

It uses a function called udf_varBinary2Hex, which is included. This is my conversion of the sp_hexadecimal procedure listed in the "OLE Automation Return Codes and Error Information" topic in books online.

Comment and questions welcome.

Phill

Total article views: 2470 | Views in the last 30 days: 3
 
Related Articles
ARTICLE

Get Error Description in SQL Server 2000

How to Extract Error Description in SQL Server 2000 based on Error Number

FORUM

Storing Error Description in a Table

Storing Error Description in a Table

FORUM

Error description not shown in Event Viewer

Error description not shown in Event Viewer

FORUM

No error description after job failure

No error description after job failure

FORUM

SQLDMO - No Error Description

No error description information after SQL 2005 SP3 Installation

Tags
 
Contribute