System Procedure Syntax - %%

  • Hey All,

    I am playing with fire here, and I am impatient. So I am fooling around with a system stored procedure. Specifically, msdb.sys.sp_altermessage. I am curious about some of the syntax used.

    Anyone have any idea about the double percent operator/modifier/naming convention?

    EXEC %%ErrorMessage(ID = @message_id).SetEventLog(EventLog = @log)

    I am also curious as to why I can't call that directly, or apparently alter the procedure that contains it...

    Anyway - Thanks!

    -Dan B

  • You can't do anything to the 'sys' objects, unless you are 'sys' and you cannot make yourself 'sys'. The sys scripts contain some weird syntactic conventions to indicate things that were done in their compilation (or that are just "represented" there) that cannot actually be done with T-SQL.

    You particular example looks to me like a reference to a class/object method for a class or object type that we do not actually have. (I'm just guessing here)

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • RBarryYoung,

    Thanks for the reply. I figured as much, but am ever hopeful for the hack/cheat.

    I am lucky that SP3 will resolve my need in this case, however I still wanted to play a bit. 🙂

    Sincerely,

    Dan B

  • Thanks for the feedback.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply