This article describes configuring a local publishing subscription in a single instance. Replication is a set of technologies that replicate and distribute data and database objects from one database to another, and then synchronize between databases to maintain consistency. With replication, data can be assigned to different locations and assigned to remote or mobile users over local and wide area networks, dial-up connections, wireless connections, and the Internet.
1. Configure Local distribution
Right click on replication, click Configure Distribution ...
Select Local instance as Distributor
Set the snapshot path to a local directory
Set the distribution database name, distribution database file path (default)
Click Close when you are finished
2. Configure local Publishing
Right-click Local publications
Select a published database
Select the type of publication (depending on the actual need), select a transaction here
Select the tables, stored procedures, views, methods that you want to publish
Tables without a primary key are not allowed to be published
If you need to filter the published data, click Add to write the filter criteria, there is no need to filter
Set the Snapshot Agent, log read Agent account, click on the security Settings ...
Set the following
Set the publication name
3. Create a local subscription
Right click on local subscriptions, click New Subscriptions
Choose a publishing source
All agents run on the server in the distribution library
Select a subscription database, or you can choose to create a new
As follows, select a database that has been built
Set up a connection account, click ...
Set the following
Default Select Run continuously uninterrupted sync
Default Select Initialize Subscription now
4. Check
After the configuration is complete, the database appears as follows
View Replication Monitor
View History Sync Records
At this point, the local publish subscription configuration is complete.
SQL Server replication-Local Publishing subscription configuration