0% found this document useful (0 votes)
2 views

Access SQL Server From Backend 1654356755

Uploaded by

venkataprudhivi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Access SQL Server From Backend 1654356755

Uploaded by

venkataprudhivi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Problem Description:

SQL server was installed long back and managed by other team. Server owners moved other organization and
forgot to provide\handover SA password. Recently client suggested that add instance to DBA inventory for
support. There is no access on SQL server DBA team and don’t know the SA password & connection string also.

We done below steps to get access SQL server from back end and communicated to client, SQL services will
restart during the activity (5 minutes) and started activity in non-business hours.

Resolution:

1. Start SQL Server in Single User mode.


a. Open SQL server configuration manager
b. Right click on SQL server-> property ->Advanced-> startup parameter-> add “-mSQLCMD”-> click add->
Apply->Ok

c. Restart SQL server service


2. Check SQL Server started in single-user mode or not. (Using Eventvwr and eventid-17110)

3. Connect SQL server from command prompt.


a. Open command prompt run as administrator.
b. Connect SQL server

1
SQLCMD –S . or SQLCMD –S ServerName (for default instance)

SQLCMD –S .\MyInstance or SQLCMD –S ServerName\MyInstance (Named Instance)

4. Create login with sysadmin role in SQL server


a. Windows user

USE [master]
GO
CREATE LOGIN [Domain\Loginname] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
ALTER SERVER ROLE [sysadmin] ADD MEMBER [Domain\Loginname]
GO

Note: Mention SQL DBA group name instead of Domain\Loginname

b. SQL user

USE [master]
GO
CREATE LOGIN [Test] WITH PASSWORD=N'XXXXXXXX' MUST_CHANGE, DEFAULT_DATABASE=[master],
CHECK_EXPIRATION=ON, CHECK_POLICY=ON
GO
ALTER SERVER ROLE [sysadmin] ADD MEMBER [Test]
GO
exit

2
5. Start SQL Server in Multi-user mode.
a. Open SQL server configuration manager
b. Right click on SQL server-> property ->Advanced-> startup parameter-> select “-mSQLCMD”-> click Remove
-> Apply->Ok

c. Restart SQL server.

You might also like