Add new article in transactional replication in SQL Server 2012
Creating replication is one thing and maintaining it is a different yet equally important thing. Over the time, you might add or remove some objects in your primary database and hope the same for your replication database and this article comes into the picture when you need to add some more object from primary (Publication) database to replicated (subscriber) database.
I have already written few articles on replications which are listed below:
- Understanding Replication with implementation of Snapshot replication in SQL Server 2012 (Click Here)
- Remove Replication from SQL Server 2012 (Click Here)
- Error Fix – Cannot execute as the database principal(Click Here)
- Setup Transaction Replication in SQL Server 2012 (Click Here)
I will use the Publisher and Subscriber of Transaction Replication to demonstrate this article. You can create the same replication from here.
If you already having your replication ready to add article (Table, Stored Procedure, View, Index View, Functions etc.), follow the steps given below.
1.) Connect to your publisher server and right click on publication name and click on “Property” from pop up menu.
2.) You will get Publication property dialog box and you have to move to “Article” page from the left hand menu to get a list of articles available to publish in publication database. Select the object you want to replication. Make sure the database table you select is having the primary key. Without primary key, table won’t be able to be a part of transaction replication.
3.) Once you select object and click on “Ok” button in above given dialog box, right click on “Replication” option in objection explorer of SSMS and click on “Launch Replication Monitor”.
4.) You will see “Agent” tab in Replication Monitor dialog box, right click on “Snapshot Agent” and click on “Start Agent” option; it takes little time, based on the size of object and data, to complete the snapshot agent.
As soon as Snapshot Agent builds completely, you can check your subscriber database, you will find the entire selected object in subscriber database.
Reference: Ritesh Shah
Sharing IT tips at “Quick Learn“
Note: Microsoft Books online is a default reference of all articles.