How to Enable, Disable or Rename a Login in SQL Server

To disable a login in SQL Server use the following command:

ALTER LOGIN [login_name] DISABLE;
GO

disable_login_sql_server

…to enable it:

ALTER LOGIN [login_name] ENABLE;
GO

enable_login_sql_server

To disable a login:

ALTER LOGIN [login_name] WITH NAME = [new_name];
GO

rename_login_sql_server

If you need to Enable, Disable or Rename the 'sa' login read the related blog post:
Enable, Disable or Rename login SA in SQL Server

If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">