Error Handling

Hi All,

I am using sql server 2014. I would like to know what are the best ways of error handling while querying sql server for CRUD operations and stored procedures. This is for enterprise web application. I would like a suggestion or kind of guidelines that would make use of latest features 2014 edition has to offer. If any features are not available in 2012 i would like to know too.

Thanks for your time.
Who is Participating?
Eugene ZCommented:

and starting sql 2012

you can use
THROW statement (Transact-SQL)

it raises an exception and transfers execution to a CATCH block of a TRY…CATCH construct in SQL Server 2014.

New THROW statement in SQL Server 2012 (vs RAISERROR)

more see  examples
Handling Errors in SQL Server 2012

Structured Error Handling Mechanism in SQL Server 2012
Vitor MontalvãoMSSQL Senior EngineerCommented:
Jyozeal, do you still need help with this question?
JyozealAuthor Commented:
I think i am good, i was like kind of developing a checklist for error handling in database development. So i though more answers will be helpful.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.