Trigger password reset delay
Posted on 2005-04-20
I have a simple table which has primary key[userid] column, [disable] column, [failcount] column. I have the main part of the trigger working where it automatically resets the users [failcount] and [disable] to 0. I can't seem to get working is the what if statement and the waitfor delay statement. Example: If disable column isn't updated then do nothing, otherwise pause for 10 minutes and then set disable and failcount to zero values. Any help much appreciated. Its basically a automatic password reset trigger.
CREATE TRIGGER AccountUnlock on UserAccount
waitfor delay "0:10:00"
Set Disable = 0, failcount = 0
From UserAccount as A
Inner Join Inserted as B
on A.UserID = B.UserID
Where coalesce(b.Disable,0) = 1
'Else do nothing and end trigger because user account isn't disabled