Forgot sa password for your SQL Server?

Forrards
March 31, 2023

It may happen so that you don`t know the password of sa user for SQL Server you inherited from somebody. Actually it can happen cause of many reasons. We`ll try to resolve this issue now.

So here is a step by step guide for resetting forgotten sa password.

1. First of all stop SQL Server service.

2. Run cmd.exe and get to the folder with SQL Server binaries

cd C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn

3. Start SQL Server in single user mode

sqlservr.exe -m

If you want to run some named instance use the command below:

sqlservr.exe -m -s INSTANCE_NAME

4. Run the following command in cmd.exe:

OSQL -S  -E

5. After connecting to the server run the command below:

sp_password NULL, ‘’, ’sa’
GO

6. Stop SQL Server in single user mode by hitting Ctr+C and answering Yes in the dialog.

7. Run SQL Server Service in usual way.

Now you can login under sa with new password.

Please keep in mind that some third-party applications may be using sa password and by changing it you may stop them working, though it is not a good practice to keep sa user enabled and use it by any applications.

Forrards
March 31, 2023
Share
Recent articles:
Database consultancy: SaaS database considerations
March 31, 2023

Utilizing given approach each client get his own database. In such case every client`s data stays isolated from others. It simplifies backing up the data, installing new clients but causes higher cost of maintenance.

More
Database consultancy: tree-like structure
March 31, 2023

Subject recursion is well covered in the literature, but, nevertheless, the problem of output “tree” does not mean the client and SQL Server many baffled. So, put the problem: there is a table with the name and record id field indicating the parent identifier. Immediately fill in this table, some sort of test data:

More
Database consultancy: Hierarchy in MS SQL Server
March 31, 2023

In our time of greatest prevalence of databases were relational databases, which are the main targets of the tables and the relationships between them. Tables can solve most problems for data storage and manipulation. But in the real world entity requiring storage is not always presented in a tabular form. One of these very common types of data structures other than the table is a tree structure, where each data element is the parent and the offspring. An example of such a structure may be the structure of state enterprises, which is headed by the director (the root of the tree), his deputies, heads of departments from which are subject to certain deputies, employees of departments, which are subject to the rulers.

More

Subscribe to our blog

    

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Database consultancy: SaaS database considerations

Utilizing given approach each client get his own database. In such case every client`s data stays isolated from others. It simplifies backing up the data, installing new clients but causes higher cost of maintenance.

March 31, 2023
Database consultancy: tree-like structure

Subject recursion is well covered in the literature, but, nevertheless, the problem of output “tree” does not mean the client and SQL Server many baffled. So, put the problem: there is a table with the name and record id field indicating the parent identifier. Immediately fill in this table, some sort of test data:

March 31, 2023

Discuss your project with us

    

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.