sql server - How to set CHECK_POLICY OFF in the sql script -
while installing our software in hp laptop, got sql error stating "the password not meet windows policy requirements because short."
when checked, local security policy in machine has minimum 8 characters , in laptop has 12 characters. our sql password has 11 characters. why not installed in laptop alone.
we can increase password more 12. maybe in future minimum password requirement can change 20 characters. thought of disabling password check. since new sql, don't know add condition check. have 2 sql script. code snippet 2 scripts shown below. please let me know add it.
script1:
alter login [sa] password=n'mssql2008!' go if exists (select * syslogins name = 'teradyne') begin alter login [teradyne] password=n'sql_pwd' end go
script2:
go exec ('if not exists (select * syslogins name = ''clientsoftware'') exec sp_addlogin @loginame=''clientsoftware'', @passwd=''ter_sql_pwd'' ') go checkpoint go
where sql_pwd = software1!
both scripts.
please let me know add check_policy , whether need add check_expiration
for alter login
statement, can use
alter login [teradyne] password=n'sql_pwd' , check_policy = off
you can't sp_addlogin
procedure, , create login
preferred method.
if need use sp_addlogin
, pre-hash password, wouldn't recommend beginner. see http://technet.microsoft.com/en-us/library/ms173768.aspx , http://technet.microsoft.com/en-us/library/ms189828.aspx
Comments
Post a Comment