0

Edit: Example if one server is down, the other one has the same data and i will be able to use it.

Example of what I want to achieve:

Server 1 -> DBExample

INSERT INTO DBExample (idExample, nameExample) VALUES (123, 'Example');

SELECT * FROM DBExample;
+-----------+-------------+
| idExample | nameExample |
+-----------+-------------+
|       123 | Example     |
+-----------+-------------+

Server 2 -> DBExample2

SELECT * FROM DBExample2;
+-----------+-------------+
| idExample | nameExample |
+-----------+-------------+
|       123 | Example     |
+-----------+-------------+

And vice versa:

Server 2 -> DBExample2

INSERT INTO DBExample2 (idExample, nameExample) VALUES (1234, 'Example2');

SELECT * FROM DBExample;
+-----------+-------------+
| idExample | nameExample |
+-----------+-------------+
|       123 | Example     |
|      1234 | Example2    |
+-----------+-------------+

Server 1 -> DBExample

SELECT * FROM DBExample;
+-----------+-------------+
| idExample | nameExample |
+-----------+-------------+
|       123 | Example     |
|      1234 | Example2    |
+-----------+-------------+
  • are they linked servers? you could create a view, which unions the table of both servers: https://stackoverflow.com/questions/1144051/selecting-data-from-two-different-servers-in-sql-server – Esteban P. Jul 06 '17 at 16:04
  • This belongs on dba.stackexchange.com but here's a start: https://msdn.microsoft.com/en-us/library/ms190202(v=sql.105).aspx – S3S Jul 06 '17 at 16:33

1 Answers1

0

As this is SQL Server look at bi-directional transactional replication, or peer to peer replication.

http://sqlblog.com/blogs/hilary_cotter/archive/2011/10/28/implementing-bi-directional-transactional-replication.aspx

HilaryCotter
  • 109
  • 1