SQL Server – How to Enable a Disabled SQL Server Login
When an account is disable it cannot be used to login to SQL Server. You will receive below error when logging-in to SQL Server using a disabled Login account:
You can enable a disabled SQL Server Login using SQL Server Management Studio or via T-SQL code.
To enable a Login using SQL Server Management Studio:
1. Open SQL Server Management Studio
2. Login to Server using a system/security administrator account
3. Locate the disabled login under Security > Logins in Object Explorer
4. Right Click on Login Name and select Properties.
5. Go to Status Tab and Select "Enabled" under "Login:"
6. Click on "OK" to apply changes.
To enable a Login using T-SQL Code:
1. Login to Management Studio with a system/security administrator account and execute below T-SQL code:
ALTER LOGIN [User01] ENABLE
Executing above code will enable a disabled login account.
Hope This Helps!
This is a personal weblog. The opinions expressed here are my own and not of my employer. For accuracy and official references refer to MSDN, Microsoft TechNet, Books Online. I or my employer do not endorse any of the tools / applications / books / concepts mentioned here on my blog. I have simply documented my personal experiences on this blog.
- Backup & Recovery (11)
- Catalog Views (25)
- Certification (1)
- Common Table Expressions (6)
- Database Mail (1)
- Management Studio (38)
- Management Views and Functions (11)
- Partitioning (3)
- Service Pack Releases (2)
- SQL Agent (7)
- SQL Bugs (2)
- SQL Configuration (30)
- SQLServer (164)
- Uncategorized (1)
- Undocumented Functions (21)
- Working With Data (14)