Translate

Friday, January 16, 2009

Error when Inserting for Replication Stopped Databases

Question: There is a database which was enabled for replication before. After replication was when trying to insert records following error is raised. Invalid object name ‘dbo.MSmerge_contents’.
Answer: When replication is enabled, additional columns, triggers are created to your replicated articles. When you stop the replication, there are times that newly added tables are not removed. Things will get worse only partial objects are removed. For example, triggers are not dropped while tables are dropped. When trigger try to insert records to the relevant tables, it will find that tables are missing and error is raised.
To overcome this you can run sp_removedbreplication @dbname = 'dbname' and it will remove that replicated related objects from the database.

No comments:

Post a Comment