SQL Server - 使用raiserror而没有状态事故

时间:2022-07-03 01:54:12

I wanted to user RAISERROR in my SQL-Server codes but I noticed that some status code have interruption with built-in SQL Error statuses...

我想在我的SQL-Server代码中使用RAISERROR,但我注意到一些状态代码中断了内置的SQL Error状态......

for example status code "1" is used for "Devide By Zero Error", And I dont wanna use it any more... now I want to see what status codes are safe to use withour interruption ?

例如状态代码“1”用于“Devide By Zero Error”,我不想再使用它了...现在我想看看哪些状态代码可以安全使用而且中断?

1 个解决方案

#1


1  

If you want to use your own msgid use a value of greater then 50000. The values below 50000 are reserved for built in messages. To see the list of existing messages you can do a 'select * from sys.messages'. 50000 is used when a value for msgid is not provided.

如果要使用自己的msgid,请使用大于50000的值。低于50000的值保留用于内置消息。要查看现有消息列表,您可以执行“select * from sys.messages”。如果未提供msgid的值,则使用50000。

#1


1  

If you want to use your own msgid use a value of greater then 50000. The values below 50000 are reserved for built in messages. To see the list of existing messages you can do a 'select * from sys.messages'. 50000 is used when a value for msgid is not provided.

如果要使用自己的msgid,请使用大于50000的值。低于50000的值保留用于内置消息。要查看现有消息列表,您可以执行“select * from sys.messages”。如果未提供msgid的值,则使用50000。