dbTalk Databases Forums  

Help! Insert or Update rows in DTS (DDQ?)

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


Discuss Help! Insert or Update rows in DTS (DDQ?) in the microsoft.public.sqlserver.dts forum.



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

Default Help! Insert or Update rows in DTS (DDQ?) - 08-01-2003 , 03:18 PM







Ok, I know I can't be the only one who wants a well-defined way to do
this. I have a set of records that will need to be inserted if they
don't exist, or updated if the primary key exists. There's no data in
the record that will tell me if it's new or not. Ideally, I'd like to
automatically do an insert query in DDQ, and if it fails due to primary
key violation, have it then run the UpdateQuery. Does anyone have any
examples or any online articles that show me how to set this up? I'm
trying to learn the multiphase datapump, but I don't know if I can use
the 'On insert failure' to do an update statement, or what the syntax is
for that. Any help?

Mark

--
Posted via http://dbforums.com

Reply With Quote
  #2  
Old   
Narayana Vyas Kondreddi
 
Posts: n/a

Default Re: Help! Insert or Update rows in DTS (DDQ?) - 08-02-2003 , 03:39 PM






Mark, in this case, you don't really have to use DDQ. You could go for
traditional insert, update and delete statements, which are much faster and
DDQs. I have some examples in this article:
http://vyaskn.tripod.com/sql_server_..._practices.htm

Search for the word DDQ in this article.

--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
What hardware is your SQL Server running on?
http://vyaskn.tripod.com/poll.htm




"mhavens" <member34794 (AT) dbforums (DOT) com> wrote


Ok, I know I can't be the only one who wants a well-defined way to do
this. I have a set of records that will need to be inserted if they
don't exist, or updated if the primary key exists. There's no data in
the record that will tell me if it's new or not. Ideally, I'd like to
automatically do an insert query in DDQ, and if it fails due to primary
key violation, have it then run the UpdateQuery. Does anyone have any
examples or any online articles that show me how to set this up? I'm
trying to learn the multiphase datapump, but I don't know if I can use
the 'On insert failure' to do an update statement, or what the syntax is
for that. Any help?

Mark

--
Posted via http://dbforums.com



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.