How to handle exception in sql server?
how to Handling exception in sql server using error code and return a formatted error to Application User Interface.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted May 2, 2013, 3:53 AM EDT
hi,
you can use Try catch block to handle exception in SQL Server
with this you can you RaiseError to throw formatted error.
BEGIN TRY
--do you work
END TRY
BEGIN CATCH
RAISERROR ('your formated massage', 1, 1);
END CATCH
hope this will help you.