|
Posted by andyblum on 10/02/04 11:44
Due to legacy issues we want to modify sp_addmessage. I am able to
open it it up change the code I want to add but it wont compile.
All I am doing is changing:
-- Must be ServerAdmin to manage messages
if is_srvrolemember('serveradmin') = 0
begin
raiserror(15247,-1,-1)
return (1)
end
To this code:
if (not (is_srvrolemember('sysadmin') = 1)) and ((@severity > 18) or
(rtrim(upper(@with_log)) = 'TRUE'))
begin
raiserror(15042,-1,-1)
return (1)
end
When we recompile I get:
Msg 102, Level 15, State 1, Procedure sp_addmessage, Line 99
Incorrect syntax near '%'.
Msg 102, Level 15, State 1, Procedure sp_addmessage, Line 131
Incorrect syntax near '%'.
Msg 102, Level 15, State 1, Procedure sp_addmessage, Line 135
Incorrect syntax near '%'.
Msg 102, Level 15, State 1, Procedure sp_addmessage, Line 136
Incorrect syntax near '%'.
Msg 102, Level 15, State 1, Procedure sp_addmessage, Line 152
Incorrect syntax near '%'.
Msg 102, Level 15, State 1, Procedure sp_addmessage, Line 156
Incorrect syntax near '%'.
When we goto that line I see:
EXEC %%ErrorMessage(ID = @msgnum).Lock(Exclusive = 1)
What is the "%%" doing - Does this make it impossible to modify?
Thanks,
Andy
Navigation:
[Reply to this message]
|