Export (0) Print
Expand All
Expand Minimize
0 out of 1 rated this helpful - Rate this topic

Replicate Schema Changes

This topic describes how to replicate schema changes in SQL Server 2012 by using SQL Server Management Studio or Transact-SQL.

If you make the following schema changes to a published article, they are propagated, by default, to Microsoft SQL Server Subscribers:

  • ALTER TABLE

  • ALTER VIEW

  • ALTER PROCEDURE

  • ALTER FUNCTION

  • ALTER TRIGGER

In This Topic

Limitations and Restrictions

  • The ALTER TABLE … DROP COLUMN statement is always replicated to all Subscribers whose subscription contains the columns being dropped, even if you disable the replication of schema changes.

Arrow icon used with Back to Top link [Top]

If you do not want to replicate schema changes for a publication, disable the replication of schema changes in the Publication Properties - <Publication> dialog box. For more information about accessing this dialog box, see View and Modify Publication Properties.

To disable replication of schema changes

  1. On the Subscription Options page of the Publication Properties - <Publication> dialog box, set the value of the Replicate schema changes property to False.

  2. Click OK.

    To propagate only specific schema changes, set the property to True before a schema change, and then set it to False after the change is made. Conversely, to propagate most schema changes, but not a given change, set the property to False before the schema change, and then set it to True after the change is made.

Arrow icon used with Back to Top link [Top]

You can use replication stored procedures to specify whether these schema changes are replicated. The stored procedure that you use depends on the type of publication.

To create a snapshot or transactional publication that does not replicate schema changes

To create a merge publication that does not replicate schema changes

To temporarily disable replicating schema changes for a snapshot or transactional publication

  1. For a publication with replication of schema changes, execute sp_changepublication (Transact-SQL), specifying a value of replicate_ddl for @property and a value of 0 for @value.

  2. Execute the DDL command on the published object.

  3. (Optional) Re-enable replicating schema changes by executing sp_changepublication (Transact-SQL), specifying a value of replicate_ddl for @property and a value of 1 for @value.

To temporarily disable replicating schema changes for a merge publication

  1. For a publication with replication of schema changes, execute sp_changemergepublication (Transact-SQL), specifying a value of replicate_ddl for @property and a value of 0 for @value.

  2. Execute the DDL command on the published object.

  3. (Optional) Re-enable replicating schema changes by executing sp_changemergepublication (Transact-SQL), specifying a value of replicate_ddl for @property and a value of 1 for @value.

Arrow icon used with Back to Top link [Top]

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.