dbTalk Databases Forums  

DUP Primary Key

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


Discuss DUP Primary Key in the microsoft.public.sqlserver.dts forum.



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

Default DUP Primary Key - 10-18-2005 , 01:27 PM






I work in DTS Package and this DTS insert fileds from TXT file into any
table.
I need control with ON ERROR RESUME NEXT the error "Violation of PRIMARY KEY
constraint. Cannot insert duplicate key in object <table">. Because i can't.
Somebody help me plissss!

Thank's

LML




Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: DUP Primary Key - 10-18-2005 , 03:21 PM






Hello Luis,

A PK Violation will abort the batch.

I had a small amount of success here.

Multiphase Data Pump (Field Notes)
(http://www.sqldts.com/default.aspx?282)

A much cleaner solution would be to import your file to a staging table and
then use TSQL to compare key values. You can then only insert rows with
key values not already in the destination.


Allan




Quote:
I work in DTS Package and this DTS insert fileds from TXT file into
any
table.
I need control with ON ERROR RESUME NEXT the error "Violation of
PRIMARY KEY
constraint. Cannot insert duplicate key in object <table">. Because i
can't.
Somebody help me plissss!
Thank's

LML




Reply With Quote
  #3  
Old   
Luis Mena
 
Posts: n/a

Default Re: DUP Primary Key - 10-18-2005 , 03:53 PM



Thanks Allan, you give the solution.
Regards.

LML


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Hello Luis,

A PK Violation will abort the batch.

I had a small amount of success here.

Multiphase Data Pump (Field Notes)
(http://www.sqldts.com/default.aspx?282)

A much cleaner solution would be to import your file to a staging table
and
then use TSQL to compare key values. You can then only insert rows with
key values not already in the destination.


Allan




I work in DTS Package and this DTS insert fileds from TXT file into
any
table.
I need control with ON ERROR RESUME NEXT the error "Violation of
PRIMARY KEY
constraint. Cannot insert duplicate key in object <table">. Because i
can't.
Somebody help me plissss!
Thank's

LML






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.