Wednesday, August 01, 2012

How to drop a database with publication

I got a database on a log shipping subscriber server which I want to drop it. But the publisher database has some active publications. SQL Server doesn't allow you to drop it directly because it thinks it has replications going on. So the way to drop it is putting the database into Offline mode first. Then you should be able to drop it. (NOTE: PLEASE ALWAYS MAKE SURE YOU HAVE A BACKUP BEFORE DROPPING ANY DATABASE!!!)

ALTER DATABASE MyDB SET OFFLINE;


No comments: