March 27, 2013 at 5:52 am
Hi Experts,
We have two situations here
1. ‘SA’ is locked and we don’t have any login with sysadmin previleage
2.SA is disabled and no other logins in that server except builtin\administrator.
Can anyone please help me to login to server with admin rights or enable\unlock SA
TIA
March 27, 2013 at 5:58 am
Add yourself as a admin on the windows host, start SQL in single user mode, then use SQLCMD or SSMS in query mode only to add in your windows account as a sysadmin
March 27, 2013 at 6:09 am
Plz go through the link given below...
http://dilipparakala.blogspot.com/2013/02/forgot-sa-password-and-none-of-user-is.html
March 27, 2013 at 6:17 am
I found this recently:
if powershell is installed on the server, you can use that to add yourself (your domain login) as a sysadmin;
this example does the same thing by running sqlcmd under a different user context from a scheduled task; i'll try and find the powershell linky too:
the advantage is you don't have to stop and start the server, or bring it to single user mode or anything.
http://sev17.com/2011/10/22/gaining-sql-server-sysadmin-access/
Lowell
March 27, 2013 at 6:20 am
Thanks everyone for the reply..
Will try and let you all know..
March 27, 2013 at 7:15 am
I have admin previleage in that machine..
I stopped sql server and agent and started sql server using net start mssqlserver -m
when i tried to connect using SQLCMD -U domain\user -P password..it failed..what to do next??
March 27, 2013 at 7:19 am
no username or password.
here's some detailed instructions:
from the machine itself,
sqlservr -m"SQLCMD"
then when connected, add yourself or a new admin:
CREATE LOGIN [testAdmin] WITH PASSWORD=N'test@1234', DEFAULT_DATABASE=[master];
EXEC sys.sp_addsrvrolemember @loginame = N'testAdmin', @rolename = N'sysadmin';
GO
Lowell
March 27, 2013 at 7:19 am
Ratheesh.K.Nair (3/27/2013)
I have admin previleage in that machine..I stopped sql server and agent and started sql server using net start mssqlserver -m
when i tried to connect using SQLCMD -U domain\user -P password..it failed..what to do next??
You don't need to use -U -P you need to use trusted connection -T
March 27, 2013 at 7:29 am
Thanks a lot it worked
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply