DataGinger.com


Home | Pages | Archives


SQL Server – Why is the ‘sa’ Login Account Disabled & How to Enable ‘sa’ Login Account

August 20, 2013 8:30 am

Ever noticed and wondered why the well-known SQL Server system administrator (sa) login is in a disabled state?

SA Login

The reason is simple, sa login account is disabled out of the box (by default) in Windows Authentication mode. You have to enable manually to use it.

On the other hand, if you request Mixed Mode Authentication during installation, SQL Server Setup prompts you to set an sa login password. So sa login account is enabled in this case.

Enable/Disable sa login using SSMS GUI:

SA Login - 1

SA Login - 2

SA Login - 3

Enable sa login using T-SQL script:

ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = '$trongPa$$w@rD';
GO

Disable sa login using T-SQL script:

ALTER LOGIN sa DISABLE ;
GO

Here’s some more info about “sa” account:

Technical Reviewer: Jaipal Vajrala

Posted by Suresh Raavi

Categories: Security, T-SQL

Tags: , , , ,

11 Responses to “SQL Server – Why is the ‘sa’ Login Account Disabled & How to Enable ‘sa’ Login Account”

  1. Enable sa login using T-SQL script: helped me. Thank you.

    By N T Sukumar on October 18, 2014 at 5:25 am

  2. it’s not working ……

    By roushann8 on January 6, 2015 at 6:17 am

  3. You also need to enable ‘SQL Server and Windows Authentication mode’ under Server Properties

    By Skeet on February 24, 2015 at 8:06 pm

  4. […] For more information on sa account you can check my previous blog post HERE […]

    By SQL Server – Change Ownership for All User Databases to “sa” Account | SqlServerZest.com on June 5, 2015 at 4:28 pm

  5. […] SQL Server – Why is the ‘sa’ Login Account Disabled & How … – Ever noticed and wondered why the well-known SQL Server system administrator (sa) login is in a disabled state? The reason is simple, sa login account is disabled out … […]

    By How To Enable Sa Account In Sql Server 2008 | People Life on June 26, 2016 at 11:02 am

  6. This article worked perfectly for me. I didn’t have SSMS installed on the pc, so I put the T-SQL script statements into a sql file, set the correct password, and ran it from the command prompt like so:
    >Sqlcmd -S.\SQLEXPRESS -i c:\temp\sqlfile.sql
    … this successfully enabled the sa account.
    Many thanks

    By Kylie Cram on July 29, 2019 at 3:24 pm

  7. […] SQL Server – Why is the ‘sa’ Login Account Disabled & How … […]

    By sql server sa login log Online Portal Client Support Activation Password Information - banklogining.com on October 30, 2021 at 4:48 pm

  8. […] SQL Server – Why is the ‘sa’ Login Account Disabled & How … […]

    By test sql sa com Login Sign In Account Page Guide http - trustba.com on December 17, 2021 at 8:48 am

  9. […] SQL Server – Why is the ‘sa’ Iniciar Sesion Account Disabled & How … […]

    By ➤ Iniciar Sesion Failed For User Sa The Account Is Disabled 【Iniciar Sesion】 on March 9, 2022 at 10:26 pm

  10. […] » Visit Now Aug 20, 2013 · SQL Server – Why is the ‘sa’ Login Account Disabled & How to Enable ‘sa’ Login Account August 20, 2013 by Suresh Raavi Ever noticed and wondered why the well-known SQL Server system administrator ( sa ) login is in a disabled state? […]

    By Login Failed For User Sa The Account Is Disabled Sign In - logininfos.com on July 12, 2022 at 12:31 pm

  11. […] » Visit Now Aug 20, 2013 · SQL Server – Why is the ‘sa’ Login Account Disabled & How to Enable ‘sa’ Login Account. August 20, 2013 by Suresh Raavi. Ever noticed and wondered why the well-known SQL Server system administrator (sa) login is in a disabled state? The reason is simple, sa login account is disabled out of the box (by default) in Windows … […]

    By Sql Server Sa Login Thread - logininfos.com on August 10, 2022 at 9:28 pm

Leave a Reply



Mobile Site | Full Site


Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.