In MS SQL Server 2008, you can use a CASE statement to conditionally execute different program segments based on the value of a variable
DECLARE @NEW INT
SET @NEW = <your_value_here>
CASE
WHEN @NEW < 40 THEN
WHEN @NEW >= 40 AND @NEW < 100 THEN
WHEN @NEW >= 100 AND @NEW <= 500 THEN
ELSE
END;