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....

Comments

Angel said…
hi,
What this 2 line means...

SET ARITHABORT OFF
SET ANSI_WARNINGS OFF
Sandeep said…
@Angel : this two lines will help to ignore arithmetic error

Popular posts from this blog

Light-weight Popup using CSS and Javascript..

Publish webservice locally without separate hosting

Select Multiple Checkbox with Shift key in Gridview by javascript