When you create it, you must first create it in English, or you will get an error:
You must add the us_english version of this message before you can add the ' Simplified Chinese ' version.
EXEC sp_addmessage 50001, ' option wrong ', ' us_english '
EXEC sp_addmessage 50001, 15, ' Operation error ', ' Simplified Chinese '
Exception thrown in code addition:
RAISERROR (50001,16,1)
Execution Result:
Msg 50001, Level 16, State 1, line 2nd
Operation Error
To modify the exception information content:
EXEC sp_addmessage 50001, 15, ' Operation S error ', ' Simplified Chinese ', false, ' REPLACE '
Finally, you can delete:
EXEC sp_dropmessage 50001, ' option wrong ', ' us_english '
EXEC sp_dropmessage 50001, 15, ' Operation error ', ' Simplified Chinese '
The complete command format is described in:
Ms-help://ms. Sqlcc.v10/ms. Sqlsvr.v10.zh-chs/s10de_6tsql/html/54746d30-f944-40e5-a707-f2d9be0fb9eb.htm created, you must first create English, otherwise you will get an error:
You must add the us_english version of this message before you can add the ' Simplified Chinese ' version.
EXEC sp_addmessage 50001, ' option wrong ', ' us_english '
EXEC sp_addmessage 50001, 15, ' Operation error ', ' Simplified Chinese '
Exception thrown in code addition:
RAISERROR (50001,16,1)
Execution Result:
Msg 50001, Level 16, State 1, line 2nd
Operation Error
To modify the exception information content:
EXEC sp_addmessage 50001, 15, ' Operation S error ', ' Simplified Chinese ', false, ' REPLACE '
Finally, you can delete:
EXEC sp_dropmessage 50001, ' option wrong ', ' us_english '
EXEC sp_dropmessage 50001, 15, ' Operation error ', ' Simplified Chinese '
The complete command format is described in:
Ms-help://ms. Sqlcc.v10/ms. Sqlsvr.v10.zh-chs/s10de_6tsql/html/54746d30-f944-40e5-a707-f2d9be0fb9eb.htm
MSSQL Create custom exception