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

  1. In an object explorer, connect to an example of SQL Server 2005 database engine , And then expand that frequency.
  2. Right-click the database to change, and then click Properties.
  3. In the Database Properties dialog box, click on the Options page.
  4. With restricted access options, select Single.
  5. 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.
  6. 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

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -