I put a SQL Server 2005 database into single-user mode using Management Studio in an attempt to force a restore over the existing database.
But now I can't access the database. I get these errors:
When first clicking the database in the tree:
"The database ___ is not accessible (Object Explorer)"
Then if I try to right-click on the database and view Properties, I get a longer message ending with:
"Database '__' is already open and can only have one user at a time. (Microsoft SQL Server, Error: 924)."
But I was the user who put the database into single-user mode, and that's the same user that comes up in the '1 Active Connection' box when I go to Detach the database (not to really detach but to see what the connection is). So I don't know why it won't let me perform any actions on the database.
Finally, I tried:
ALTER DATABASE ___
But I get the error:
"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."
Does anyone know how to revert a database to Multi-User mode in SQL Server 2005? Also, this DB is a back end to a .NET application -- is that application the user that is using up the single-user connection? If so, how can I stop that connection or otherwise set the database back to Multi-User mode?
Thanks in advance for any help!
"I love spending twice as long and working twice as hard to get half as much done!" – Nobody ever.
"Operator! Give me the number for 911!" - Homer Simpson
"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"