FORMATMESSAGE
system function
What changes
- Input
- arguments or engine/session state
- Output or change
- value
- Return type
- nvarchar
Syntax at a glance
FORMATMESSAGE ( { msg_number | ' msg_string ' | @msg_variable} , [ param_value [ ,...n ] ] )
Work example
Format a message from a registered message id or format string.
Read state in the intended scope and immediately after the statement it describes. Treat host values as untrusted.
Check your work Use fixed templates and parameters rather than concatenating untrusted SQL text.
Open Microsoft Learn for full syntax, permissions, and details for your version.