Prevent a user from connecting after exceeding the maximum failed login attempts.
This example creates a new login policy named lp, which automatically locks a user account after 5 failed attempts:
CREATE LOGIN POLICY lp max_failed_login_attempts=5
This example modifies an existing login policy named exist_lp, which automatically locks a user account after 5 failed attempts:
ALTER LOGIN POLICY lp max_failed_login_attempts=5
This example assigns the login policy lp to user John. Once John is assigned the lp login policy, he cannot log in if he enters invalid credentials five times in sequence.
ALTER USER John LOGIN POLICY lp