...
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT
CAST(c.objectID AS VARCHAR) objectID_1,
'c' + CAST(c.componentID AS VARCHAR) objectID_2,
'Object-Component' relationshipType
FROM
ObjComponents c
WHERE
c.objectID IN (SELECT t.objectID FROM ObjComponents t GROUP BY t.objectID HAVING count(*) > 1)
UNION ALL;
SELECT
CAST(oa.ID1 AS VARCHAR) objectID_1,
CAST(oa.ID2 AS VARCHAR) objectID_2,
r.relation1 + '-' + r.relation2 relationshipType
FROM
Associations oa,
Objects obj1,
Objects obj2,
Relationships r
WHERE
oa.tableID = 108
AND oa.ID1 = obj1.objectID
AND oa.ID2 = obj2.objectID
AND obj1.IsVirtual = 0 AND obj1.IsTemplate = 0
AND obj2.IsVirtual = 0 AND obj2.IsTemplate = 0
AND oa.relationshipID = r.relationshipID
;
|
...