• GilaMonster (9/27/2012)


    No it won't, because procs marked with recompile are never cached and hence never appear in the sys.dm_exec_query_stats DMV.

    p.s. You don't need a LIKE match for the procedure name. Use OBJECT_NAME(object_id, database_id) = 'Proc Name'

    Thanks, good point.

    So is there a way to get the answer in that case? ie. when proc last recompiled (which would be same as last time it ran).

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]