• I'm still a little confused about how the query plan works.

    Here's what I thought:

    There is one query plan per stored procedure. When the query is run an execution context is created, and it is cached. The second time SQL Server checks to see if it can use the existing execution context, meaning you are going down the same path of the if statement. If it can not find the execution context, meaning you are going down a different path of the if statement, it will create a new execution context.

    According to what you're saying, the query plan itself is not recompiled, but it will not be able to use the existing execution context. Is this correct?