change to database to 'online' and set db to 'multi-user'

Viewed 55144

I have a 2008 sql database that is offline that I would like to take online and set to multi-user. Using sql server management studio - new query window - when i execute the following:

   ALTER DATABASE mydb SET ONLINE;

    ALTER DATABASE mydb SET MULTI_USER;

I receive this error message:

Msg 5064, Level 16, State 1, Line 1 Changes to the state or options of database 'mydb' 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. Msg 5064, Level 16, State 1, Line 3 Changes to the state or options of database 'mydb' 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 3 ALTER DATABASE statement failed.

How would I get the database online and in multi-user mode?

2 Answers
Related