locked
Unable to find sqltext of a session RRS feed

  • Question

  • Hi,

    I found a blocking session in the database. It's session id is 473. I executed below command to get the sql statement-

    dbcc inputbuffer (473);

    It show below output 

    Event type         Parameters        Event info

    RPC Event           1                    sys.sp_execute

    So here I got only 'sys.sp_execute' instead of any sql statement.

    Then I used below command to get the sqltext but it showed no output-

    SELECT t.*
    FROM sys.dm_exec_requests AS r
    CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS t
    WHERE session_id = 473

    Can anyone tell me what 'sys.sp_execute' stands for and why didn't I get the actual sqltext and how to get it?


    Tuesday, August 29, 2017 11:24 AM

Answers

  • What you get after execute that query?

    Sp_execute procedure used to execute the dynamic queries.


    Please Mark as Answer if my post works for you or Vote as Helpful if it helps you. Kapil Singh

    Tuesday, August 29, 2017 11:28 AM