Search code examples
sql-serverreplication

Updating Replicated Database


What is the optimal way to update a schema on a publishing database that is push-replicated is SQL Server (2012).

Currently we disable replication, update the schema, re-enable replication and run a new snapshot.

As the database grows this strategy will become problematic as the snapshot will get bigger which will make deployments take longer over time.

Is there a way to do this without a new snapshot?


Solution

  • Schema changes can be made using ALTER syntax at the publisher. By default the schema change will be propagated to subscribers automatically, publication property @replicate_ddl must be set to true. There are considerations to make depending on the type of schema change and the publication type. This is covered in Make Schema Changes on Publication Databases and Replicate Schema Changes.