Retrieves stored message strings from sysmessages and sysusermessages for print and raiserror statements.
sp_getmessage message_num, result output [, language]
declare @myvar varchar(200) exec sp_getmessage 20001, @myvar output
declare @myvar varchar(200) exec sp_getmessage 20010, @myvar output, french
Any application can use sp_getmessage, and any user can read the messages stored in sysmessages and sysusermessages.
See also
print, raiserror in Reference Manual: Commands.
Any user can execute sp_getmessage. Permission checks do not differ based on the granular permissions settings.
Values in event and extrainfo columns from the sysaudits table are:
Information | Values |
---|---|
Event | 38 |
Audit option | exec_procedure |
Command or access audited | Execution of a procedure |
Information in extrainfo |
|