Non Recompile Option while executing the Stored Proc.

  • Hi,

    Can you please let me know the option available to restrict the SQL Stored Proc , not to create a new execution plan every time it is executed and compiled..?

    Thanks.

  • There's no such option because that is the default behaviour. When executing a proc it will reuse the cached plan if one is available. The only times a procedure will compile is if there is no cached plan, if a recompile was requested or if the cached plan is invalid.

    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
  • What is the query/table to check the execution plan of the queries until we restart the SQL Server?

    Please suggest.

    Thanks.

  • sys.dm_exec_cached_plans and related DMVs

    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
  • Hi,

    Can you please let me know the option available to restrict the SQL Stored Proc , not to create a new execution plan every time it is executed and compiled..?

    Do some research on parameterization (Simple and Forced). And be sure you understand this thoroughly before any implementation.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply