• Another way i commonly use is an extension on the above

     

    WHERE

    ((@customerid is not null and customerid = @customerid) or @customerid is null)