We have two DB instances in our SQL 2000 server and some 10 tables from DB 'A' is replicated in DB 'B'. Whatever change we make in DB 'A' tables are replicated to DB 'B' tables. We have added开发者_如何学JAVA a column to one of the table in DB 'A'. Do we need to alter the table in DB 'B' also? Or else it depends on how the replication was setup(which i don't know since it is setup by someone else)? Will it throw any error when replicating data?
It depends whether the 'Replicate schema changes' option in the Susbcriptions pane of the publication was True or False when you set up replication. By default is True, meaning the schema changes are replicated.
For more details, restrictions and exceptions, including differences between merge and transactional replication, see Making Schema Changes on Publication Databases. Don't miss this little nugget:
Schema changes to tables must be made by using Transact-SQL or SQL Server Management Objects (SMO). When schema changes are made in SQL Server Management Studio, Management Studio attempts to drop and re-create the table. You cannot drop published objects, therefore the schema change fails.
Replication will add the new column to table 'B'.
精彩评论