Is there any way to check this radio button with a T-SQL command? I'm trying to script our database setup and this was one of the things that hung me up.
2 Answers
Try this:
SELECT CASE SERVERPROPERTY('IsIntegratedSecurityOnly')
WHEN 1 THEN 'Windows Authentication'
WHEN 0 THEN 'Windows and SQL Server Authentication'
END as [Authentication Mode]
https://www.sqlserverlogexplorer.com/recognize-authentication-mode-in-sql-server/
Comments
To change the setting you need to change the registry, which can be done in SQL Server with:
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO
As mentioned in the comment, making the change in the UI, and then "Script action to New Query Window" will give you this answer as well.
