• Why do you think it has unrelated tables in?

    The optimiser will NOT use a plan for one query for another query. It cannot. For ad-hoc queries the plan matching is on the exact SQL text, hence using one query's plan will never match the plan lookup for a different query. For procedures the lookup is on the object ID, hence one procedure can never match the plan lookup for a different query

    sp_recompile on a procedure will remove it's plan from cache, next time it runs it has to compile fresh.

    DBCC FREEPROCCACHE clears the entire plan cache, no plans can survive that, all queries running after that will compile fresh plans.

    WITH RECOMPILE on the proc and SQL will never even cache the plan, it compiles a fresh plan every single time.

    Post the plan?

    p.s. Nolock? You do know the effects of that? (and I don't mean just dirty reads)

    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