Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query to synchronize data between two databases

Author  Topic 

anish20in
Starting Member

18 Posts

Posted - 2010-06-03 : 06:07:00
Hi All,
I have two tables having same structure from two databases(same database name)on different SQL2008 Servers that I need to synchronize this tables. Please advice me how to do this possible.I would like to write a query to perform this task. Is it possibe. Please help me. This is an urget requirement.

Details:-
Server1 - 192.168.1.1 (DB Name- TestDB and Table name Tbl_Sales)
Server2 - 192.168.1.2 (DB Name- TestDB and Table name Tbl_Sales)

Regards,


ANI

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-06-05 : 06:54:09
if using SQL 2008 have a look at syntax of MERGE in books online

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

anish20in
Starting Member

18 Posts

Posted - 2010-06-08 : 10:08:14
Thanks. done this using data syncing. SSIS is a good option for this.

Regards,


ANI
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2010-09-28 : 08:14:07
You didn't supply DDL but this can also been done with a query, inserting only new rows (if that fits your requirements). Less invasive then truncating the table and doing an entire refresh (essentially you're disallowing access to the table being refreshed until the process is complete). However, if your requirements also include moving deltas, what you're doing is probably the easiest way.

Terry

-- You can't be late until you show up.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-09-30 : 12:10:51
quote:
Originally posted by anish20in

Thanks. done this using data syncing. SSIS is a good option for this.

Regards,


ANI


Thats also an option. But how big are tables?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -