Sunday, March 25, 2012

Changing authentication mode in TSQL?

Is there a TSQL statement that will allow you to change
the authentication mode from 'Windows Authentication'
to 'Mixed Mode'?
Thanks in advance!You can use the undocumented xp_regwrite/xp_instance_regwrite to change the
registry key that contols this (which is what EM does anyway) or use SQLDMO
but it needs a SQL Service restart to take effect e.g.
exec master..xp_instance_regwrite N'HKEY_LOCAL_MACHINE',
N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer',
'LoginMode', N'REG_DWORD', 2
'Set security mode to mixed where oSQL is a SQLServer object
Set oSEC = oSQL.IntegratedSecurity
oSEC.SecurityMode = 2
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Bill Fee" <william.fee@.compuware.com> wrote in message
news:132701c37266$f9ad2310$a601280a@.phx.gbl...
Is there a TSQL statement that will allow you to change
the authentication mode from 'Windows Authentication'
to 'Mixed Mode'?
Thanks in advance!

No comments:

Post a Comment