What SQL is required to put SQL Server 2005 in single user mode? -
How do I know (and if it is possible then in detail) using SQL Statement in SQL Server 2005 in single user mode ?
I found these instructions on MSDN, but they require the SSMS.
* To set up a database in single-user mode
- In an object explorer, connect to an example of SQL Server 2005 database engine , And then expand that frequency.
- Right-click the database to change, and then click Properties.
- In the Database Properties dialog box, click on the Options page.
- With restricted access options, select Single.
- If another user is connected to a database, an open connection message will appear. To change the property and close all other connections, click Yes.
The following should work:
ALTER DATABASE [MyDatabase] SET SINGLE_USER WITH NO_WAIT Go
with
ALTER DATABASE [MyDatabase] SET multi-user to set it back
no.
Comments
Post a Comment