SELECT R.*, P.Description AS ProvinceDescription FROM Md.Regions R INNER JOIN Md.Provinces P ON R.ProvinceID = P.ProvinceID WHERE R.IsCancelled = 0 AND (CASE WHEN ISNULL(@SearchText, '') <> '' THEN CASE WHEN  R.Description LIKE '%' + @SearchText + '%' THEN 1 ELSE 0 END ELSE 1 END) = 1 AND (CASE WHEN ISNULL(@RegionID,0) = 0 THEN 1 WHEN R.RegionID = @RegionID THEN 1 ELSE 0 END) = 1 ORDER BY R.Description DESC