get parent object id in profiler trace

  • I have sp:stmtstarting and sp:stmtcompleted. I am trying to find the parent id to a sql. I do not see any particular column which will help. Any idea how can i do this?

  • i'm not sure what you mean by parent object...a trigger, for example, would have the parent_object_id in sys.objects, but i don't think a specific command would have any references to parent object id's....maybe some of the objects called in the SQL would have parent objects...

    am i misreading?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • thanks lowell..But i was refering to a parent object in sql trace. Lets say you have a proc inside that you have another proc with view,functions etc. Inside function you have another view, now in the trace i am interested to find where does the view point to? like i want to find the top most layer. I figured out from the code but would be nice to find from sql trace.Hope i am clear:-D

  • i really need some assistance here. I am not able to find the parent object. Can someone please advice me? I am capturing data using trace, i can get the nest levels but i am not able to find the parent nest for a given nest level.

  • There's no way to find dependencies in a trace (they're not parent objects, triggers and constraints have parent objects of the tables they belong to, procedures do not).

    You can import the trace then use sys.dependencies, but it can be extremely inaccurate depending how you create the database.

    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 5 posts - 1 through 5 (of 5 total)

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