Creating a password expiration interval for a new login

Use sp_addlogin to set the password expiration interval for a new login.

This example creates the new login “joe” with the password “Djdiek3”, and sets the password expiration interval for “joe” to 2 days:

sp_addlogin joe, "Djdiek3", null, null, null, 2

The password for “joe” expires after 2 days from the time of day the login account was created, or 2 days from when the password was last changed.

See sp_addlogin in the Reference Manual: Procedures.