mikaelsnavy of CaseTrakker Dynamo Snips
11/18/2015 - 4:59 PM

Gets the linked items (codes/relations) for an object in a CaseTrakker Dynamo database

Gets the linked items (codes/relations) for an object in a CaseTrakker Dynamo database

DECLARE @sourceId VARCHAR(40);
SET @sourceId = ''

SELECT
	ct_type.name,
	ct_type.ct_id
FROM
	ct_rlink WITH (NOLOCK)
INNER JOIN ct_type WITH (NOLOCK)
	ON ct_type.ct_id = ct_rlink.rtype_id
WHERE
	ct_rlink.source_id = @sourceId
ORDER BY
	ct_type.name
DECLARE @sourceId VARCHAR(40);
SET @sourceId = ''

SELECT
	ct_ptype.name,
	ct_ptype.ct_id
FROM
	ct_plink WITH (NOLOCK)
INNER JOIN ct_ptype WITH (NOLOCK)
	ON ct_ptype.ct_id = ct_plink.ptype_id
WHERE
	ct_plink.source_id = @sourceId
ORDER BY
	ct_ptype.name