Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003

    Question Unanswered: linked servers and cached execution path

    I have a procedure that generates dynamic sql and then executes via the execute(strSQL) syntax. BOL states that if I use sp_executesql with hard-typed parameters passed in variables, the query optimizer will 'probably' match the sql statement with the cached execution path, thus avoiding recompilation and speeding up the results for heavily run procedures.

    Can anyone tell me if this is also true if the sql references an object on a linked sql server 2000 database? Technically, the sql is exactly the same, but I'm unsure if there is some exception due to the way linked objects are processed.


  2. #2
    Join Date
    Aug 2002
    Yes the execution will use the plan based on the cache and it may have performance affect if the parameters/optimization is changed recently with the baseline indexes or hints. fyi.
    --Satya SKJ
    Microsoft SQL Server MVP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts