Table: Office
Columns
Name | Type | Constraints | Description
office_KEY | int | NOT NULL | Assigned by COMMON_dp_Allocate_Unique_Identifiers. Database assigned primary key for this table.
update__staff_KEY | int | NOT NULL |
update_date | datetime | NOT NULL |
office_id | nvarchar (11) | NOT NULL | User defined identifier (unique).
description | nvarchar (30) | NOT NULL | User defined description.
contact_KEY | int | NOT NULL | Key to the primary Contact record for this Client.
create_date | datetime | NOT NULL |
office_id_sortable | varchar (48) | NOT NULL | A representation of the office_id column that sorts in natural order, meaning that digits are sorted as numbers while non-digits are sorted alphabetically. A trigger keeps this field synchronized with the content of office_id.

Primary key
Name | Columns | Description
PK_Office$office_KEY | office_KEY | CLUSTERED
Unique constraints
Name | Columns | Description
UK_Office__contact_KEY | contact_KEY | Each Office must have a different primary Contact.
UK_Office__office_id | office_id | Each id must be unique.
UK_Office__office_id_sortable | office_id_sortable | An index by the sortable ID is desired, and the algorithm ends up producing unique values.

Foreign keys
Name | Columns | Referenced table | Description
FK_Office__Contact__contact_KEY | contact_KEY | Contact |

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_Staff__Office__office_KEY | office_KEY | Staff |
FK_Client__Office__office_KEY | office_KEY | Client |
FK_Engagement__Office__office_KEY | office_KEY | Engagement |
FK_Firm__Office__office_KEY | office_KEY | Firm |
FK_Invoice_Office__Office__office_KEY | office_KEY | Invoice_Office |