如何刪除發(fā)布與復(fù)制訂閱數(shù)據(jù)庫 'distribuion' 的方法
之前因為從VFP數(shù)據(jù)庫中把數(shù)據(jù)導(dǎo)入到SQL SERVER2000中,用DTS做了發(fā)布與復(fù)制數(shù)據(jù)庫'distribution'?,現(xiàn)在要把它刪除,當(dāng)在企業(yè)管理器中執(zhí)行刪除時,提示下面的錯誤:
Error 3724: cannot drop the database 'distribution'?because it is being used for replication.
解決方法:
一、首先要備份 master 數(shù)據(jù)庫,在查詢分析器選擇 master 數(shù)據(jù)庫下操作:
sp_configure 'allow updates',1
reconfigure with override
go
update master..sysdatabases set category = 0 where name='distribution'
delete the distribution database
執(zhí)行了上面的命令,就可以在企業(yè)管理器中刪除'distribution'數(shù)據(jù)庫了。
二、方法討論:
1、如果你只執(zhí)行這條命令:update master..sysdatabases set category = 0 where name='distribution'
會出現(xiàn)錯誤:Ad hoc updates to system catalogs are not enabled. The system administrator
must reconfigure SQL Server to allow this.
所以你在必須先執(zhí)行:
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:
執(zhí)行命令:?? sp_removedbreplication 'distribution'
參考英文資料:
http://www.ureader.com/message/145316.aspx
http://support.default.aspx?scid=kb;en-us;326352