Change Server Authentication Mode
SQL Server Management Studio
- In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.
- Click on Security and go to the Security page, under Server authentication, select the new server authentication mode, and then click OK.
- In Object Explorer, expand Security, expand Logins, right-click sa, and then click Properties.
- Click on Status and go to the Status page, in the Login section, click Enabled, and then click OK.
Transact-SQL
- In Object Explorer, connect to an instance of Database Engine.
- Right-click the server, click New Query.
- Copy and paste one of the following examples into the query window and click Execute.
The following example enables the sa login and sets a new password.
ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = '' ;
GO
The following example changes Server Authentication from mixed mode (Windows + SQL) to Windows only.
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer',
N'LoginMode', REG_DWORD, 1
GO