Does RAISERROR
in a SQL Server stored procedure affect performance?
Would I be better off just having a try-catch wrapper around the whole procedure and just catch the errors in the database access layer?
Right now for logging in a user, I check if the user exists and RAISERROR
if the user does not exist. Would I better just let the procedure return null and interpret that in the database access layer?
Best Answer
I would not worry about performance in this situation.
I would go with raising an error for 2 reasons: