@ ERROR an integer 0 is returned as normal
@ ERROR an integer 0 is returned as normal
Mssql
Error LOG File storage location: C: \ Program Files \ Microsoft SQL Server \ MSSQL \ LOG view in Notepad
@ ERROR an integer 0 is returned as normal
System Table of error messages stored in sysmessages (master)
USE master
Select * from sysmessages where error = error number: the cause of the error can be queried.
RAISERROR (50009, 16, 10) can be used in the trigger to throw an error, where 50009 is the error number, or the error message description 16 10 specific rows and columns can be customized
You can also define custom messages.
Add custom messages to sysmessages.
USE master
EXEC sp_addmessage 50001, 16,
N' Percentage expects a value between 20 and 100.
Please reexecute with a more appropriate value. ', 'us _ english', false, replace
EXEC sp_addmessage 50001, 16, 'employee code not found ', 'simplified Chinese', false, replace
The us_english version must be added in 50001 16, and then the 'simplified Chinese' must be added'
Replace means that if there is a 50001 number information, it will be replaced by the new information