I prefer doing it this way
select * from yourtable where (@yourparameter is null OR yourcolumn = @yourparameter)