There are several ways to check if a parameter IS NULL or has value. One of the best way to check that is like below:
DECLARE @PhoneNo VARCHAR(12) = '12345'
SELECT *
FROM PhoneNumber
WHERE
PhoneNo = @PhoneNo OR @PhoneNo IS NULL
The problem is, when I use OR operator it takes 5 seconds or more. However, if I just write
PhoneNo = @PhoneNo
it takes less than a sec.
The ultimate solution can be use of dynamic query. I prefer not to do that.