Can i rewrite these statements in a better way, using one update statement with a case in it or something or i just leave them like this and wrap in a transaction?
DECLARE @currentFailedPassCount int =
( SELECT FailedPasswordAttemptCount FROM Users WHERE Username=@username );
UPDATE Users
SET FailedPasswordAnswerAttemptCount=FailedPasswordAnswerAttemptCount+1
WHERE Username=@username;
IF(@currentFailedPassCount=5)
UPDATE Users
SET IsLockedOut=1
WHERE Username=@username;
Something like this:
I don’t think it reads as nicely (personal preference) but it’s a single statement.