• You can try using query hints, but the fundamental problem is the approach you're taking with the query. Ad hoc or dynamic SQL like this will create a different execution plan every time you change the values, even if you get a good plan each time, you'll still get a new plan each time. You need to change the query so that it uses parameters appropriately, not building and executing strings.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning