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 user roles, not system roles.
Example 1 Changes the password expiration interval for the login “joe” to 5 days:
sp_modifylogin "joe", @option="passwd expiration", @value="5"
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.