Single User mode

  • Could someone please explain the process of putting SQL into single-user mode, and then returning it to multi-user?

    Thanks, Matt.

  • Just execute an ALTER DATABASE staement, like this:

    ALTER DATABASE databasename

    SET SINGLE_USER

    There can't be any users logged on to the database in order for you to execute this statement, but you can add the option WITH ROLLBACK IMMEDIATE to force an immediate single user mode.

    Then when you're done and want to go back to multi user mode, just execute:

    ALTER DATABASE databasename

    SET MULTI_USER

    Chris Hedgate @ Apptus Technologies (http://www.apptus.se)

    http://www.sql.nu

  • You can also do thru EM by right clicking the database choosing proerties and check the value on the option tab related to this.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Run this procedure with following parameter

    sp_dboption 'DB name', 'single user', 'true'

    and database will be in single user mode. When returning to multi user mode Use 'False' as parameter.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply