dbTalk Databases Forums  

Best method for daily syncing of databases from various sources?

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


Discuss Best method for daily syncing of databases from various sources? in the microsoft.public.sqlserver.dts forum.



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

Default Best method for daily syncing of databases from various sources? - 10-31-2005 , 10:11 PM






Greetings,

I have a newbie question. I've been reading methods of syncing a Foxpro
DB to a MSSQL server daily. Each record luckily contains a last
modified date so it may make it easier.

DTS seems like the way to go but I wish to perform more advanced logic
mainly:

* Sync only new records
* Sync only modified records (drop old row, input new row)
* Dropping the entire table is not an option since it's too large to
re-copy each time.

Achieving the above two requires me to write some scripts to drop any
old records. What ingredients do I need to look at?

Would I use DTSLOOKUP to say query the last modified record in my MSSQL
DB? Would I need to readup on ActiveX or is there a less overkill method?

Would I require some stored procedure to drop old records and copy new
ones?


Thanks!

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

Default Re: Best method for daily syncing of databases from various sources? - 11-01-2005 , 03:25 PM






How about you create from SQL Server a linked Server of the Foxpro DB.

For new rows you compare Keys and insert where the ID does not exist in
SQL Server.
For Updates you compare keys, where they match you can then do an update
on the other attributes (the advantage here is that you will not break
RI as readily as dropping the row and recreating)
For removing (deletes) you can compare keys and where the key exists in
SQL Server but not Foxpro then delete.

In the insert and the delete if you have RI in place then the inserts
will have to follow in Parent --> Child order for the inserts and Child
--> Parent order for the deletes.

Allan


"Yorro" <yuniverse (AT) hotmail (DOT) com> wrote


Quote:
Greetings,

I have a newbie question. I've been reading methods of syncing a Foxpro
DB to a MSSQL server daily. Each record luckily contains a last
modified date so it may make it easier.

DTS seems like the way to go but I wish to perform more advanced logic
mainly:

* Sync only new records
* Sync only modified records (drop old row, input new row)
* Dropping the entire table is not an option since it's too large to
re-copy each time.

Achieving the above two requires me to write some scripts to drop any
old records. What ingredients do I need to look at?

Would I use DTSLOOKUP to say query the last modified record in my MSSQL
DB? Would I need to readup on ActiveX or is there a less overkill
method?

Would I require some stored procedure to drop old records and copy new
ones?


Thanks!


Reply With Quote
  #3  
Old   
Yorro
 
Posts: n/a

Default Re: Best method for daily syncing of databases from various sources? - 11-01-2005 , 11:14 PM



Great stuff Allen. I never covered Linked Servers and I'm reading it up
now. Looks like it'll do the job.

Thanks.


Allan Mitchell wrote:
Quote:
How about you create from SQL Server a linked Server of the Foxpro DB.

For new rows you compare Keys and insert where the ID does not exist in
SQL Server.
For Updates you compare keys, where they match you can then do an update
on the other attributes (the advantage here is that you will not break
RI as readily as dropping the row and recreating)
For removing (deletes) you can compare keys and where the key exists in
SQL Server but not Foxpro then delete.

In the insert and the delete if you have RI in place then the inserts
will have to follow in Parent --> Child order for the inserts and Child
--> Parent order for the deletes.

Allan


"Yorro" <yuniverse (AT) hotmail (DOT) com> wrote in message
news:esYiUpp3FHA.3400 (AT) tk2msftngp13 (DOT) phx.gbl:

Greetings,

I have a newbie question. I've been reading methods of syncing a Foxpro
DB to a MSSQL server daily. Each record luckily contains a last
modified date so it may make it easier.

DTS seems like the way to go but I wish to perform more advanced logic
mainly:

* Sync only new records
* Sync only modified records (drop old row, input new row)
* Dropping the entire table is not an option since it's too large to
re-copy each time.

Achieving the above two requires me to write some scripts to drop any
old records. What ingredients do I need to look at?

Would I use DTSLOOKUP to say query the last modified record in my MSSQL
DB? Would I need to readup on ActiveX or is there a less overkill
method?

Would I require some stored procedure to drop old records and copy new
ones?


Thanks!



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.