A Microsoft SQL Server instance has a database named Employees. The database contains information about employees including their salary.
You must create a custom system message as an alert when an error is raised.
You need to create the custom message in the sys.messages table.
Which argument insp_addmessage should you configure?
A . @1ang
B . @with_log
C . @replace
D . @severity
Answer: D
Explanation:
The following example adds a custom message to sys.messages.
USE master;
GO
EXEC sp_addmessage 50001, 16,
N’Percentage expects a value between 20 and 100.
Please reexecute with a more appropriate value.’;
GO
Syntax:
sp_addmessage [ @msgnum= ] msg_id , [ @severity= ] severity , [ @msgtext= ] ‘msg’
[ , [ @lang= ] ‘language’ ]
[ , [ @with_log= ] { ‘TRUE’ | ‘FALSE’ } ]
[ , [ @replace= ] ‘replace’ ]
References: https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-addmessage-transact-sql?view=sql-server-2017
Leave a Reply