I have a query as follows
select * from table where col1 = @param1 and col2 = @parm2
And another
select * from table where col1 = @param1
Is it possible do both operations in same query based on parameter passed, if it is null query all or when parameter has value select them.
My queries are very big and i have to create 2 versions of sp's for each and i was thinking that can i try to avoid creating two.