如何删除发布与复制订阅数据库 'distribuion' 的方法

之前因为从VFP数据库中把数据导入到SQL SERVER2000中,用DTS做了发布与复制数据库'distribution' ,现在要把它删除,当在企业管理器中执行删除时,提示下面的错误:

Error 3724: cannot drop the database 'distribution' because it is being used for replication.

解决方法:

一、首先要备份 master 数据库,在查询分析器选择 master 数据库下操作:

sp_configure 'allow updates',1
reconfigure with override
go

update master..sysdatabases set category = 0 where name='distribution'

delete the distribution database

执行了上面的命令,就可以在企业管理器中删除'distribution'数据库了。

二、方法讨论:

1、如果你只执行这条命令:update master..sysdatabases set category = 0 where name='distribution'

会出现错误:Ad hoc updates to system catalogs are not enabled. The system administrator
must reconfigure SQL Server to allow this.

所以你在必须先执行:

sp_configure 'allow updates',1
reconfigure with override
go   

这条命令允许更新,上面的错误才能解决。

2、也可以移除,自己翻译一下 ^_^: Make sure that you did not enable this database for replication by using the sp_helpreplicationdboption system stored procedure. Do not enable the database for replication. If it is enabled for replication, run the sp_removedbreplication stored procedure to disable replication.

IMPORTANT: Running sp_removedbreplication on a database removes all replication objects from the database. Therefore, all publications and subscriptions in the database are removed. Only members of the sysadmin fixed server role can run the sp_removedbreplication stored procedure. For more information about the sp_removedbreplication stored procedure, see the "sp_removedbreplication, Transact-SQL Reference" topic in SQL Server Books Online.

To run the sp_removedbreplication stored procedure, use the following code in which you replace dbname with the name of your database:

执行命令:   sp_removedbreplication 'distribution'

参考英文资料:

http://www.ureader.com/message/145316.aspx

http://support.default.aspx?scid=kb;en-us;326352

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值