Query to get CI relationship and history info

Query to get CI relationship and history info

Version : 13004
DB : MSSQL / PGSQL

OUTPUT:





select c1.ciname as "CI Name",
rel.relationship as "Relationship",
c2.ciname as "CI Name 2",
cih.editmode as "Mode",
adp.OPERATIONSTRING as "Operation",
LONGTODATE(cih.operationtime) as "Operation Time",
au.first_name as "Operation User" from ci c1
inner join cirelationships cirel on c1.ciid=cirel.ciid
inner join relationshiptype rel on cirel.relationshiptypeid=rel.relationshiptypeid
inner join ci c2 on cirel.ciid2=c2.ciid
Left JOIN cihistory cih on c1.ciid = cih.ciid
LEFT JOIN cihistorydetails cihd on cih.historyid = cihd.historyid
Left JOIN auditoperation adp on cihd.operation = adp.operation
Left Join sduser sd on cih.userid = sd.userid
Left JOIN aaaUser au on sd.userid = au.user_id

                  New to ADSelfService Plus?