I want to (loosely) have a stored procedure like
select * from table where col1 like @var
the default value of @var is '%', so if I don't have a value for @var it should return every row. However, the problem is it doesn't return rows where col1 is null.
How do I return all rows if @var = '%' and rows that are like @var if it does have a value?
[the actual sp is significantly more complex so I don't want to just wrap it in a if..then and have two selects]