Sæt dem sammen med nogle OR-udsagn:
SELECT *
FROM
Customer c
WHERE
c.StateID=@StateID
AND ( c.CountyID=@CountyID OR @CountyID IS NULL )
AND ( c.CityID=@CityID OR @CityID IS NULL )
For hver af disse parametre, hvis den er null, ignoreres kontrollen grundlæggende.