Tuesday, February 14, 2012

Handle Devide By Zero Error

Hi ..
set Arithaboth and Ansi_Warnings as OFF to handle devide by Zero or any kind of arithmatic errors

SET ARITHABORT OFF
SET ANSI_WARNINGS OFF
Declare @Denominator int =0
Declare @Numerator int =5
SELECT isnull(@Numerator / @Denominator,0) as Result


happy coding....