Adding a custom error : sp_addmessage « System Functions « SQL Server / T-SQL Tutorial






5> EXEC sp_addmessage
6>     @msgnum = 50005,
7>     @severity = 16,
8>     @msgtext = 'Problem with ProductIds %i, %i, %i'
9> GO
Msg 15043, Level 16, State 1, Server J\SQLEXPRESS, Procedure sp_addmessage, Line 137
You must specify 'REPLACE' to overwrite an existing message.
1>
2>








25.18.sp_addmessage
25.18.1.Adding Entries to sysmessages
25.18.2.Adding a message to the sysmessages table using the REPLACE option.
25.18.3.Adding a custom error