Skip to content
Partner Developer Portal

Definition

The Dbo Userinroleidentifier model holds identifier values recorded for users in their role context. Each entry keeps a user-in-role identifier, identifier-type identifier and identifier value together, alongside the organisation information recorded for that entry, describing the value and its recorded type.

_deleted indicates whether the record has been deleted in the source system.

dbo.userinroleidentifier with dbo.useridentifiertype and dbo.userinrole details

Section titled “dbo.userinroleidentifier with dbo.useridentifiertype and dbo.userinrole details”

Return records alongside descriptive values from the related tables.

SELECT
m."_primary_key",
m."useridentifiertypeid",
p1."description" AS "useridentifiertype_description",
m."userinroleid",
p2."contractualrelationship" AS "userinrole_contractualrelationship"
FROM dbo.userinroleidentifier AS m
LEFT JOIN dbo.useridentifiertype AS p1
ON p1."useridentifiertypeid" = m."useridentifiertypeid"
AND p1."organisation" = m."organisation"
LEFT JOIN dbo.userinrole AS p2
ON p2."userinroleid" = m."userinroleid"
AND p2."organisation" = m."organisation";

Row count by dbo.useridentifiertype description

Section titled “Row count by dbo.useridentifiertype description”

Count dbo.userinroleidentifier records for each dbo.useridentifiertype value, joined on useridentifiertypeid.

SELECT
p."description" AS "useridentifiertype_description",
COUNT(*) AS row_count
FROM dbo.userinroleidentifier AS m
INNER JOIN dbo.useridentifiertype AS p
ON p."useridentifiertypeid" = m."useridentifiertypeid"
AND p."organisation" = m."organisation"
GROUP BY p."description"
ORDER BY row_count DESC;

Row count by dbo.userinrole contractualrelationship

Section titled “Row count by dbo.userinrole contractualrelationship”

Count dbo.userinroleidentifier records for each dbo.userinrole value, joined on userinroleid.

SELECT
p."contractualrelationship" AS "userinrole_contractualrelationship",
COUNT(*) AS row_count
FROM dbo.userinroleidentifier AS m
INNER JOIN dbo.userinrole AS p
ON p."userinroleid" = m."userinroleid"
AND p."organisation" = m."organisation"
GROUP BY p."contractualrelationship"
ORDER BY row_count DESC;