dbTalk Databases Forums  

DTS - Append and Update

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


Discuss DTS - Append and Update in the microsoft.public.sqlserver.dts forum.



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

Default DTS - Append and Update - 04-05-2004 , 02:35 PM






Greetings. I have a situation that I would like help with.
I have created a DTS to pull data from one table to
another. To help with my scenario, here is part of my
table structure

Table1 - (USERID, YEAR, FAMILYID, DELETED, (other fields))
PK - USERID, YEAR

Table2 - (USERID, YEAR, FAMILYID, DELETED)
PK - USERID, YEAR

I would like to update Table2 once a day. If FAMILYID or
DELETED has changed for the USERID, YEAR combination I
would like to update the record in Table2. If there is not
a current USERID, YEAR record in Table2, I would like the
record added. How would I do this? I created a DTS
package, but it won't update current records. It wants to
drop them and recreate them and I don't want the record
dropped.


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

Default Re: DTS - Append and Update - 04-05-2004 , 05:21 PM






On Mon, 5 Apr 2004 12:35:32 -0700, "Paige" <rmrper99 (AT) comcast (DOT) net>
wrote:

Quote:
Greetings. I have a situation that I would like help with.
I have created a DTS to pull data from one table to
another. To help with my scenario, here is part of my
table structure

Table1 - (USERID, YEAR, FAMILYID, DELETED, (other fields))
PK - USERID, YEAR

Table2 - (USERID, YEAR, FAMILYID, DELETED)
PK - USERID, YEAR

I would like to update Table2 once a day. If FAMILYID or
DELETED has changed for the USERID, YEAR combination I
would like to update the record in Table2. If there is not
a current USERID, YEAR record in Table2, I would like the
record added. How would I do this? I created a DTS
package, but it won't update current records. It wants to
drop them and recreate them and I don't want the record
dropped.
A much simpler method would be to use a view. Since table 2 is
basically a duplicate of the first four fields, why bother updating?


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.