• Idea 1: add WITH RECOMPILE to the proc.

    Idea 2: turn the query into dynamic SQL using exec('...'), with the values of the parameters inserted into the query string.