SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Not able to access any table of a Database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kalyan.cse05
Yak Posting Veteran

India
74 Posts

Posted - 04/08/2013 :  07:39:08  Show Profile  Reply with Quote
I am getiing the below error while accessing any table of a database( Say database name is ABC)

"Database 'ABC' is already open and can only have one user at a time."

Please help.

kalyan Ashis Dey

ahmeds08
Aged Yak Warrior

India
675 Posts

Posted - 04/08/2013 :  07:43:06  Show Profile  Send ahmeds08 a Yahoo! Message  Reply with Quote
Looks like the database is in single user mode.check with your DBA.

mohammad.javeed.ahmed@gmail.com
Go to Top of Page

kalyan.cse05
Yak Posting Veteran

India
74 Posts

Posted - 04/08/2013 :  07:56:39  Show Profile  Reply with Quote
Yes you are right.it is in Single User mode. Could you please tell how can i remove this single user mode and make it multi user?

kalyan Ashis Dey
Go to Top of Page

ahmeds08
Aged Yak Warrior

India
675 Posts

Posted - 04/08/2013 :  08:01:48  Show Profile  Send ahmeds08 a Yahoo! Message  Reply with Quote
ALTER DATABASE 'XXX' SET MULTI_USER

mohammad.javeed.ahmed@gmail.com
Go to Top of Page

kalyan.cse05
Yak Posting Veteran

India
74 Posts

Posted - 04/08/2013 :  08:12:25  Show Profile  Reply with Quote
getiing the below error message :

Msg 5064, Level 16, State 1, Line 1
Changes to the state or options of database 'XXX' 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.

kalyan Ashis Dey
Go to Top of Page

ahmeds08
Aged Yak Warrior

India
675 Posts

Posted - 04/08/2013 :  08:17:25  Show Profile  Send ahmeds08 a Yahoo! Message  Reply with Quote
check the user currently conected and he can change the database to multi user.

mohammad.javeed.ahmed@gmail.com
Go to Top of Page

prett
Posting Yak Master

USA
204 Posts

Posted - 04/16/2013 :  00:12:48  Show Profile  Visit prett's Homepage  Reply with Quote
First Run SP_Who and see who is connected to the database when the database is in single user mode. Because , to set it back to Multi user mode it need exclusive lock on the DB which is already in single user mode and used by some other process. For more information, please check this discussion:
http://social.msdn.microsoft.com/forums/en-US/sqldatabaseengine/thread/6fb2bb4b-46b7-4a5b-a3de-36a76b192472
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000