You are here: sp_add_message - Internals Mystery - Help!!!! « MsSQL Server « IT news, forums, messages
sp_add_message - Internals Mystery - Help!!!!

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация