February 28, 2011 at 1:38 pm
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?
February 28, 2011 at 2:04 pm
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
February 28, 2011 at 9:36 pm
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
March 1, 2011 at 5:36 pm
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.
March 1, 2011 at 5:56 pm
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
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy