• Yes, it is possible, but I have never done it. You'll need to use the built-in Dynamic Management Views (DMV), specifically sys.dm_exec_requests which gives you information about currently running requests. You can then follow the information in http://www.toadworld.com/platforms/sql-server/w/wiki/9827.running-traces-with-tsql.aspx to create and run a trace. You can even return the session_id from the DMV for use in filtering the trace.

    SELECT DATEDIFF(MINUTE, r.start_time, SYSDATETIME()) AS running_for,

    r.session_id,

    st.text

    FROM sys.dm_exec_requests AS r

    CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS st

    WHERE r.database_id = DB_ID()

    AND st.text LIKE '%your_procedure_name%'

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA