Raise exception in stored procedure

  • Thread starter Thread starter Oleg Ogurok
  • Start date Start date
O

Oleg Ogurok

Hi all,

Could someone please point me to any docs explaining how to raise exceptions
in stored procedures and catch them in C# ?
Thanks,

Oleg.
 
You can raise an exception in a stored procedure with RAISERROR and
supplying a severity level -- this is all documented in SQL Books
Online. You can catch any SqlError in your try/catch block that has a
severity level of between 11 and 16 by looping through
SqlException.Errors.

-- Mary
MCW Technologies
http://www.mcwtech.com
 
Back
Top