Results 1 to 5 of 5

Thread: SP for SPID detailed information?

  1. #1
    Join Date
    May 2005
    Posts
    111

    SP for SPID detailed information (MSSQL)?

    I'm looking for a Stored Procedure in MS SQL that accepts the SPID as it's parameter and returns detail information on the process/script associated with said SPID.

    -Allen
    Last edited by ecka00; 03-01-2006 at 11:25 AM.

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Try 'sp_who2 spid' like 'sp_who2 51'.

  3. #3
    Join Date
    May 2005
    Posts
    111
    nope, the sp_who2 gives me essentially the same information that i can get through activity within enterprise manager. I'm looking for something that will give me the actual command of execution (textdata) like in sql profiler.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Then use 'dbcc inputbuffer(spid)'.

  5. #5
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    You can also use fn_get_sql to get more detailed information than dbcc.

    DECLARE @Handle binary(20)
    SELECT @Handle = sql_handle FROM sysprocesses WHERE spid = 52
    SELECT * FROM ::fn_get_sql(@Handle)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •