–Enable Windows Authentication (requires a restart of services)
USE [master]
GO
EXEC xp_instance_regwrite N’HKEY_LOCAL_MACHINE’,
N’SoftwareMicrosoftMSSQLServerMSSQLServer’, N’LoginMode’,
REG_DWORD, 1
GO
–Enable Mixed Mode Authentication (requires a restart of services)
USE [master]
GO
EXEC xp_instance_regwrite N’HKEY_LOCAL_MACHINE’,
N’SoftwareMicrosoftMSSQLServerMSSQLServer’,
N’LoginMode’, REG_DWORD, 2
GO