1

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.

enter image description here

1
  • 1
    Do you see the "Script" button on the top of that dialog? It's there to help you with this. Commented Dec 13, 2019 at 20:00

2 Answers 2

4

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/

Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.