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:

syntax
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:

example
What does a severity of 10 mean?
What does a severity of 16 mean?
What does a state of 1 mean?
Microsoft SQL ServerMicrosoft SQL Server 2008SQL

Avatar of undefined
Last Comment
maqskywalker

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Pavel Celba

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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
EugeneZ

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
maqskywalker

ASKER
Thanks
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck