Query User's Supervisor
I'm hoping someone can provide an answer before I figure it out by myself.
Using the Cireson and SCSM databases, is there a query that can pull a User and the User's Supervisor? Just needing names. I suspect there's a darn Relationship table in there somewhere.
TIA
Best Answer
-
Brian_Winter Customer Advanced IT Monkey ✭✭✭
select a.DisplayName as [User],
b.DisplayName as Supervisor
from MT_System$Domain$User a,
MTV_System$Domain$User b,
MTV_System$UserManagesUser c,
Relationship d
where b.BaseManagedEntityId = d.SourceEntityId
and a.BaseManagedEntityId = d.TargetEntityId
and d.RelationshipId = c.RelationshipId
0
Answers
select a.DisplayName as [User],
b.DisplayName as Supervisor
from MT_System$Domain$User a,
MTV_System$Domain$User b,
MTV_System$UserManagesUser c,
Relationship d
where b.BaseManagedEntityId = d.SourceEntityId
and a.BaseManagedEntityId = d.TargetEntityId
and d.RelationshipId = c.RelationshipId