The enforcement of password policy can be configured separately for each SQL Server login. Use ALTER LOGIN (Transact-SQL) to configure the password policy options of a SQL Server login. The following rules apply to the configuration of password policy enforcement:
-
When CHECK_POLICY is changed to ON, the following behaviors occur:
-
CHECK_EXPIRATION is also set to ON unless it is explicitly set to OFF.
-
The password history is initialized with the value of the current password hash.
-
When CHECK_POLICY is changed to OFF, the following behaviors occur:
-
CHECK_EXPIRATION is also set to OFF.
-
The password history is cleared.
-
The value of
lockout_time is reset.
Some combinations of policy options are not supported.
-
If MUST_CHANGE is specified, CHECK_EXPIRATION and CHECK_POLICY must be set to ON. Otherwise, the statement will fail.
-
If CHECK_POLICY is set to OFF, CHECK_EXPIRATION cannot be set to ON. An ALTER LOGIN statement that has this combination of options will fail.
Important: |
|---|
|
CHECK_EXPIRATION and CHECK_POLICY are only enforced on Windows Server 2003 and later versions.
|
Important: |
|---|
A known issue in Windows Server 2003 might prevent the bad password count from being reset after LockoutThreshold has been reached. This might cause an immediate lockout on subsequent failed login attempts. You can manually reset the bad password count by briefly setting CHECK_POLICY = OFF, followed by CHECK_POLICY = ON.
|
When SQL Server is running on Windows 2000, setting CHECK_POLICY = ON will prevent the creation of passwords that are:
-
Null or empty
-
Same as name of computer or login
-
Any of the following: "password", "admin", "administrator", "sa", "sysadmin"
The security policy might be set in Windows, or might be received from the domain. To view the password policy on the computer, use the Local Security Policy MMC snap-in (secpol.msc).