embedding variable values in raise_application_error error message
raiserror 100000 'Function %1! is not known.', @function_name
This syntax causes the value of @function_name to be placed in the resulting error message at the position identified by "%1!". These messages are sent to client programs
I can not find nor deduce a similar capability in raise_application_error(), resorting to adding some extra code to hand-construct the error message into a error message variable and then using it in the raise_application_error(). For some data types and complex error messages we have, this adds some considerable complexity to the porting effort.