Sql-server – Changes to main Database during Transactional Replication

change-managementreplicationsql serversql-server-2012transactional-replication

Can you please advise how can I keep slave database up to date while it's in transactional replication with master.

I mean what If I change indexes, columns, tables or sthm else in master dabase? What should I do in this case?

Should I make this changes to both databases simultaneously or transactional article is enough to handle it?

Best Answer

By default, replication will push out the following DDL changes to subscribers:

  • ALTER TABLE
  • ALTER VIEW
  • ALTER PROCEDURE
  • ALTER FUNCTION
  • ALTER TRIGGER

And by default, I mean unless you have specified otherwise when you made a call to sp_addpublication when setting up the publication (even if done through the GUI, this is the underlying stored procedure that is called). There is a parameter for that stored procedure, @replicate_ddl, that is set to 1 by default, meaning that the above DDL commands will replicate to subscribers for the articles in the publication.

When you made your initial call to sp_addarticle, you would have specified (again, even if through the GUI where all the article options are set) which indexes (clustered and nonclustered) were generated for subscribers to create for initialization as well.

Reference :: How to: Replicate Schema Changes