dbTalk Databases Forums  

Primary Key Constraints

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


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



Reply
 
Thread Tools Display Modes
  #1  
Old   
gaiams via SQLMonster.com
 
Posts: n/a

Default Primary Key Constraints - 10-11-2005 , 10:51 AM






Hello,
I am trying to do an insert from one db table to another. It works great
until a record that is a dup of one that is already in the destination table.
(Which I do not want inserted) I do not want the package to fail just not
insert the dup record.

Thank You
For any Help
Greg

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

Default RE: Primary Key Constraints - 10-11-2005 , 12:20 PM






insert into TableA
select * from TableB where not exists (select *from tableA where id
=TableB.id)



“I sense many useless updates in you... Useless updates lead to
defragmentation... Defragmentation leads to downtime...Downtime leads to
suffering..Defragmentation is the path to the darkside.. DBCC INDEXDEFRAG and
DBCC DBREINDEX are the force...May the force be with you" --
http://sqlservercode.blogspot.com/


"gaiams via SQLMonster.com" wrote:

Quote:
Hello,
I am trying to do an insert from one db table to another. It works great
until a record that is a dup of one that is already in the destination table.
(Which I do not want inserted) I do not want the package to fail just not
insert the dup record.

Thank You
For any Help
Greg


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.