Tuesday, April 16, 2013

SQL Server 2008 database engine login failed for administrator user in windows 7/8


I am administrator in my machine windows 8, But I cannot login to SQL using my administrator user.
Problem I installed SQL using other user and I didn't remember its password to solve this problem I followed the following steps:
  1. Open the command prompt (Right-Click on and select "Run As Administrator")
  2. From the command prompt type net stop MSSQLSERVER
  3. Next type net start MSSQLSERVER /m
  4. Open SQL Server Management Studio. Do not login, cancel the login dialog.
  5. From the file Menu select New->Database engine query, and login (Make sure you use the host name and not localhost).
  6. Execute the query ALTER LOGIN sa WITH PASSWORD = ''; to reset the password (if the sa is not enabled then type ALTER LOGIN sa ENABLE to do so)
  7. Login with the sa user and add the Administrator user.

No comments: