Ads 720 x 90

Disable Password Policy while creating Logins

This is what happened when one of my colligue used the same script to ass a new 'login' account in sql server, previously he ws using SQL Server 2000 and he run the same script on hus 2005 machine

Script :

exec sp_AddLogin 'user1' , ''

when you run the same script, sql sever 2005 will throw error

Msg 15118, Level 16, State 1, Line 1
Password validation failed. The password does not meet Windows policy requirements because it is not complex enough

As far as I know, sp_addLogin is deprecated in sql server 2005, so i asked him to use the

But the thing he was talking about was, they wont be able to put a complex password, since by default it is creating the login with the name and password same as that of the Database name

So the next step was to disable the Password policy, We have the option to disable the password policy in CREATE LOGIN but Not in sp_AddLogin

the outcome was to use 'CHECK_POLICY = OFF' and the final Query looks like

CREATE LOGIN user1 with Password ='', CHECK_POLICY = OFF

Related Posts

Total Pageviews

Subscribe Our Newsletter