Name = @Name,
Phone = @Phone,
Email = @Email,
VerifyPhone = CASE WHEN Phone = @Phone THEN VerifyPhone ELSE 0 END,
VerifyEmail = CASE WHEN Email = @Email THEN VerifyEmail ELSE 0 END
Id = @Id
You don't want to set the
if the values are the same, in case the existing values haven't been verified yet. Otherwise a user can skip your verification process entirely by simply updating their details without changing them.