Friday, April 27, 2012

Enabling sa account in SQL Express 2008


Problem:  
How to enable 'sa' account in  SQL server Express edition.
Problem Description: 
By default Microsoft sets the SQL Express login mode as Windows Authentication and disables the default 'sa' account.  This is done for several security reasons and best practice.   But sometime we need to overwrite this for various reasons, one that I come across recently was when I try to install an open source CMS product which requires an Admin account and it did not provide me the option to change the account to windows authentication.
Solution:
If you have installed SQL Server express with Windows Authentication mode and want to change it, you need follow these steps.
  1. Login to SQL Express with your windows authentication account
  2. Right-click on your SQL Server Express root (see the image below) and select Properties

3. Go to Security tab and change the mode to SQL Server authentication mode and click 'OK'
4. Go to security/logins, open SA login properties

5. Uncheck "Enforce password policy" and "Enforce password expiration" check box 
6. Assign password to SA user
7. Open "Status" tab and enable login (this can be also done via SQL editor  by running the following command:  ALTER LOGIN [sa] ENABLE)

Now login to your SQL server with 'sa' account.... 
Happy SQL Programming!!!

1 comment: