Vad sägs om något liknande
SELECT Id, col1, col2, col3, col4
FROM myTable
WHERE col1 LIKE @Param1+'%'
OR @Param1 IS NULL
i det här specifika fallet kunde du också ha använt
SELECT Id, col1, col2, col3, col4
FROM myTable
WHERE col1 LIKE ISNULL(@Param1,'')+'%'
Men i allmänhet kan du prova något liknande
SELECT Id, col1, col2, col3, col4
FROM myTable
WHERE (condition1 OR @Param1 IS NULL)
AND (condition2 OR @Param2 IS NULL)
AND (condition3 OR @Param3 IS NULL)
...
AND (conditionN OR @ParamN IS NULL)