DECLARE @a SMALLINT DECLARE @b SMALLINT SET @a = 9 SET @b = 4 IF @a < @b SELECT 'A is less than B' ELSE IF @a > @b SELECT 'A is greater than B' ELSE SELECT 'Both are Equal'