June 14, 2006 at 9:52 am
Hi,
I'm new to SQL server. I have a ASP.NET app with SQL2000 where I implement account lockout after 6 times user failed login by adding a field in User table "LoginAttempts". My question is there any timer in sqlserver I can use in the trigger when that field get update to 6. I need to automatic unlock the account after 30 minutes by reset the field "LoginAttempts" back to zero. Thanks
June 14, 2006 at 12:47 pm
Does any 30 minute period reset the loginattempts back to zero? I would not use a trigger for this. Putting it in a trigger would cause the trigger to be active for up to 30 minutes.
I would add a datetime column into the table and log the date of the last failed login attempt. Then you have two options. You could create a job that runs every minute that resets the loginattempts for people who have six failed attempts with the last one being at least 30 minutes ago. Otherwise, you can rework your query to take into account the datefield when you are determining if the account is locked or not.
Brian
June 14, 2006 at 12:58 pm
Thanks for your quick reply Brian,
Adding that datetime colum works for me. Why didn't I think of that, ughh. Thanks again.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply