Configuring Transactional Replication
We'll now look at how to configure or set up transactional replication between two databases using T-SQL.
Exercise 7: Creating the Publication
The first step in configuring replication is to create the publication. Follow these steps to create a publication for transactional replication:
Navigate to
C:\Code\Lesson02\Transactional
and open1_CreatePublication.sql
in SQL Server Management Studio.In SSMS, from the top menu, select Query and then select SQLCMD. This changes the mode of the
1_CreatePublication.sql
query to SQLCMD from SQL.Modify the parameters in the script (shown in the following screenshot) as per your environment:
The preceding screenshot shows the parameters being used in the script. The parameters are self-explanatory. The publisher and distributor are the same, as the publisher acts as its own distributor.
To run the script and create the publication, change the parameters as specified earlier...