• A single piece of dynamic SQL will not cause the entire procedure to recompile. At worse, the dynamic section will compile each time, but that depends on a number of things.

    Since SQL 2005, recompilation hasn't been at the procedure level, rather at the statement level so if a statement in a procedure triggers a recompile, it's just the statements that need recompiling that get it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass