Use sp_modifylogin to change the password expiration interval for an existing login, add a password expiration interval to a login that did not have one, or remove a password expiration interval. sp_modifylogin only effects login passwords, not role passwords.
Example 1 Changes the password expiration interval for the login “joe” to 5 days:
sp_modifylogin "joe", @option="passwd expiration", @value="5"
The password expires 5 days from the time of day you ran password expiration.
password expiration interval specifies the password expiration interval in days. It can be any value between 0 and 32767, inclusive. For example, if you create a new login on August 1, 2007 at 10:30 AM, with a password expiration interval of 30 days, the password expires on August 31, 2007 at 10:30 AM
The value parameter is a character datatype;
therefore, quotes are required for numeric values.
Example 2 Changes the value of the overrides for the password expiration for all logins to 3 days”:
sp_modifylogin "all overrides", @option="passwd expiration", @value="3"
Example 3 Removes the value of the overrides for the password expiration for all logins:
sp_modifylogin "all overrides", @option="passwd expiration", @value="-1"
For details on the syntax and rules for using passwd expiration, see sp_modifylogin in the Reference Manual: System Procedures.