dbTalk Databases Forums  

Transfer of only new/updated records

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


Discuss Transfer of only new/updated records in the microsoft.public.sqlserver.dts forum.



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

Default Transfer of only new/updated records - 09-10-2004 , 03:51 AM






Hi,

I have 3 cubes based of data from a web site.

Of the data, there is "Contact" and "Customer" info [end other ].

If a new "Contact" is added, I'd be able to get all NEW records by checking
on the creation date of the entry.

But

If a "Contact" was modified, how would I transfer that entry without
appending it to the destination database or deleteing all records from the
destination database [which is not ideal].

I tried "Identity Insert", using a MSSQL db as destination database, but it
does not seem to be working. I also checked that there is a "Indenty" field
in the destination table. To my understanding, DTS will replace the old
record with the new one.
[For MySQL people, "replace into some_table ...bla bla"]

How would I get a list of entries to delete from the destination table? For
instance "select etl_row_id from adr_contact", then using that list to
delete from the destinations database? [Which sounds like one way of doing
it]???

Anyone please, thanx
Wikus



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

Default Re: Transfer of only new/updated records - 09-10-2004 , 04:00 AM






As you know, there isn't a REPLACE command, that updates a row in SQL
Server. You might want to add a column to your source table, that holds the
last mofied date and time, based on which you can pick the updates and apply
them on the target using UPDATE command.

Check out my article:
http://vyaskn.tripod.com/sql_server_..._practices.htm

It is a lengthy one, and if you want to go straight to the point, search for
DDQ in this article.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/


"Wikus Schalkwyk" <wikus (AT) experient (DOT) co.za> wrote

Hi,

I have 3 cubes based of data from a web site.

Of the data, there is "Contact" and "Customer" info [end other ].

If a new "Contact" is added, I'd be able to get all NEW records by checking
on the creation date of the entry.

But

If a "Contact" was modified, how would I transfer that entry without
appending it to the destination database or deleteing all records from the
destination database [which is not ideal].

I tried "Identity Insert", using a MSSQL db as destination database, but it
does not seem to be working. I also checked that there is a "Indenty" field
in the destination table. To my understanding, DTS will replace the old
record with the new one.
[For MySQL people, "replace into some_table ...bla bla"]

How would I get a list of entries to delete from the destination table? For
instance "select etl_row_id from adr_contact", then using that list to
delete from the destinations database? [Which sounds like one way of doing
it]???

Anyone please, thanx
Wikus




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.