RaiseError() Output ???

  • Hi,

    When i execute the following statement in SQL SErver 2005

    RaiseError('Error' , 11,1)

    My applications throws a exception I do understand the difference is because of the error severity levels ...

    However

    when i execute RaiseError ('Error', 10,1)

    It does not throw any exception

    My Doubt being what will be the behavior in case of sql server 2000

    in case of RaiseError ('Error',10,1) and RaiseError('Error', 11 ,1) ....Does the error severity level in the two versions of SQL SErver mean the same?

    Thanks 🙂 ... i actually do not have access to a SQL Server 2000 machine to test ....

  • 0 to 10 informational messages

    11 to 16 user problems example, error message returned invalid update query

    17 Severity level 17 indicates that SQL Server has run out of a configurable resource

    18 Severity level 18 messages indicate nonfatal internal software problems.

    19 Severity level 19 indicates that a nonconfigurable resource limit has been exceeded.



    Nuke the site from orbit, its the only way to be sure... :w00t:

  • I do understand the what each of the severity levels but my question is related to the behaviour of the application which will be calling the stored procedure .... whether it will throw an exception in case of a raiseerror('error', 15,1) and continue working the same way in case of raiseerror('error' , 9, 1)

  • That would be dependent on the application error checking routines.



    Nuke the site from orbit, its the only way to be sure... :w00t:

  • i execute it as

    Try

    {

    SQLCommand Comm = new SQLCommand ("exec StoredProc", connection)

    Comm.executenonquery();

    }

    Catch

    {

    Throw;

    }

    in case of SQL Server 2005 on Comm.executeNonquery execution comes to throw becuase of raiseerror('error', 16,1) and does not enter the catch block in case of raiseerror("exec StoredProc", connection)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply