Posts

Showing posts from February, 2016

Divide by zero error encountered in SQL Server

Image
        Msg 8134, Level 16, State 1, Line 1       Divide by zero error encountered.         select col1 / col2 from tbl         select  12 / 0                         if col2 field value as Zero then You get      Divide by zero error encountered. Error on Your SP.   You Can USE  NULLIF   SQL   Function to Solve this Problem.            select   col1 / NULLIF ( col2 , 0 )