• Initially, I've got to say that I agree with alzdba and the others.  For a long time, I have seen people claim that you must qualify object names with explicit owners to get plan reuse to work, but I've never seen anybody who was able to demonstrate the truth of this claim.  I almost answered that you needed to qualify the names just to get the points because I was so certain this might be another one of those times when somebody would make this claim.  Oh well, you win a few and you lose a few.

    And when I run code similar to alzdba's code, the plans *are* reused, according to syscacheobjects.  And contrary to what cindygross says, on my servers, profiler shows cache hits but not any recompiles.  As Antares said, there may be some secret set of conditions out there that could cause an otherwise unnecessary recompile when using sp_executesql without explicitly qualified object ownership, but I've never seen it, and it's really easy to construct counter-evidence cases where plan reuse works with unqualified names.

    So, I am genuinely curious if anybody can back up the claim that owner names have to be qualified to get plan reuse.  My own belief is that if the object names in the query resolve to the same object id's, then SQL Server will reuse the plan if possible.  In other words, I think that you only need to explicitly qualify the owner name when you would actually get a different object otherwise ... but if you are querying a different object, you are writing a different query, and the plan should not be used.

    Of course, certain session settings (quoted identifier et. al.) could influence this, but that's not what I'm asking about.  But I'm genuinely eager to see if anybody can back up the claim that this question makes, namely that one must explicitly reference each objects owner in a query to get query plan reuse to work.  Alzdba has already proven (in my opinion) that this is not true.

    Thanks for any replies,

    Chris