Discussion:
Catching a Primary Key violation in a Transform Data Task
(too old to reply)
NH
2010-04-22 17:47:01 UTC
Permalink
Hi

I have a really simple DTS package that loads a .csv into a table using a
Transform Data Task.

Very occasionally, I get a primary key violation and the package fails.

What I would like to do is 'catch' the error and do something to correct it.

I have been playing around with an ActiveX Script Task running 'On Failure'
of the Transform Data Task, but don't know how to check to see what caused
the the previous task to fail?

Can anyone point me in the right direction?

Thanks

NH
Paul Shapiro
2010-04-23 12:28:18 UTC
Permalink
You can load the data into an empty staging table, without a primary key,
and then run an insert statement that only inserts new rows (and optionally
an update statement for existing rows).
Post by NH
Hi
I have a really simple DTS package that loads a .csv into a table using a
Transform Data Task.
Very occasionally, I get a primary key violation and the package fails.
What I would like to do is 'catch' the error and do something to correct it.
I have been playing around with an ActiveX Script Task running 'On Failure'
of the Transform Data Task, but don't know how to check to see what caused
the the previous task to fail?
Can anyone point me in the right direction?
Loading...