• GilaMonster (7/18/2012)


    Cross apply to sys,dm_exec_sql_text

    This won't work if the sproc has the "WITH RECOMPILE" option in its definition.

    Running the following on such a proc gives me nothing:

    SELECT deqs.creation_time, dest.text

    FROM sys.dm_exec_query_stats AS deqs

    cross apply sys.dm_exec_sql_text(deqs.sql_handle) dest

    where dest.text like '%PROCNAME%'

    __________________________________________________________________________________
    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]