Tuesday, February 28, 2017

Getting SQL Server admin access

Following commands will provide you admin access for SQL Server instance.

Step 1:  Run > Services.msc

Step 2: Stop SQL Server (Express)




Step 3: sc start mssql$sqlexpress -m -T3659 -T4010 -T4022




Step 4: sqlcmd -S [SQLInstanceName] -E
Example: sqlcmd -S ComputerName\sqlexpress -E

Step 5:
exec SP_ADDSRVROLEMEMBER 'domainname\username', 'sysadmin'
go
exit

Example:
exec SP_ADDSRVROLEMEMBER 'domainname\vxp1122', 'sysadmin'
go
exit


Step 6: sc start mssql$sqlexpress



FYI:
We also have admin access for (localdb)\v11.0 

Most Recent Post

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape