Sometimes it is inevitable to encounter scenarios that will give division by zero errors

DECLARE @dividend INT
DECLARE @divisor INT
SET @dividend = 1
SET @divisor = 0
SELECT @dividend/@divisor
/* 
Error:
Msg 8134, Level 16, State 1, Line 7
Divide by zero error encountered.
*/

What you can do is you can code around it, so your users and your app do not get this error.
Read the rest of this entry »

VN:F [1.9.22_1171]
Rating: 8.7/10 (31 votes cast)
VN:F [1.9.22_1171]
Rating: +8 (from 8 votes)