A login or role can be locked when:
Its password expires, or
The maximum number of failed login attempts occur, or
The System Security Officer locks the login or role manually.
You can use the following commands or system procedure to lock or unlock logins and roles:
alter role
dataserver -u
sp_locklogin