How to start SQLServer in Single User Mode

Discussion in 'Databases' started by shivakhanal, Jul 12, 2008.

  1. #1
    At times you might want to start SQL server in a single user mode to perform some maintenance work on the server or to change server configurations or to recover a damaged database. You can accomplish this in any of the three ways given below :-
    a) From Command Prompt :-

    » sqlservr -m

    b) From Startup Options :-

    » Go to SQL Server Properties by right-clicking on the Server name in the Enterprise manager.
    » Under the 'General' tab, click on 'Startup Parameters'.
    » Enter a value of -m in the Parameter.

    c) From Registry :-

    » Go to HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer\Parameters.
    » Add new string value.
    » Specify the 'Name' as SQLArg(n) & 'Data' as -m.
    Where n is the argument number in the list of arguments.

    Caution: Be careful while editing the Registry. Incorrectly setting up Registry values can cause unpredictable behavior.
     
    shivakhanal, Jul 12, 2008 IP
  2. delhi_wala

    delhi_wala Peon

    Messages:
    75
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sp_dboption 'DB_NAME', 'single user', 'true'
     
    delhi_wala, Jul 16, 2008 IP