How to enable or disable ‘sa’ login?

/* To disable 'sa' Login */
ALTER LOGIN [sa] DISABLE
GO
/* To Enable 'sa' Login */
ALTER LOGIN [sa] ENABLE
GO

Comments

2 responses to “How to enable or disable ‘sa’ login?”

  1. Santhosh Avatar

    Where this command is run ? I tried on SQL Query Analyzer, it give error

    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near ‘LOGIN’.

    1. Jugal Shah Avatar

      It will work with 2005 version onwards only.

Thanks for the comment, will get back to you soon… Jugal Shah