SQL Server 2008错误 [英] SQL Server 2008 error

查看:121
本文介绍了SQL Server 2008错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Msg 50000, Level 16, State 0, Line 10
Divide by zero error encountered.





这里我用过Raiserror



这是什么



MSG 50000 ---> ???代表

等级16 ---> ???代表

状态0 ---> ???代表

行---> 10 ???代表



here i have used Raiserror

what does this

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

推荐答案

基本上,它说有一个问题,可能是您的RAISERROR语句。

MSG 50000保留 - 系统当指定msg_str时生成这个。

级别16是严重性 - 作为用户,您可以生成0到18之间的任何严重性

状态0是一个可以选择的数字用于识别大型查询的哪个部分产生错误。

第10行是输入查询中的行号,SQL注意到该问题(这并不意味着它在第10行,但它不会太远了。



请参阅MSDN RAISERROR [ ^ ]



如果没有看到引发异常的代码,我们无法提供更多帮助,但仔细查看您的RAISERROR语句 - 看起来像是哟你有一个小错误。



想一想,我知道你的代码是什么样的:



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:

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


这篇关于SQL Server 2008错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆