dbTalk Databases Forums  

Unable to drop the database after dropping the republication using store procedure!!HELP !! HELP

microsoft.public.sqlserver.replication microsoft.public.sqlserver.replication


Discuss Unable to drop the database after dropping the republication using store procedure!!HELP !! HELP in the microsoft.public.sqlserver.replication forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
victor
 
Posts: n/a

Default Unable to drop the database after dropping the republication using store procedure!!HELP !! HELP - 01-26-2005 , 10:01 PM






hi there:
i got a big problem here. i call serval store procedures from c# to drop a
republication. the code likes following


use [databaseName]
GO

-- Dropping the merge publication
exec sp_dropmergepublication @publication = N'database_Publication'
GO

-- Disabling the replication database
use master
GO

exec sp_replicationdboption @dbname = N'databaseName', @optname = N'merge
publish', @value = N'false'
GO


use master
GO

exec sp_dropdistributor @no_checks = 1
GO


after that when i try to use "drop database databaseName" to drop the
database. the sql server didnt allow me to do that.
the error message is "can not drop the databaseName, because it is currently
in use".

I close the connection everytime i excute one command.

anyone can help?
cheers






Reply With Quote
  #2  
Old   
Paul Ibison
 
Posts: n/a

Default Unable to drop the database after dropping the republication using store procedure!!HELP !! HELP - 01-27-2005 , 03:45 AM






You could try something like:
ALTER DATABASE databaseName SET SINGLE_USER WITH ROLLBACK
IMMEDIATE
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.