When I started to use SQL Server replication yesterday, I knew nothing about this, but what I wanted to achieve through this function was very clear-to complete data synchronization between the two SQL Server databases, that is, any data changes in database A can be promptly reflected in database B.
So there is a concentrated situation that needs to be confirmed: 1) database A and database B are on one machine
2) database A and database B are on two machines, but in the same network segment.
3) database A and database B are on two machines, but in different network segments.
First, start with your own machine.
As a test, I used the pubs database to generate an SQL script and created a mypubs database.
At the beginning, I registered all SQL servers with IP addresses, so I was unable to configure the release. After checking some information, I found that IP addresses and local names cannot be used. This problem was solved almost one morning.
There is no problem in synchronizing two databases on the same machine. (However, I found that the mypubs database does not have a primary key or a foreign key)
But there is a problem with the two machines. By the end of work yesterday, the synchronization problem between the two servers had not been solved.
This morning, I used two other Windows server operating systems for testing and synchronized them from one pubs to the other machine's mypubs! Happy!
However, if the mypubs of the row to be synchronized to your machine still does not work, I do not know if my operating system is XP.
Conclusion:
1. synchronization between two machine SQL servers can be achieved, and further verification is required for different network segments.
2. (doubt) Are there restrictions on primary keys and Foreign keys in subscribed databases and data tables?
-- It seems that there is no constraint, because if the selected subscription database is the pubs of the system itself, synchronization cannot be completed. Some reminders such as "Table titleauthor cannot be removed because it is used for replication" are prompted, resulting in failure.
Therefore, what you cannot determine is:
1. Is it possible to create a primary key and a foreign key constraint between data tables in the subscription database?
2. Must the operating system be Windows2000 Server?
3. Can databases of different network segments perform such synchronization?