Altering a Replicated Table in a Classic Replication Scheme
You can use ALTER TABLE ... ADD COLUMN
or ALTER TABLE ...
DROP COLUMN
statements to add or drop columns on the master database in a
classic replication scheme.
The ALTER TABLE
operation is replicated to alter the
subscriber databases. These are the only ALTER TABLE
clauses that are
replicated in a classic replication scheme.
If you use ALTER TABLE
on a database configured for bidirectional replication, first stop updates to the table on all of the replicated databases and confirm all replicated updates to the table have been received by the databases before issuing the ALTER TABLE
statement. Do not resume updates until the ALTER TABLE
operation has been replicated to all databases. This is necessary to ensure that there are no write operations until after the table is altered on all databases.
Note:
You can use the ttRepSubscriberWait
built-in procedure or monitoring tools described in Managing Replication to confirm the updates have been received and committed on the databases.
Also, if you are running a number of successive ALTER TABLE
operations on a database, you should only proceed with the next ALTER TABLE
after you have confirmed the previous ALTER TABLE
has reached all of the subscribers.
Note:
You can use the ALTER TABLE
statement to change default column
values, but the ALTER TABLE
statement is not replicated. Thus,
default column values need not be identical on all nodes.