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', 'Simplified Chinese', false, replace not found
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
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.