min special char in password specifies the minimum number of special characters for a password. Valid values are:
0 through 16 – the minimum number of special characters required for a password.
-1 – the password cannot contain special characters.
By default, this password complexity option is turned off and this check is not applied to passwords.
To set the minimum number of special characters in a password, enter:
sp_passwordpolicy 'set', 'min special char in password',number
For example, if you set min special char in password to
3, you can create a new login johnd
with
the password abcDE1&#$
,
by entering:
sp_addlogin, 'johnd', 'abcDE1&#$'
However, if you set the new login johnd
to
have a password of abcDE1#
:
sp_addlogin, 'johnd', 'abcDE1#'
and the number of special characters is still set to 3, the command fails.