Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synchronizing data 1

Status
Not open for further replies.

bouwob

Programmer
Apr 12, 2006
171
0
0
US
Ok I have 4 tables on db1 that is the master and 1 table on db2 which is the slave. I need to do a sync job that will move the data from the 4 tables on db1 to the one table on db2.

I have been told by supperiors that truncation is not an option so bcp is out I guess. Does anybody have any nifty sql tools to take care of this or any good documentation. When doing a seach I am finding lots of programs able to do this but my environment is not allowing 3rd party applications.

any help is greatly appreciated.

tia
 
Are both databases on the same server?

-George

"the screen with the little boxes in the window." - Moron
 
No they are on different boxes on different domains
 
In that case, I would recommend exporting the data from one server and using BCP on the other.

Since you said you cannot truncate the existing table, my suggestion would be to BCP the data in to a temp table. Then compare the data in the real table with the data in the temp table. If the data exists, then update it. If it doesn't, then insert it.

Make sense?

-George

"the screen with the little boxes in the window." - Moron
 
Well not as quick and easy as I was hoping but that will work. Hay I appreciate all that help. Time for many pages of stored procedures to be written ;)
 
>> many pages of stored procedures

I suppose there is a business reason for writing many pages of stored procedures, but on the surface, it really shouldn't be that much.

-George

"the screen with the little boxes in the window." - Moron
 
I was figuring c1, c2, c3 are primary. I will have to do a compare to see if it exists. if it does then I will have to compare c4-c15 to see if any of the fields are different. I suppose not alot. Just alot more than a truncate and replace.

Still probably less than an hour worth of work. Beats the heck out of doing it manuly ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top