eek
eek

Reputation: 724

Can I use SQL Authentication to log into SQL Server 2008 that was set up with Windows authentication?

I have a SQL server on my local machine that was only ever set up for windows authentication. At the login screen, it would show HOSTNAME\SQLSERVER and then I'd log in using Windows authentication.

I've been moved to a new machine with a different hostname, and the database has also been moved. But I can't log-in since the Windows username is different. How can I get into the database? I want to login using the "sa" account from now on. SQL Server 2008

Upvotes: 0

Views: 483

Answers (1)

SQLRockstar
SQLRockstar

Reputation: 156

You need to alter the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQLServer where MSSQL10.MSSQLSERVER is the name of your current instance.

It should say "1" now, for Windows. Change it to "2", for Mixed.

I believe the initial SA password at this point will be blank. However, it is possible that the SA password was set to something already, so you may not be able to login using SA even after altering the registry.

You can read more at: http://www.mssqltips.com/sqlservertip/1441/correct-the-sql-server-authentication-mode-in-the-windows-registry/

Good luck.

Upvotes: 2

Related Questions