怎样手工删除数据库里的Merge Replication信息

博客介绍了处理数据库复制的方法。先运行 sp_removedbreplication,接着在恢复的数据库中运行脚本生成删除复制相关系统表、视图、存储过程和触发器的命令,检查输出确保不删除用户对象后执行。还提及两个可选步骤,一是确保用户对象不再标记为复制,二是确保无列标记为复制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. The best way is to run sp_removedbreplication.

2. After you run sp_removedbreplication, you may run the following
script in your restored database. This script will generate the drop
commands for replication related system tables, views, stored procedures
and triggers. You may check the generated output first to make sure it
does not drop your own user object, and then run the output to drop
these information.


set nocount on
Select 'drop table ' + name from sysobjects
where name like '%conflict%' and type='u'

Select 'drop table ' + name from sysobjects
where name like 'MSMerge%' and type='u'

Select 'drop trigger ' + name from sysobjects
where type = 'tr' and status < 0 and category = 2

Select 'drop proc ' + name from sysobjects
where name like 'sp_%' and type ='p' and category = 2

Select 'drop proc ' + name from sysobjects
where name like 'sel_%' and type ='p' and category = 2

Select 'drop view ' + name from sysobjects
where name like 'tsvw%' and type ='v' and category = 2
Select 'drop view ' + name from sysobjects
where name like 'ctsv%' and type ='v' and category = 2


3. (optional step) you may use the steps in the following article to
make sure your user objects are no longer marked as being used in
replication (by change the replinfo column of the sysobjects to 0. This
steps is only needed if the replinfo column is not 0):

http://support.microsoft.com?id=326352

4. (optional step) check the steps in the following article to make sure
no columns are being marked as replicated:

http://support.microsoft.com?id=811899

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值