Skip to main content

Posts

Showing posts with the label database is in single-user mode

*Msg 5064, Level 16, State 1, Line 1 Changes to the state or options of database '' cannot be made at this time. The database is in single-user mode, and a user is currently connected to it. Msg 5069, Level 16, State 1, Line 1 ALTER DATABASE statement failed.

Hi everyone! This post will cover the single-user mode error for a database. There will be mention of replication, but that is not the focus of the post. If you would like more information on replication, check out my other post here . Here's what happened. I was tasked with setting up replication between two databases on a server. It turns out replication was no longer needed and I didn't need the database at all. So I dropped the replication publication and subscription without removing them from the database first. This is a no-no. You should always remove replication from your database first before deleting any publication(s) and/or subscription(s). Since I did not do it properly, the database is still associated with the replication process and knows the process is broken. What did it do? It forced the database into single user mode. Now I have to get this database out of single user mode so I can remove replication and delete the database...