Transaction id sql server profiler trace

  • Can someone please tell me what information transaction id gives in profiler trace and what it means. I looked at the trace definition and says ' system generated id'. I see different transaction ids for the same spid. I am having hard time in grouping data in profiler trace since it captures all the nest level too. I am wondering if i can group by transaction to identify which one is taking most cost?

  • Not much unless you have explicit transactions. It is, as its name implies, an ID for the transaction

    So

    BEGIN TRAN

    insert ...

    update ...

    update...

    delete ...

    COMMIT

    will all get the same transactionID, however without the begin tran and commit, those 4 statements are in their own transactions and get 4 transaction IDs.

    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
  • GilaMonster (2/29/2012)


    Not much unless you have explicit transactions. It is, as its name implies, an ID for the transaction

    So

    BEGIN TRAN

    insert ...

    update ...

    update...

    delete ...

    COMMIT

    will all get the same transactionID, however without the begin tran and commit, those 4 statements are in their own transactions and get 4 transaction IDs.

    This helps. Thanks. Now how can i tag the parent sproc for a transaction id inside trace. I always have hard time linking child sprocs to parent calls, someone told me there is no way to link those. Any thoughts on this.

  • This isn't going to link child and parent calls, it's just about transactions. Only way it will help is if you start a tran in the outer procedure and then call a child proc.

    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