HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

How to reset SA user password SQL Server

5,814 views November 8, 2017 3:51

Watch on YouTube
ChannelSandeep Gupta

Description from the creator

An easy step by step guide to get the access as sysadmin user in case you have lost/forgotten sa user password. Also in case Windows admin user was not added as sysadmin to SQL Server.

This solution is application in following cases:

1) "sa" users passowrd is lost/forgotten/locked and no other sysadmin
user is available.
2) Windows admin user has not been assigned sysadmin role in SQL server.


Steps to follow to login as system administrator in SQL Server :

1) Stop SQL Server Service

2) Start SQL Server in single user mode
-mSQLCMD parameter

3) Connect to SQL Server through sqlcmd
Open command prompt as admin : sqlcmd -S.

4) Add Windows local admin as sysadmin

USE [master]
GO
CREATE LOGIN [BUILTIN\Administrators] FROM WINDOWS WITH
DEFAULT_DATABASE=[master]
GO
EXEC master..sp_addsrvrolemember @loginame =
N'BUILTIN\Administrators', @rolename = N'sysadmin'
GO

5) Stop SQL Server Service

6) Start SQL Server Service in multi user mode

7) change "sa" password

About this tutorial

Sandeep Gupta published this 3:51 video tutorial on November 8, 2017. It has been watched 5,814 times on YouTube.

Category
Education
Duration
3:51
Published
November 8, 2017
Views
5,814
Likes
34

Tags

Share

This tutorial in other languages