dbTalk Databases Forums  

Catching a Primary Key violation in a Transform Data Task

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


Discuss Catching a Primary Key violation in a Transform Data Task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
NH
 
Posts: n/a

Default Catching a Primary Key violation in a Transform Data Task - 04-22-2010 , 12:47 PM






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

Reply With Quote
  #2  
Old   
Paul Shapiro
 
Posts: n/a

Default Re: Catching a Primary Key violation in a Transform Data Task - 04-23-2010 , 07:28 AM






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).

"NH" <NH (AT) discussions (DOT) microsoft.com> wrote

Quote:
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?

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.