Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2007
    Posts
    167

    Unanswered: How do I see the full sql/query text of a spid?

    How do I see the full sql/query text of a spid? I've been using the following dbcc commands to see the sql text.

    dbcc traceon(3604)
    go

    dbcc sqltext(559)
    go

    dbcc traceoff(3604)
    go

    The problem is it truncates the end, so I cannot see the entire query/sql text. Is there another way to a query/sql text that is being run?

    Thank you

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Use MDA/Monitoring tables
    Code:
    select SQLText 
    from master..monProcessSQLText 
    where SPID=@parm
    order by SPID,BatchID,LineNumber,SequenceInLine

  3. #3
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Also check and increase if necessary
    sp_configure 'max SQL text monitored'

  4. #4
    Join Date
    Mar 2007
    Posts
    167

    Great feedback and idea...

    Thank you for your feedback...

    I will use these great ideas. Thank you.

Posting Permissions

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