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 |
|
vladimir_grigoro
Yak Posting Veteran
62 Posts |
Posted - 2004-07-12 : 03:09:39
|
| Is there any chance to solve this problem:Server: Msg 8134, Level 16, State 1, Procedure XXX, Line 19Divide by zero error encountered.I mean to hide this error to solve the problem in other way?The Rebel |
|
|
ravilobo
Master Smack Fu Yak Hacker
1184 Posts |
Posted - 2004-07-12 : 03:44:48
|
| How u got this error? Can you post the sql...------------------------I think, therefore I am |
 |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-07-12 : 03:47:44
|
| I think it's best to handle the zero divide in your code:create table #test(Val1 int, val2 int)insert into #test values(10, 0)insert into #test values(10, 2)select case when val2 = 0 then 0 else val1 / val2 end from #testdrop table #test--****** The other option would probably be to: set arithabort off This is not recomended though.Duane. |
 |
|
|
|
|
|