Thursday, March 22, 2012

changing the authenticaon mode

How can I change the authentication mode with t-sql?

Here you go...

Code Snippet

xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer', 'LoginMode', N'REG_DWORD', 1 -- Windows Only

xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer', 'LoginMode', N'REG_DWORD', 2 -- Mixed Mode (Windows & Sql Server)

reconfigure with override

After the execution restart the sql server..(other wise the changes will not be taken effect)

No comments:

Post a Comment