Friday, January 15, 2010

SQL Server SA Login Disabled and Can Not Login To Server

I needed to fix the login issue on newly installed SQL Server 2008 developer edition for a developer who is just starting to work. The tech who prepared the workstations forgot to add the local admin and the AD user account and he was out of the office. So even with the local administrator account no one can log in to SQL Server. Thanks to new security settings of SQL Server 2008. I did a little research and found out the solution. Here is the list of actions for the solution. First open the SQL Server Configuration Manager.

1. Stop SQL Server Service.
2. Double click on SQL Server service and goto advanced tab.
3. add -m; to the beginning of Startup Parameters
4. Start SQL Server Service
5. Open command prompt and connect to your the server using SQLCMD
6. Create a log in (CREATE LOGIN BillGates WITH PASSWORD = 'password')
7. Now add the log in to sysadmin group (EXEC sp_addsrvrolemember 'BillGates','sysadmin')
8. Remember you need to issue GO command to execute the commands.
9. Once you created the login and add it to sysadmin role go to SQL Server Configuration Manager.
10. Stop SQL Server service.
11. Remove -m; from startup parameters.
12. Start SQL Server Service and login with the user that you just created.
13. Now you have sysadmin rights.

HTH,

Bulent

No comments:

Post a Comment