Categories
Sql Server

How To create a Publication In Replication

How To create a Publication In Replication

When creating a publication, you choose the tables and other database objects that you want to publish. You can publish the following database objects using replication.When publishing a table for replication, you can specify which schema objects should be copied to the Subscriber, such as declared referential integrity (primary key constraints, reference constraints, unique constraints), indexes, user DML triggers (DDL triggers cannot be replicated), extended properties, and collation.

Keep the following issues in mind when publishing database objects:

  1. The database is accessible to users during the creation of the publication and the initial snapshot, but it is advisable to create publications during times of lower activity on the Publisher.
  2. A database cannot be renamed after a publication is created in it. To rename it, you must first remove replication from the database.
  3. If you are publishing a database object that depends on one or more other database objects, you must publish all referenced objects.

Follow these steps to create a Publication:-

  1. Open Sql server Management Studio.
  2. Expand Replication tab > Go to Local Publication > Add New Publication
  3. Select Publication Database > Publication Type > Article to be published
  4. Give timing to run the Replication Agent.
  5. Specify the Login to run the Agent.
  6. Click On finish Publication is created.

Check below Images for refrence:-

(Click On images To Enlarge)