Change Server Authentication Mode

SQL Server Management Studio

  1. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.
  2. Click on Security and go to the Security page, under Server authentication, select the new server authentication mode, and then click OK.
  3. In Object Explorer, expand Security, expand Logins, right-click sa, and then click Properties.
  4. Click on Status and go to the Status page, in the Login section, click Enabled, and then click OK.


Transact-SQL

  1. In Object Explorer, connect to an instance of Database Engine.
  2. Right-click the server, click New Query.
  3. 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