Link to home
Start Free TrialLog in
Avatar of maqskywalker
maqskywalker

asked on

using RAISERROR in SQL Server query

I'm using SQL Server 2008

I was looking at the RAISERROR documentation on this page:
https://docs.microsoft.com/en-us/sql/t-sql/language-elements/raiserror-transact-sql?view=sql-server-2017

So the syntax is this:

User generated image
the first part is string message, then severity, then state

Then towards the bottom of the page it has this example with severity of 10 and state of 1:

User generated image
What does a severity of 10 mean?
What does a severity of 16 mean?
What does a state of 1 mean?
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maqskywalker
maqskywalker

ASKER

I saw this chart on severity levels in the book sql server 2008 bible in the image link below.

Right now when I set the severity level to 16 the error message displays in a window with ok button, if I press ok button the stored procedure doesn’t finish and exits.

So if I set the severity level to something other than 16 is there way that the message still displays (as more of a reminder), then if I press ok on the button in the window then I want the rest of the stored procedure to finish running?
75CD8C16-6977-45F4-9D0A-8805786DE1F.jpeg
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks