Click here to Skip to main content
15,912,897 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Msg 50000, Level 16, State 0, Line 10
Divide by zero error encountered.


here i have used Raiserror

what does this

MSG 50000--->??? stands for
Level 16 ---> ??? stands for
State 0 ---> ??? stands for
Line --->10 ??? stands for
Posted

1 solution

Basically, it's saying that there is a problem, probably with your RAISERROR statement.
MSG 50000 is reserved - the system generates this when msg_str is specified.
Level 16 is the severity - as a user, you can generate any severity between 0 and 18
State 0 is a number that can optionally be used to identify what part of a large query produced the error.
Line 10 is the line number on the input query at which SQL noticed the problem (this doesn't mean it is on line 10, but it'll be not far off).

See the MSDN for RAISERROR[^]

Without seeing your code that threw the exception, we can't help much more, but look closely at your RAISERROR statement - it looks like you have a small error in it.

Thinking about it, I know what your code looks like:

SQL
RAISERROR('Divide by zero error encountered', 16, 0)

And I would expect to get what you did from it:
Msg 50000, Level 16, State 0, Line 4
Divide by zero error encountered
 
Share this answer
 
v2
Comments
tpkpradeep 3-Sep-13 7:38am    
BEGIN CATCH
DECLARE @ERRMSG NVARCHAR(MAX)
SELECT @ERRMSG =ERROR_MESSAGE();

RAISERROR(@ERRMSG,16,0);
END CATCH


Actually my catch Block Looks Like this...!!!
OriginalGriff 3-Sep-13 11:07am    
Close enough! :laugh:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900