MSSQL database file is locked and we couldn’t open it in SQL Server. Whether could we reset SA password to open it?

Undoubtedly the answer is yes. SA account is the default administrator of SQL Server. So not only opening database file, but also all of things could be done by SA account in Microsoft SQL Server. The important problem is how to reset SA password.

The following passage would introduce two ways to reset SA password for MSSQL according to whether we have Windows administrator privileges.

  1. Run Command Prompt to reset SA password with Windows administrator privileges
  2. Run SQL Password Genius to reset SA password without Windows administrator privileges

Way 1: Run Command Prompt to reset SA password with Windows administrator privileges

  1. Click Start and type cmd in search box, press Enter to run Command Prompt as administrator.
  2. Type following command to reset MSSQL SA password. Press Enter after every command line.

OSQL -E
1> EXEC sp_password NULL, yourpassword, sa
2> GO

Way 2: Run SQL Password Genius to reset SA password without Windows administrator privileges

iSunshare SQL password reset tool, SQL Password Genius is one effective tool for SQL user password reset. With it, you could reset all user passwords for SQL Server database, including SA and other users with different privileges for SQL Server database file.

Tips: Close SQL Server Services before running SQL Server Genius to rest SQL password.

1. Install and run SQL Password Genius on computer.

2. Import SQL Server database file into password reset tool.

Master.mdf file is the main and most import SQL Server database file. Just click “Open File” button and you could find it in this location generally.
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
Click “Open” button and import it into SQL Password Genius.

import sql database file

3. Reset MSSQL SA password.

All users are shown in the list after database file import. Select “sa” account in the list and click the “Reset” button at the bottom of window. Type a new password in pop-up dialog and click “OK”.

reset mssql sa password

successfully reset database sa password

Instantly, SA password has been reset and new password appears in the list.

Related Articles: