dbTalk Databases Forums  

Error Handling in DTS package

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Error Handling in DTS package in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jackso95@hotmail.com
 
Posts: n/a

Default Error Handling in DTS package - 09-04-2006 , 05:44 PM






- Sql Server 2000 DTS
- Enabled Multi-phase datapump
- Dell Dual processor 1.2 GHZ w/ 1GB ram

Objective:
I am trying to do some error trapping in DTS so that if an error
occurrs, it will log the error and continue on. I am using an ActiveX
object to do the transformation.
I have set the "Max Error" to 9999 and the batch size to 1 so it will
post what it can and continue on. (Wonder if there is a better way to
this, it runs very slow....?). However, I would like a log of the
records that errored out.

As a test, I am writing a record to the table that I know will violate
the Primaary Key constraint. The error is logged to the specified
error file. However, it fails to generate the "source" and
"destination" files.

I then changed the "Maximum error" to 1 and kept the batch size at 1.
Re-ran the package expecting to see "OOPS!" in a dialog box, instead,
the package just terminated with the "standard" "Primary Key Violation"
dialog box. Shouldn't "On Insert Failure" method be triggered by the
error?

Thanks.

Jack


'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

' Copy each source column to the destination column
Function Main()
DTSDestination("ord_number") = DTSSource("ord_number")
DTSDestination("ship_number") = DTSSource("ship_number")
DTSDestination("cust_code") = DTSSource("cust_code")
DTSDestination("inv_date") = DTSSource("inv_date")
Main = DTSTransformStat_OK
End Function

Function InsertFail()
MsgBox "OOPS!!!"
End Function


Reply With Quote
  #2  
Old   
Davide
 
Posts: n/a

Default Re: Error Handling in DTS package - 09-05-2006 , 04:55 AM






Hello jackso95 (AT) hotmail (DOT) com,

look at this from Alan

http://www.sqldts.com/default.aspx?282,5

it seems the right explanation about why your InsertFailureMain function
is not fired for PK violation.

By the way, this job is very slow; it would bebetter using a staging table
for loading all temporary data without costraints, then demanding to sql
server (using a stored procedure) the storicization of good data and the
garbaging of bad records.

Bye


Quote:
- Sql Server 2000 DTS
- Enabled Multi-phase datapump
- Dell Dual processor 1.2 GHZ w/ 1GB ram
Objective:
I am trying to do some error trapping in DTS so that if an error
occurrs, it will log the error and continue on. I am using an ActiveX
object to do the transformation.
I have set the "Max Error" to 9999 and the batch size to 1 so it will
post what it can and continue on. (Wonder if there is a better way to
this, it runs very slow....?). However, I would like a log of the
records that errored out.
As a test, I am writing a record to the table that I know will violate
the Primaary Key constraint. The error is logged to the specified
error file. However, it fails to generate the "source" and
"destination" files.

I then changed the "Maximum error" to 1 and kept the batch size at 1.
Re-ran the package expecting to see "OOPS!" in a dialog box, instead,
the package just terminated with the "standard" "Primary Key
Violation" dialog box. Shouldn't "On Insert Failure" method be
triggered by the error?

Thanks.

Jack

'************************************************* ********************
* ' Visual Basic Transformation Script
'************************************************* ********************
***

' Copy each source column to the destination column
Function Main()
DTSDestination("ord_number") = DTSSource("ord_number")
DTSDestination("ship_number") = DTSSource("ship_number")
DTSDestination("cust_code") = DTSSource("cust_code")
DTSDestination("inv_date") = DTSSource("inv_date")
Main = DTSTransformStat_OK
End Function
Function InsertFail()
MsgBox "OOPS!!!"
End Function



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.