SQL Server Performance


Discussion in 'General DBA Questions' started by Chappy, Jan 22, 2003.

  1. Chappy New Member

    I'm trying to add error reporting to a stored procedure, using RAISEERROR. Ideally I want ADO to report it in the same way as if it was bad sql (ie, back in the client app ADO raises an exception, which can then be handled).

    However, using raise_error is not causing this behavoir. In query analyser, my error message is simply printed, but not in red like other system errors. I think this indicates the difference.

    RAISERROR('Manufacturer does not exist', 1, 2) WITH SETERROR

    Any advice please ?
  2. satya Moderator

    Had you look at severity levels and under sysmessage for raiseerror?

    Satya SKJ
  3. royv New Member

    The severity of the error needs to be 16 or higher, otherwise it will not return into the ado error collection.

    "How do you expect to beat me when I am forever?"
  4. Chappy New Member

    Thanks royy. Perhaps I should have been scouring the ADO docs instead of books online ones <img src='/community/emoticons/emotion-1.gif' alt=':)' />

Share This Page