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 |
|
rajkumarrai_bis
Yak Posting Veteran
78 Posts |
Posted - 2007-01-25 : 20:30:25
|
| I Am not able to suppress system generated error message thruerror handling code in SQL Server 2000Code is Followingbegin transactionselect 1/0if @@error<>0 begin rollback;print 'rollback'endelsebegin commit; print 'Commited'endError is FollowingServer: Msg 8134, Level 16, State 1, Line 2Divide by zero error encountered.rollbackwe want to print only rollback and supress system error message Is there any way to do this..This is urgentPlz help |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-01-25 : 20:35:53
|
| Why is this urgent?CODO ERGO SUM |
 |
|
|
PurpleSun
Yak Posting Veteran
50 Posts |
Posted - 2007-01-26 : 16:11:48
|
This error comes from sysmessages table of the Master database. It has severity of 16 and if i remember correctly errors with severity of 11 or higher cannot be suppressed. Of course you can try to remove the record with this error from sysmessages table of the Master database, but i don't think it's a good idea.quote: Originally posted by rajkumarrai_bis I Am not able to suppress system generated error message thruerror handling code in SQL Server 2000Code is Followingbegin transactionselect 1/0if @@error<>0 begin rollback;print 'rollback'endelsebegin commit; print 'Commited'endError is FollowingServer: Msg 8134, Level 16, State 1, Line 2Divide by zero error encountered.rollbackwe want to print only rollback and supress system error message Is there any way to do this..This is urgentPlz help
|
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-01-27 : 03:42:23
|
| We check for divide by zero on the code, rather than let SQL have to catch the error, and handle appropriately.SQL2005 may be able to CATCH the error more gracefully, but I haven't tried it.Kristen |
 |
|
|
|
|
|