To check if value is even or odd in SQL. we can use Modulo operator (‘%’) to do it and its usage is explained as shown below-

 


DECLARE @intEven int = 38,  @intOdd int = 37;

SELECT  CAST(@intEven AS Varchar) + ' --> ' + CASE WHEN(@intEven % 2)=0 THEN 'EVEN' ELSE 'ODD' END
  ,CAST(@intOdd AS Varchar) + ' --> ' + CASE WHEN(@intOdd % 2)=0 THEN 'EVEN' ELSE 'ODD' END