Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
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.


Total article views: 2465 | Views in the last 30 days: 5
Related Articles

Get Error Description in SQL Server 2000

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


Storing Error Description in a Table

Storing Error Description in a Table


Error description not shown in Event Viewer

Error description not shown in Event Viewer


No error description after job failure

No error description after job failure


SQLDMO - No Error Description

No error description information after SQL 2005 SP3 Installation


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones