Introduction
The LOGINPROPERTY () function is used to find the information about the login policy settings. This function is used to get the time of the last attempt to log in with an incorrect password.
The syntax of the LOGINPROPERTY () function is as follows:
Syntax: LOGINPROPERTY ( 'login_name' , 'property_name' )
It takes the following arguments.
- login_name - The name of an SQL Server login for which the login property status will be returned.
- property_name - an expression that contains the property information to be returned for the login. Here, the property value is 'BadPasswordTime'.
- Return Type: The Return type depends on the requested value. For the BadPasswordTime, the return type is datetime.