Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve Severity from SqlException 1

Status
Not open for further replies.

andegre

MIS
Oct 20, 2005
275
US
What is the severity level in a tsql 'RAISERROR' statement mapped to in a SqlException?

TIA
 
you may want to check in forum183. but the sql error isn't so much about severity in .net. all exceptions are equal. the SqlException is the base exception to all SqlClient exceptions. you can access the ErrorCode and Errors collection to determine the exact sql error.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Thanks Jason, I have developers hard-coding there own "RAISERROR" statements with their own exception messages, but they all put severity 16 so I wanted to watch for that severity level and do 'x' programming based on that level...sounds like I can't do that unless I put some kind of distingusing value in the exception message...

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top