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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EugeneZ ZhitomirskySQL SERVER EXPERTCommented:

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.