Last statement in a stored procedure running in production:
SELECT @ReturnStatus = @@ERROR
IF(@ReturnStatus <> 0)
RETURN (@ReturnStatus)
IF(@ReturnStatus <> 0)
RETURN (@ReturnStatus)
Making things as simple as possible isn't just for self-congratulatory back-patting. It's because the next time you're looking at the code it will make it easier to understand what it's doing. So let's make it simple:
RETURN @@ERROR;