Alertnatives to DBCC INPUTBUFFER(@@spid)

  • What set of SELECT statements would provide the same results as DBCC INPUTBUFFER(@@spid)?

    Thanks!

  • You can query sys.dm_exec_sql_text and pass it a sql_handle (which you can get from sys.dm_exec_requests and several other DMVs)

    It's not exactly the same output as inputbuffer. Inputbuffer will show the call to a procedure, exec_sql_text will show the code of that procedure.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Would you be able to provide a specific code example?

    Thanks!

  • Check in Books Online, under sys,dm_exec_sql_text. There are examples there.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply