Table: dbo.Engagement_Binder_Tree_Item
This will contain the data representing the tree structure for each client. It should never be written to in client code. All writes will happen through known SQL stored procedures.
Columns
Name | Type | Constraints | Description
engagement_binder_tree_item_KEY | int (4) | NOT NULL | Primary key. This points to the engagment binder tree item.
client_KEY | int (4) | NOT NULL | This will contain the link to the client that is associated with this item. This is a non-nullable foreign key.
left_value | int (4) | NOT NULL | This will contain the left bound for every item below this item in the binder tree. This column can be used to obtain the count for a tree.
right_value | int (4) | NOT NULL | This will contain the right bound for every item below this item in the binder tree. This column can be used to generate the descendants of this item.
level_value | int (4) | NOT NULL | This will contain the level or depth of this item in the binder tree. Client items are at level 1, binder items are at level 2, and levels 3+ are for workpaper and folder items.
folder_KEY | int (4) |  | This will contain the link to the folder that is associated with this item. If this item is not a folder then this will be null. This is a nullable foreign key.
workpaper_KEY | int (4) |  | This will contain the link to the workpaper that is associated with this item. If this item is not a workpaper then this will be null. This is a nullable foreign key.
engagement_binder_KEY | int (4) |  | This will contain the link to the engagement binder that is associated with this item. If this item is not a binder then this will be null. This is a nullable foreign key.

Primary key
Name | Columns | Description
PK_Engagement_Binder_Tree_Item | engagement_binder_tree_item_KEY |
Unique constraints
Name | Columns | Description
UK_Engagement_Binder_Tree_Item$client_KEY$left_value | client_KEY, left_value |
UK_Engagement_Binder_Tree_Item$client_KEY$right_value | client_KEY, right_value |

Foreign keys
Name | Columns | Referenced table | Description
FK_Engagement_Binder_Tree_Item__Client__client_KEY | client_KEY | Client (client_KEY) |
FK_Engagement_Binder_Tree_Item__Engagement_Binder__engagement_binder_KEY | engagement_binder_KEY | Engagement_Binder (engagement_binder_KEY) |
FK_Engagement_Binder_Tree_Item__Folder__folder_KEY | folder_KEY | Folder (folder_KEY) |
FK_Engagement_Binder_Tree_Item__Workpaper__workpaper_KEY | workpaper_KEY | Workpaper (workpaper_KEY) |