get last iserted records

  • Sanaullah (10/7/2008)


    Hi,

    AS the values are changing every second the in procedure we should use

    WITH RECOMPILE, So wheen ever it is called it recompiles the query and get the last 50 records no doubt what is the last one.

    No need to recompile unless the optimal execution plan is going to change from 1 execution to another. It's certainly not necessary to ensure you get the last 50 records. The plan is cached, not the result.

    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

Viewing post 16 (of 15 total)

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