Mssql @ ERROR

Source: Internet
Author: User
@ 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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.