Tuesday, December 30, 2008

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

2 comments:

  1. 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'.

    ReplyDelete
  2. It will work with 2005 version onwards only.

    ReplyDelete