﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 7,2000 / Replication  / Cannot drop the database XXX because it is being used for replication. / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 04:10:23 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Worked like a charm with "Offline" mode!I had a interesting situation: my database was in Warm Standby mode, and I had a [b].tuf [/b]file deleted. The releiving thing was that I didn't needed this database anymore, but I couldn't delete it because of remained publications from primary log shipped database. The publication couldn't be deleted, of course, because the DB was read only. The DB could not be recovered because of missing tuf file.The only solution that worked was putting the DB to offline mode, and then deleting manually the data and log files. Also the publication disappeared.Thanks!</description><pubDate>Sat, 12 Jan 2013 10:49:15 GMT</pubDate><dc:creator>arbcoll</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Hello allI just find another simplest way to workaround it.Expand the server in SSMS;Right-click in Replication folder;Click "Disable Publishing and Distribution"...This action should delete all files, jobs and distribution database.It worked for me.Hope this helpsRegards</description><pubDate>Tue, 29 Mar 2011 15:09:48 GMT</pubDate><dc:creator>Rodrigo Moraes-286573</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Taking it offline worked. Thanks for the post!</description><pubDate>Mon, 19 Apr 2010 11:35:54 GMT</pubDate><dc:creator>rfonseca</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Go back and drop the data / log files since dropping an offline database doesn't delete these files.</description><pubDate>Tue, 15 Sep 2009 07:13:16 GMT</pubDate><dc:creator>SA-1</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>You must use the next: use masterGOsp_configure 'allow updates', 1GORECONFIGURE WITH OVERRIDEGOto allow updates over system databases When you finish the operation, yo must run the next:use masterGOsp_configure 'allow updates', 0GORECONFIGURE WITH OVERRIDEGO</description><pubDate>Fri, 28 Aug 2009 02:06:36 GMT</pubDate><dc:creator>rafael.algora</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Taking the database offline works like a charm. Thanks raja</description><pubDate>Thu, 09 Apr 2009 11:54:57 GMT</pubDate><dc:creator>lyhe</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Hello, you need to run the following:sp_configure "allow updates", 1goReconfigure with overridegoAfter you execute the failing command:sp_configure "allow updates", 0 goReconfigure with overridegoHope this helps. Todd</description><pubDate>Wed, 25 Feb 2009 07:03:16 GMT</pubDate><dc:creator>phillip_latham</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>I got the same problem.I tried to solved it.Then I checked "Replication" item,found that I set up the Publications rule for the detached database.So you can check the Publication and Subscriptions.</description><pubDate>Thu, 08 Jan 2009 03:28:16 GMT</pubDate><dc:creator>achir.lui</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Is this any help?[url]http://www.dbforums.com/showthread.php?t=708918[/url]</description><pubDate>Sun, 27 Jul 2008 20:34:44 GMT</pubDate><dc:creator>GrahamO-735217</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>This will let you update. This is dangerous so make sure to run allow updates 0sp_configure 'allow updates',1GORECONFIGURE WITH OVERRIDEGOupdate sysdatabases set category=0 where name = 'xxx'sp_configure 'allow updates',0GORECONFIGURE WITH OVERRIDEGO</description><pubDate>Thu, 17 Jul 2008 14:11:03 GMT</pubDate><dc:creator>shah797</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Hi,Try to setup Server Seeting-&amp;gt; Server behaiver-&amp;gt;allow modifications to be made directly to system catalogsRichard Yang</description><pubDate>Fri, 27 Jun 2008 14:41:57 GMT</pubDate><dc:creator>ryang9639@yahoo.com</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>write this and then try to update the system tablesp_configure 'allow updates',1reconfigure with overrideThen after the update execute thissp_configure 'allow updates',0reconfigure with override</description><pubDate>Sun, 10 Feb 2008 22:24:26 GMT</pubDate><dc:creator>Jerrin</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>HiI have the same problem I tried the following update sysdatabases   set Category = 0 where dbid = 13but I get the following errorMsg 259, Level 16, State 1, Line 1Ad hoc updates to system catalogs are not allowed.</description><pubDate>Thu, 07 Feb 2008 03:08:05 GMT</pubDate><dc:creator>casia</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Set Category for the database to 0 in master.dbo.sysdatabases. Then you can delete it.</description><pubDate>Fri, 03 Aug 2007 17:01:00 GMT</pubDate><dc:creator>JeremyE</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>&lt;P&gt;take the datbase offline and then drop it. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;raja&lt;/P&gt;</description><pubDate>Thu, 02 Aug 2007 00:23:00 GMT</pubDate><dc:creator>Raja Abubaker-455153</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>Nonenone!! Thanks a lot!!!</description><pubDate>Fri, 28 May 2004 09:37:00 GMT</pubDate><dc:creator>e.francone</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>&lt;P&gt;You can restore another database backup, that don`t have replications configured,  over the database that you want to delete(with the "force restore over existing database" option marked). Doing this you will overwrite the sysobjects lines that saves the replication parameters and the SQL Server will alow you to delete the database.&lt;/P&gt;&lt;P&gt;I hope It`s easy to understand..&lt;/P&gt;&lt;P&gt;Mila.&lt;/P&gt;</description><pubDate>Fri, 28 May 2004 07:00:00 GMT</pubDate><dc:creator>Nonenone-147172</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>&lt;P&gt;although it's not recommended, sometimes you 'll have to update the REPLINFO column in SYSOBJECTS.&lt;/P&gt;&lt;P&gt;Maj.&lt;/P&gt;</description><pubDate>Wed, 12 May 2004 04:41:00 GMT</pubDate><dc:creator>majbou</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>&lt;P&gt;what type of replication?&lt;/P&gt;&lt;P&gt;What I've had to run to make sure my scripts are starting clean for merge replication are as follows:&lt;/P&gt;&lt;P&gt;'Drop any subscriptionsexec sp_dropmergesubscription @publication = N'&amp;lt;publication&amp;gt;''&lt;/P&gt;&lt;P&gt;'Drop the publicationexec sp_dropmergepublication @publication = N'&amp;lt;publication&amp;gt;'&lt;/P&gt;&lt;P&gt;'Set the DB to not be for replicationexe sp_replicationdboption @dbname= N'&amp;lt;db&amp;gt;' @optname=N'merge publish' @value = 'FALSE'&lt;/P&gt;&lt;P&gt;If you're using trans rep I believe the commands are similar.&lt;/P&gt;&lt;P&gt;Also if you go into EM and right-click the publication you can choose 'generate script' which will give you the option to see the script for creating or droping the publications.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Tue, 11 May 2004 09:33:00 GMT</pubDate><dc:creator>Christopher Klein</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>&lt;P&gt;I want to drop XXX Db that contains a restore of "distribution" database of a production server. I've tried to use sp_helpreplicationdb but I'm not be able to drop XXX DB.&lt;/P&gt;&lt;P&gt;Can you give me some more advices?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Tue, 11 May 2004 09:23:00 GMT</pubDate><dc:creator>e.francone</dc:creator></item><item><title>RE: Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>&lt;P&gt;Please, run sp_helpreplicationdb to check with databases are marked for replication.&lt;/P&gt;&lt;P&gt;Distribution is for replication but should not be marked for replication, so you should be able to restore it at any time.&lt;/P&gt;</description><pubDate>Tue, 11 May 2004 06:43:00 GMT</pubDate><dc:creator>Rodrigo Acosta</dc:creator></item><item><title>Cannot drop the database XXX because it is being used for replication.</title><link>http://www.sqlservercentral.com/Forums/Topic115333-7-1.aspx</link><description>&lt;P&gt;When I try to drop the XXX database SQLServer returns me this error message:&lt;/P&gt;&lt;P&gt;Server: Msg 3724, Level 16, State 3, Line 1Cannot drop the database XXX because it is being used for replication.&lt;/P&gt;&lt;P&gt;I've also tried to execute the following code but nothing has changed.&lt;/P&gt;&lt;P&gt;exec sp_removedbreplication 'XXX'goexec sp_dboption 'XXX','published',falsegoexec sp_dboption 'XXX','merge publish',falsego&lt;/P&gt;&lt;P&gt;The XXX DB is a restore of "Distribution" database of a Production Server that is a publication server!&lt;/P&gt;&lt;P&gt;Someone can help me?&lt;/P&gt;&lt;P&gt;Thanks for all suggestions!!!&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Tue, 11 May 2004 04:46:00 GMT</pubDate><dc:creator>e.francone</dc:creator></item></channel></rss>