Lesson 2: Transactional Replication
Activity 2: Configuring Transactional Replication
Solution:
Navigate to
C:\Code\Lesson02\Activity
and openRemoveReplication.sql
in SQL Server Management Studio. Modify the parameter values, as instructed in the script, and execute the script.This will remove the existing publication and subscription for the
AdventureWorks
database.This step is only to be executed if there is an existing publication and subscription for the
AdventureWorks
database.Execute the following query to drop and create the
AdventureWorks
database at the subscriber:DROP DATABASE AdventureWorks GO CREATE DATABASE AdventureWorks
Execute the
C:\Code\Lesson02\Activity\1_CreatePublication.sql
query in SQLCMD mode to create thePub-AdventureWorks
publication and add articles to the publication.You'll have to modify the publisher and subscriber parameter values as per your environment.
Execute the
C:\Code\Lesson02\Activity\2_CreateSubscription.sql
query in SQLCMD mode to create thePub-AdventureWorks
subscription.You'll have to modify the publisher and subscriber parameter values as per your environment.
Execute the
C:\Code\Lesson02\Activity\3_VerifyReplication.sql
query to verify that the replication has been configured successfully.