Table: Activity
Columns
Name | Type | Constraints | Description
activity_KEY | int | NOT NULL | AUTO-INCREMENT: Database assigned primary key for this table
update__staff_KEY | int | NOT NULL |
update_date_utc | datetime | NOT NULL |
activity_id | nvarchar (11) | NOT NULL | User defined identifier (unique)
description | nvarchar (250) | NOT NULL | User defined description.
long_description | nvarchar (-1) | NOT NULL | Long user defined description
activity_category_KEY | int |  | KEY of the Activity Category that this row is assigned.
activity_class_KEY | int | NOT NULL | KEY of the Activity Class that this row is assigned
activity_status_KEY | int | NOT NULL | KEY of the Activity Status that this row is assigned
billing_rate_type_KEY | int |  | KEY of the Billing Rate Type that this row is assigned (required when rate_type_KEY=2).
unit_price | decimal (9, 4) | NOT NULL | Price per unit for expense, price per hour for time when rate_type_KEY=3 or 0.0000 otherwise.
unit_cost | decimal (9, 4) | NOT NULL | Cost per unit for expense, 0.0000 for time.
round_extension | bit | NOT NULL | Used to determine if WIP will be rounded to the nearest dollar when it is calculated
charge_sales_tax | bit | NOT NULL | Used to determine if Sales Tax should be calculated
charge_service_tax | bit | NOT NULL | Used to determine if Service Tax should be calulated
gl_account | nvarchar (60) | NOT NULL | Defines the GL Account to which this activity will be exported.
rate_type_KEY | int | NOT NULL | 1=No Rate, 2=Staff Rate, 3=Fixed Rate (Always 3 for expense)
activity_method_KEY | int | NOT NULL | 1=Time, 2=Expense
activity_surcharge_method_KEY | int | NOT NULL | 1=No surcharge, 2=Per Unit, 3=Percent
surcharge_rate | decimal (9, 4) | NOT NULL | Amount to charge if surcharge_method_KEY=1; Percent to charge if surcharge_method_KEY=2
create_date_utc | datetime | NOT NULL |
activity_id_sortable | varchar (48) | NOT NULL | A representation of the activity_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 activity_id.
administrative_activity_type_KEY | int |  | KEY of the Administrative Activity Type that this row is assigned.

Primary key
Name | Columns | Description
PK_Activity$activity_KEY | activity_KEY | CLUSTERED
Unique constraints
Name | Columns | Description
UK_Activity$activity_id | activity_id | Each id must be unique.
UK_Activity$activity_id_sortable | activity_id_sortable | An index by the sortable ID is desired, and the algorithm ends up producing unique values.
UK_Activity$activity_KEY$activity_class_KEY$activity_method_KEY | activity_KEY, activity_class_KEY, activity_method_KEY | Supports the relationship between these three columns in Sheet_Entry.
Indexes
Name | Columns | Description
IX_Activity$activity_category_KEY | activity_category_KEY | Index supports foreign key FK_Activity__Activity_Category__activity_category_KEY
IX_Activity$activity_class_KEY | activity_class_KEY |
IX_Activity$activity_method_KEY | activity_method_KEY | Index supports foreign key FK_Activity__Activity_Method__activity_method_KEY
IX_Activity$activity_status_KEY | activity_status_KEY | Index supports foreign key FK_Activity__Activity_Status__activity_status_KEY
IX_Activity$activity_surcharge_method_KEY | activity_surcharge_method_KEY | Index supports foreign key FK_Activity__Activity_Surcharge_Method__activity_surcharge_method_KEY
IX_Activity$administrative_activity_type_KEY | administrative_activity_type_KEY | Index supports foreign key FK_Activity__Administrative_Activity_Type__administrative_activity_type_KEY
IX_Activity$billing_rate_type_KEY | billing_rate_type_KEY | Index supports foreign key FK_Activity__Billing_Rate_Type__billing_rate_type_KEY
IX_Activity$rate_type_KEY | rate_type_KEY | Index supports foreign key FK_Activity__Rate_Type__rate_type_KEY

Foreign keys
Name | Columns | Referenced table | Description
FK_Activity__Activity_Category__activity_category_KEY | activity_category_KEY | Activity_Category |
FK_Activity__Billing_Rate_Type__billing_rate_type_KEY | billing_rate_type_KEY | Billing_Rate_Type |

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_Accruable_Benefit__Activity__activity_KEY | activity_KEY | Accruable_Benefit |
FK_Engagement__Activity__recurring_bill__activity_KEY | recurring_bill__activity_KEY | Engagement |
FK_Task_Template__Activity__activity_KEY | activity_KEY | Task_Template |
FK_User_Preference__Activity__entry_expense__activity_KEY | entry_expense__activity_KEY | User_Preference |
FK_User_Preference__Activity__entry_time__activity_KEY | entry_time__activity_KEY | User_Preference |
FK_Schedule_Item__Activity__activity_KEY | activity_KEY | Schedule_Item |
FK_Sheet_Entry__Activity__activity_KEY | activity_KEY | Sheet_Entry |
FK_Sheet_Entry__Activity__activity_KEY__activity__activity_class_KEY__activity__activity_method_KEY | activity_KEY, activity__activity_class_KEY, activity__activity_method_KEY | Sheet_Entry |