Table: dbo.Privilege
Columns
Name | Type | Constraints | Description
privilege_KEY | int (4) | NOT NULL | Database assigned primary key for this table.
parent__privilege_KEY | int (4) | NOT NULL | Foreign key to the parent of this Privilege.
code | nvarchar (30) | NOT NULL | This is a shorter version of Description that is used for the privilege path.
description | nvarchar (120) | NOT NULL | This is the description that users will see.
sort | int (4) | NOT NULL | It is required that the privileges sort in a particular order. This is how the order is specified.
leaf | tinyint (1) | NOT NULL | 1 if this is a privilege and 0 if it is a privilege folder.
tree_level | int (4) | NOT NULL | The level in the tree.
hierarchy | nvarchar (900) | NOT NULL | Calculated by the database to allow privileges to be sorted quickly in tree structure.
sort_hierarchy | nvarchar (900) | NOT NULL | Same as Hierarchy except that the values from Sort column are used.

Primary key
Name | Columns | Description
PK_Privilege | privilege_KEY |
Unique constraints
Name | Columns | Description
UK_Privilege$hierarchy | hierarchy |
UK_Privilege$sort_hierarchy | sort_hierarchy |

Foreign keys
Name | Columns | Referenced table | Description
FK_Privilege__Privilege__parent__privilege_KEY | parent__privilege_KEY | Privilege (privilege_KEY) |

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_Privilege__Privilege__parent__privilege_KEY | parent__privilege_KEY | Privilege |
FK_Synchronized_Privilege__Privilege__privilege_KEY | privilege_KEY | Synchronized_Privilege |
FK_Privilege_Forbidden__Privilege__privilege_KEY | privilege_KEY | Privilege_Forbidden |
FK_Privilege_Dependency__Privilege__dependent__privilege_KEY | dependent__privilege_KEY | Privilege_Dependency |
FK_Privilege_Dependency__Privilege__privilege_KEY | privilege_KEY | Privilege_Dependency |