Shortly after I installed MS SQL Server 2008 on my machine, I forgot the password AND username that I chose. How can I reset them?
This question seems promising, but it didn’t work for me.
When I tried exec sp_password @new='changeme', @loginame='sa' as a query, I received:
Msg 15151, Level 16, State 1, Line 1
Cannot alter the login 'sa', because it does not exist or you do not have permission.
Try following the instructions from this blog post entitled Disaster Recovery: What to do when the SA account password is lost in SQL Server 2005. It applies to SQL Server 2005, but should probably work with SQL Server 2008 as well.
You need to start SQL Server in single user mode using the
-mcommand line switch. When SQL Server has started, a Windows administrator can connect to SQL Server using Windows authentication. You can then reset the password of thesauser. Make sure to restart SQL Server without the-mcommand line parameter afterwards.