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
MDX Essentials: Set and String Functions: The GENERATE() Function
In this lesson, we will introduce a function that provides us the ability to derive a set by systematically applying a set expression to each of the members of a set we define. GENERATE() is a potent function in our MDX toolset, in that it enables us to select precisely only certain members of a dimension level. It effectively operates upon two sets to create a new set, based upon the members of a second set that are also in a primary set.
2005-03-17
1,749 reads