Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2005-12-01 : 12:02:06
|
Need help with the syntax of RAISE ERRORI would like to have the message recorded in the sql server logs and return the error to the calling applicationPlease note, I work for a university... this is not a student projectdeclare @UNDERGRADUATE_STUDENT as intselect @UNDERGRADUATE_STUDENT = isnull(@UNDERGRADUATE_STUDENT, 0)if @UNDERGRADUATE_STUDENT = 0 RAISERROR ('The ''UNDERGRADUATE_STUDENT'' Web Template does not exist or its description has changed. Use EMS Client Application to resolve this issue', 19, 1)Server: Msg 2754, Level 16, State 1, Line 5Error severity levels greater than 18 can only be specified by members of the sysadmin role, using the WITH LOG option.Tried RAISERROR ('The ''UNDERGRADUATE_STUDENT'' Web Template does not exist or its description has changed. Use EMS Client Application to resolve this issue', 19, 1, WITH LOG)ReturnedServer: Msg 156, Level 15, State 1, Line 5Incorrect syntax near the keyword 'WITH'. You can do anything at www.zombo.com |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-12-01 : 12:40:30
|
| If the creater of procedure (or the executor of a script) is someone not of sysAdmin fixed server role then severity level can not be greater than 18.WITH LOG option can be specified with any severity level and the syntax would be:raiserror ('<msg>', 18, 1) with logBe One with the OptimizerTG |
 |
|
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2005-12-01 : 12:59:08
|
Thank you!!!;) You can do anything at www.zombo.com |
 |
|
|
|
|
|
|
|