Search This Blog

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
' CREATE LOGIN '

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

1 comment:

John Walker said...

Thanks for sharing this article with us, I have found another informative article that shows how to fix SQL Server error 15118 via SSMS, T-SQL and CMD. Must read from here: https://ignaciosalom.com/2016/06/04/sql-server-error-15118-password-validation-failed/