SELECT * FROM Md.VehicleMakes VM WHERE IsCancelled = 0 AND (CASE WHEN ISNULL(@SearchText, '') <> '' THEN CASE WHEN  Vm.Description LIKE '%' + @SearchText + '%' THEN 1 ELSE 0 END ELSE 1 END) = 1 AND (CASE WHEN ISNULL(@VehicleMakeID,0) = 0 THEN 1 WHEN Vm.VehicleMakeID = @VehicleMakeID THEN 1 ELSE 0 END) = 1 ORDER BY Description DESC