First, release. The publication requires an actual server name and cannot be performed using the server's IP address. The information that can be published includes "table", "Stored procedure", "User function" if using IP there will be an error, such as:
The specific release process is as follows:
1. Locate "Copy" under the database server--"local publishing" and select "New publication". Such as:
2. Select the database you want to publish. Such as:
3. Select the type of publication. The default type of "Snapshot publication" is selected here. Several types of publishing differ, and SQL Server gives instructions below. Such as:
4. Select the class capacity to be published. Such as:
The right side of the filter is the filtered SQL statement.
5. Set up the Snapshot Agent. Such as:
Change the sync frequency as follows:
6, set agent security. Such as:
7. Fill in the publication name
8, complete the release. Such as:
Second, subscription. A subscription is a snapshot of a database publication that synchronizes the published data source data to the target database. The specific subscription process is as follows;
1. Locate "Copy"--"local subscription" under the database server and select "New Subscription". Such as:
2. Select the publication of the subscription. Such as:
3. Select the location of the Distribution Agent, such as:
4. Select one or more target databases on the subscriber that hold the synchronized data. Such as:
To add multiple subscription databases, tap add Subscriber. Such as:
5. Set the security of the Distribution Agent. Such as:
6. Set the synchronization schedule. Such as:
7, complete the subscription. Such as:
This completes the entire process of publishing and subscribing.
Right-click on a local subscription to view Distributor Properties after publishing is complete
Then set the history hold time to set the transaction retention period because the default is zero
Database Publishing Subscriptions