-- Auto-generated schema export for TTSCWM.cwwebapp_totaltech
-- Generated at: 2026-03-20T23:18:33.088Z

-- dbo.Accounting_Package
CREATE TABLE [dbo].[Accounting_Package] (
  [Accounting_Package_RecID] int NOT NULL,
  [Accounting_Package_ID] nvarchar(10) NOT NULL,
  [Accounting_Package_Description] nvarchar(30) NOT NULL,
  [Separator] char(1) NULL,
  [Company_Length] smallint NOT NULL
);
GO

-- dbo.Accounting_Package_Setup
CREATE TABLE [dbo].[Accounting_Package_Setup] (
  [Accounting_Package_Setup_RecID] int NOT NULL,
  [Accounting_Package_RecID] int NOT NULL,
  [Direct_Transfer] bit NOT NULL,
  [Include_Invoices] bit NOT NULL,
  [Invoice_Format] smallint NOT NULL,
  [Include_Sales_Tax] bit NOT NULL,
  [Enable_Tax_Groups] bit NOT NULL,
  [Zero_Amount_NonTaxable] bit NOT NULL,
  [Include_Expenses] bit NOT NULL,
  [Transfer_Expense_As_Bill] bit NOT NULL,
  [Expense_Format] smallint NOT NULL,
  [Include_Procurement_Items] bit NOT NULL,
  [Inventory_Stock_On_Hand] bit NOT NULL,
  [Send_Component_Amount] bit NOT NULL,
  [Send_Unit_Of_Measure] bit NOT NULL,
  [Include_COGS_Entries] bit NOT NULL,
  [Include_COGS_And_Inventory] bit NOT NULL,
  [Suppress_Memo] bit NOT NULL,
  [Sync_Payment_Info] bit NOT NULL,
  [Sync_Wise_Pay_Payment_Info] bit NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Accounting_Pkg_Summary_Type
CREATE TABLE [dbo].[Accounting_Pkg_Summary_Type] (
  [Accounting_Pkg_Summary_Type_RecID] smallint NOT NULL,
  [Description] nvarchar(50) NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Activity_Capture
CREATE TABLE [dbo].[Activity_Capture] (
  [actcap_recid] int NOT NULL,
  [sender] nvarchar(150) NULL,
  [receiver] nvarchar(150) NULL,
  [subject] nvarchar(max) NULL,
  [body] nvarchar(max) NULL,
  [type] nvarchar(50) NULL,
  [last_update] datetime2(0) NULL,
  [updated_by] nvarchar(15) NULL,
  [sender_recid] int NOT NULL,
  [company_recid] int NOT NULL
);
GO

-- dbo.Activity_Class
CREATE TABLE [dbo].[Activity_Class] (
  [Activity_Class_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Xref_Work_Code] nvarchar(10) NULL,
  [taxexempt_flag] bit NOT NULL,
  [Hourly_Rate] decimal(18,2) NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Activity_Class_Loc
CREATE TABLE [dbo].[Activity_Class_Loc] (
  [Activity_Class_Loc_RecID] int NOT NULL,
  [Activity_Class_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Hourly_Rate] decimal(18,2) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Activity_Type
CREATE TABLE [dbo].[Activity_Type] (
  [Activity_Type_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Hours_Min] decimal(18,2) NULL,
  [Hours_Max] decimal(18,2) NULL,
  [Default_Flag] bit NOT NULL,
  [Multiplier_Flag] bit NOT NULL,
  [Rate] decimal(18,2) NULL,
  [Rate_Type] char(1) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Invoice_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Billable_Flag] bit NOT NULL,
  [Utilization_Flag] bit NOT NULL,
  [Xref_Work_Type] nvarchar(10) NULL,
  [Cost_Multiplier] decimal(18,2) NULL,
  [Act_Default_Flag] bit NULL,
  [TimeAccrual_Type_ID] char(1) NULL,
  [Round_Bill_Hrs] decimal(18,2) NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Address_Format
CREATE TABLE [dbo].[Address_Format] (
  [Address_Format_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Format] nvarchar(250) NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.AGR_Allocation
CREATE TABLE [dbo].[AGR_Allocation] (
  [AGR_Allocation_RecID] int NOT NULL,
  [AGR_Header_RecID] int NULL,
  [PP_Amount] decimal(18,2) NULL,
  [PP_Unlimited_Flag] bit NULL,
  [AGR_Detail_Type_ID] char(1) NULL,
  [Date_Created] datetime NULL,
  [PP_Carryover_Flag] bit NULL,
  [Carryover_Days] int NULL,
  [Date_Expires] datetime NULL,
  [TE_Amount] decimal(18,2) NULL,
  [Period_Start] datetime NULL,
  [Period_End] datetime NULL,
  [OneTime_Flag] bit NULL,
  [Comp_Rate_Option] char(1) NULL,
  [Comp_Rate_Amount] decimal(18,2) NULL,
  [Comp_Limit_Option] char(1) NULL,
  [Comp_Limit_Amount] decimal(18,2) NULL
);
GO

-- dbo.AGR_AppCycle
CREATE TABLE [dbo].[AGR_AppCycle] (
  [AGR_AppCycle_RecID] int NOT NULL,
  [AppCycle_ID] char(1) NULL,
  [AppCycle_Name] nvarchar(25) NULL,
  [cycle_basis] char(1) NULL,
  [cycle_interval] int NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.AGR_Audit
CREATE TABLE [dbo].[AGR_Audit] (
  [AGR_Audit_RecID] int NOT NULL,
  [AGR_Header_RecID] int NOT NULL,
  [Audit_Text] nvarchar(2000) NULL,
  [Last_Update] datetime2(3) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Locale_Key_RecID] int NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Last_Updated_UTC] datetime NOT NULL
);
GO

-- dbo.AGR_Audit_Value
CREATE TABLE [dbo].[AGR_Audit_Value] (
  [AGR_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(2000) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(max) NULL,
  [AGR_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.AGR_BatchRun
CREATE TABLE [dbo].[AGR_BatchRun] (
  [AGR_BatchRun_RecID] int NOT NULL,
  [Next_RunDate] datetime NULL,
  [days_to_advance] int NULL,
  [updated_by] nvarchar(15) NULL,
  [last_update] datetime NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.AGR_Bill
CREATE TABLE [dbo].[AGR_Bill] (
  [AGR_Bill_RecID] int NOT NULL,
  [AGR_Header_RecID] int NULL,
  [Date_Created] datetime NULL,
  [Billing_Log_RecID] int NULL,
  [Period_Start] datetime NULL,
  [Period_End] datetime NULL,
  [Date_Invoice] datetime NULL,
  [created_by] nvarchar(200) NULL,
  [invoice_create_date] datetime NULL,
  [thru_date] datetime NULL,
  [cancel_by] nvarchar(50) NULL,
  [cancel_flag] bit NULL,
  [date_cancel] datetime NULL,
  [Parent_RecID] int NULL
);
GO

-- dbo.Agr_Billing_Log
CREATE TABLE [dbo].[Agr_Billing_Log] (
  [Agr_Billing_Log_RecID] int NOT NULL,
  [AGR_Header_RecID] int NOT NULL,
  [Billing_Log_RecID] int NOT NULL,
  [time_amount] decimal(18,2) NOT NULL
);
GO

-- dbo.AGR_Config
CREATE TABLE [dbo].[AGR_Config] (
  [AGR_Config_RecID] int NOT NULL,
  [AGR_Header_RecID] int NULL,
  [Config_RecID] int NULL
);
GO

-- dbo.AGR_Default
CREATE TABLE [dbo].[AGR_Default] (
  [AGR_Default_RecID] int NOT NULL,
  [AGR_Header_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NULL,
  [SR_Type_RecID] int NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [SR_Board_RecID] int NULL
);
GO

-- dbo.AGR_Detail
CREATE TABLE [dbo].[AGR_Detail] (
  [AGR_Detail_RecID] int NOT NULL,
  [AGR_Header_RecID] int NOT NULL,
  [AGD_Date] date NULL,
  [IV_Item_RecID] int NULL,
  [AGD_Desc] nvarchar(max) NULL,
  [AGD_Qty] decimal(18,2) NULL,
  [AGD_Amount] decimal(18,6) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [AGRM_Billable_Flag] bit NOT NULL,
  [AGRM_Taxable_Flag] bit NULL,
  [AGD_Cancel] date NULL,
  [AGD_Cost] decimal(18,6) NULL,
  [AGD_Serial_Number] nvarchar(50) NULL,
  [AGD_Included] decimal(18,2) NULL,
  [Parent_RecID] int NULL,
  [FlatRate_Flag] bit NOT NULL,
  [Extended_Price_Amount] decimal(18,6) NOT NULL,
  [Extended_Cost_Amount] decimal(18,6) NOT NULL,
  [AGRM_Invoice_Flag] bit NOT NULL,
  [Purchase_Item_Flag] bit NOT NULL,
  [Special_Order_Flag] bit NOT NULL,
  [Opportunity_RecID] int NULL,
  [Sequence_Number] decimal(18,2) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Drop_Ship_Flag] bit NOT NULL,
  [Invoice_Grouping_RecID] int NULL,
  [Price_Method_ID] nvarchar(2) NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.AGR_Detail_Prorate
CREATE TABLE [dbo].[AGR_Detail_Prorate] (
  [AGR_Detail_Prorate_RecID] int NOT NULL,
  [AGR_Detail_RecID] int NOT NULL,
  [AGR_Prorate_RecID] int NULL,
  [AGR_Bill_RecID] int NULL,
  [Prorate_Current_Period_Flag] bit NULL,
  [Price] decimal(18,6) NOT NULL,
  [Cost] decimal(18,6) NOT NULL,
  [Extended_Price] decimal(18,6) NOT NULL,
  [Extended_Cost] decimal(18,6) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(50) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(50) NOT NULL
);
GO

-- dbo.AGR_Detail_Type
CREATE TABLE [dbo].[AGR_Detail_Type] (
  [AGR_Detail_Type_RecID] int NOT NULL,
  [AGR_Detail_Type_ID] char(1) NULL,
  [AGR_Detail_Type_Desc] nvarchar(50) NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.AGR_Exclusion
CREATE TABLE [dbo].[AGR_Exclusion] (
  [AGR_Exclusion_RecID] int NOT NULL,
  [AGR_Header_RecID] int NOT NULL,
  [Activity_Type_RecID] int NULL,
  [Activity_Class_RecID] int NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL
);
GO

-- dbo.AGR_Header
CREATE TABLE [dbo].[AGR_Header] (
  [AGR_Header_RecID] int NOT NULL,
  [AGR_Type_RecID] int NOT NULL,
  [AGR_Name] nvarchar(100) NULL,
  [AGR_Date_Start] date NULL,
  [AGR_Date_End] date NULL,
  [AGR_NoEnd_Flag] bit NOT NULL,
  [AGR_Billing_Cycle_RecID] int NULL,
  [AGR_OneTime_Flag] bit NOT NULL,
  [AGR_Amount] decimal(18,2) NULL,
  [AGR_Prorate] decimal(18,2) NULL,
  [AGR_InvDesc] nvarchar(max) NULL,
  [Company_RecID] int NOT NULL,
  [Contact_RecID] int NULL,
  [AGR_PONbr] nvarchar(50) NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [OL_Restrict_Flag] bit NOT NULL,
  [BU_Restrict_Flag] bit NOT NULL,
  [SubCompany_RecID] int NULL,
  [SubContact_RecID] int NULL,
  [Sub_WONbr] nvarchar(20) NULL,
  [AGR_Cancel_Flag] bit NOT NULL,
  [AGR_Date_Cancel] datetime NULL,
  [AGR_Reason_Cancel] nvarchar(100) NULL,
  [PP_One_Time_Flag] bit NOT NULL,
  [AGR_Detail_Type_ID] nvarchar(1) NULL,
  [PP_Amount] decimal(18,2) NULL,
  [PP_Carryover_Flag] bit NOT NULL,
  [PP_Time_Flag] bit NOT NULL,
  [PP_Expenses_Flag] bit NOT NULL,
  [PP_Products_Flag] bit NOT NULL,
  [AGR_Notes] nvarchar(max) NULL,
  [Activity_Class_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [SR_Urgency_RecID] int NULL,
  [PM_Type_RecID] int NULL,
  [TE_Billable_Flag] bit NOT NULL,
  [TE_Invoice_Flag] bit NOT NULL,
  [EX_Billable_Flag] bit NOT NULL,
  [EX_Invoice_Flag] bit NOT NULL,
  [IV_Billable_Flag] bit NOT NULL,
  [IV_Invoice_Flag] bit NOT NULL,
  [PP_Adjustment] decimal(18,2) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] char(15) NULL,
  [SR_Type_RecID] int NULL,
  [TopComment_Flag] bit NOT NULL,
  [BottomComment_Flag] bit NOT NULL,
  [AppCycle_ID] char(1) NULL,
  [Overrun_Flag] bit NOT NULL,
  [CycleBasis_ID] char(1) NULL,
  [Taxable_Flag] bit NOT NULL,
  [Tax_Code_RecID] int NULL,
  [TE_Amount] decimal(18,2) NULL,
  [TE_InvCust_Flag] bit NOT NULL,
  [EX_InvCust_Flag] bit NOT NULL,
  [IV_InvCust_Flag] bit NOT NULL,
  [PP_Unlimited_Flag] bit NOT NULL,
  [BR_Option] char(1) NULL,
  [Bill_Start_Date] date NULL,
  [CarryOver_Days] int NULL,
  [Overrun_Limit] int NULL,
  [PP_Expire_Flag] bit NOT NULL,
  [Notification_History] nvarchar(max) NULL,
  [Charge_Firm_Flag] bit NOT NULL,
  [SR_SLA_RecID] int NULL,
  [PP_Tax_Flag] bit NOT NULL,
  [NetBalance] decimal(18,2) NULL,
  [Overrun] decimal(18,2) NULL,
  [Billing_Company_RecID] int NULL,
  [Billing_Address_RecID] int NULL,
  [Restrict_DP_Flag] bit NOT NULL,
  [Billing_Terms_RecID] int NULL,
  [Avail_Balance] decimal(18,2) NULL,
  [parent_recid] int NULL,
  [Comp_Rate_Option] char(1) NULL,
  [Comp_Limit_Option] char(1) NULL,
  [Comp_Rate_Amount] decimal(18,2) NOT NULL,
  [Comp_Limit_Amount] decimal(18,2) NOT NULL,
  [Opportunity_RecID] int NULL,
  [Prorate_Flag] bit NOT NULL,
  [BL_InvTemplate_Setup_RecID] int NULL,
  [Remaining_Balance] decimal(18,2) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Billing_Contact_RecID] int NULL,
  [Ship_To_Company_RecID] int NULL,
  [Ship_To_Contact_RecID] int NULL,
  [Ship_To_Company_Address_RecID] int NULL,
  [Subcontractor_Company_Address_RecID] int NULL,
  [Company_Address_RecID] int NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Email_Template_RecID] int NULL,
  [Currency_RecID] int NOT NULL,
  [Auto_Invoice_Flag] bit NOT NULL,
  [Invoice_Prorated_Additions_Flag] bit NOT NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.AGR_Header_Calculated
CREATE TABLE [dbo].[AGR_Header_Calculated] (
  [AGR_AGR_Header_Calculated_RecID] int NOT NULL,
  [AGR_Header_RecID] int NOT NULL,
  [AvailReturn] decimal(18,2) NULL,
  [TypeReturn] char(1) NULL,
  [NetReturn] decimal(18,2) NULL,
  [OverReturn] decimal(18,2) NULL,
  [UsedReturn] decimal(18,2) NULL,
  [AdjReturn] decimal(18,2) NULL,
  [BalReturn] decimal(18,2) NULL,
  [OvgReturn] decimal(18,2) NULL,
  [RemainingBal] decimal(18,2) NULL
);
GO

-- dbo.AGR_Invoice_Amt
CREATE TABLE [dbo].[AGR_Invoice_Amt] (
  [AGR_Invoice_Amt_RecID] int NOT NULL,
  [AGR_Header_RecID] int NULL,
  [Month_Nbr] smallint NULL,
  [Year_Nbr] smallint NULL,
  [Monthly_Inv_Amt] decimal(18,2) NULL,
  [Monthly_Svc_Amt] decimal(18,2) NULL,
  [Billing_Log_RecID] int NULL,
  [Monthly_SalesTax_Amt] decimal(18,2) NOT NULL,
  [Monthly_Downpayment_Amt] decimal(18,2) NOT NULL
);
GO

-- dbo.AGR_Invoice_Wizard
CREATE TABLE [dbo].[AGR_Invoice_Wizard] (
  [agr_bill_recid] int NULL,
  [agr_header_recid] int NOT NULL,
  [company_recid] int NOT NULL,
  [agr_type_recid] int NOT NULL,
  [AGR_Billing_Cycle_RecID] int NULL,
  [owner_level_recid] int NOT NULL,
  [billing_unit_recid] int NOT NULL,
  [Currency_RecID] int NULL,
  [agr_amount] decimal(38,2) NOT NULL,
  [dtl_amount] decimal(38,2) NOT NULL,
  [nocharge_amount] decimal(38,2) NOT NULL,
  [child_amount] decimal(38,2) NOT NULL,
  [previous_amount] decimal(38,2) NOT NULL,
  [cyclebasis] nvarchar(13) NULL,
  [last_invoice_date] datetime NULL,
  [period_start_date] datetime NULL,
  [cancel_flag] char(10) NULL,
  [agr_cancel_flag] bit NOT NULL,
  [agr_date_cancel] datetime NULL,
  [agr_onetime_flag] bit NOT NULL,
  [period_end_date] datetime NULL,
  [AGR_Prorate_RecID] int NULL,
  [cancelled_period_amount] decimal(38,2) NOT NULL
);
GO

-- dbo.AGR_Prorate
CREATE TABLE [dbo].[AGR_Prorate] (
  [AGR_Prorate_RecID] int NOT NULL,
  [AGR_Header_RecID] int NOT NULL,
  [Billing_Log_RecID] int NULL,
  [Period_Start] date NULL,
  [Period_End] date NULL,
  [invoice_create_date] datetime NULL,
  [thru_date] datetime NULL,
  [Date_Invoice] datetime NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Entered_by] nvarchar(50) NOT NULL,
  [Cancel_By] nvarchar(50) NULL,
  [Cancel_Flag] bit NULL,
  [Date_Cancel_UTC] datetime NULL
);
GO

-- dbo.AGR_Type
CREATE TABLE [dbo].[AGR_Type] (
  [AGR_Type_RecID] int NOT NULL,
  [AGR_Type_Desc] nvarchar(50) NULL,
  [AGR_Inactive_Flag] bit NOT NULL,
  [SR_Urgency_RecID] int NULL,
  [AGR_Detail_Type_RecID] int NULL,
  [Bill_Cycle_RecID] int NULL,
  [Invoice_Desc] nvarchar(4000) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Bill_Amount] decimal(18,2) NULL,
  [OneTime_Flag] bit NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [OL_Restrict_Flag] bit NOT NULL,
  [BU_Restrict_Flag] bit NOT NULL,
  [Activity_Class_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [TopComment_Flag] bit NOT NULL,
  [BottomComment_Flag] bit NOT NULL,
  [TE_InvCust_Flag] bit NOT NULL,
  [EX_InvCust_Flag] bit NOT NULL,
  [IV_InvCust_Flag] bit NOT NULL,
  [TE_Billable_Flag] bit NOT NULL,
  [TE_Invoice_Flag] bit NOT NULL,
  [EX_Billable_Flag] bit NOT NULL,
  [EX_Invoice_Flag] bit NOT NULL,
  [IV_Billable_Flag] bit NOT NULL,
  [IV_Invoice_Flag] bit NOT NULL,
  [Taxable_Flag] bit NOT NULL,
  [TE_Amount] decimal(18,2) NULL,
  [AGR_Default_Flag] bit NOT NULL,
  [PP_Amount] decimal(18,2) NULL,
  [PP_Unlimited_Flag] bit NOT NULL,
  [PP_One_Time_Flag] bit NOT NULL,
  [AppCycle_ID] char(1) NULL,
  [PP_Time_Flag] bit NOT NULL,
  [PP_Expenses_Flag] bit NOT NULL,
  [PP_Products_Flag] bit NOT NULL,
  [PP_Expire_Flag] bit NOT NULL,
  [PP_Carryover_Flag] bit NOT NULL,
  [Carryover_Days] int NULL,
  [Overrun_Flag] bit NOT NULL,
  [Overrun_Limit] int NULL,
  [Prepay_Flag] bit NOT NULL,
  [PreSuf_Flag] bit NOT NULL,
  [Invoice_PreSuf] nvarchar(5) NULL,
  [Restrict_DP_Flag] bit NOT NULL,
  [Billing_Terms_RecID] int NULL,
  [SR_SLA_RecID] int NULL,
  [Charge_Firm_Flag] bit NOT NULL,
  [CycleBasis_ID] char(1) NULL,
  [PP_Tax_Flag] bit NOT NULL,
  [PM_Type_RecID] int NULL,
  [Comp_Rate_Option] char(1) NULL,
  [Comp_Rate_Amount] decimal(18,2) NULL,
  [Comp_Limit_Option] char(1) NULL,
  [Comp_Limit_Amount] decimal(18,2) NULL,
  [Copy_Work_Roles_Flag] bit NOT NULL,
  [Copy_Work_Types_Flag] bit NOT NULL,
  [Prorate_Flag] bit NOT NULL,
  [BL_InvTemplate_Setup_RecID] int NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [Email_Template_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Auto_Invoice_Flag] bit NOT NULL,
  [Invoice_Prorated_Additions_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.AGR_Type_Default
CREATE TABLE [dbo].[AGR_Type_Default] (
  [AGR_Type_Default_RecID] int NOT NULL,
  [AGR_Type_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NULL,
  [SR_Board_RecID] int NULL,
  [SR_Type_RecID] int NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.AGR_Type_Exclusion
CREATE TABLE [dbo].[AGR_Type_Exclusion] (
  [AGR_Type_Exclusion_RecID] int NOT NULL,
  [AGR_Type_RecID] int NOT NULL,
  [Activity_Type_RecID] int NULL,
  [Activity_Class_RecID] int NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.AGR_Type_WType
CREATE TABLE [dbo].[AGR_Type_WType] (
  [AGR_Type_WType_RecID] int NOT NULL,
  [AGR_Type_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [Date_Effective] datetime NULL,
  [Date_Ending] datetime NULL,
  [Rate] decimal(18,2) NOT NULL,
  [Rate_Type] char(1) NULL,
  [Hours_Min] decimal(18,2) NOT NULL,
  [Hours_Max] decimal(18,2) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NOT NULL,
  [TE_Billable_Flag] bit NOT NULL,
  [TE_Invoice_Flag] bit NOT NULL,
  [Round_Bill_Hrs] decimal(18,2) NULL,
  [Overage_Rate] decimal(18,2) NULL,
  [Overage_Rate_Type] char(1) NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Limit_To] decimal(18,2) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Api_Callback_Object
CREATE TABLE [dbo].[Api_Callback_Object] (
  [Api_Callback_Object_RecID] int NOT NULL,
  [Type_Id] int NOT NULL,
  [Level] int NOT NULL,
  [Object_RecID] int NOT NULL,
  [Api_Callback_Url_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Integration_Login_RecID] int NULL,
  [Description] nvarchar(100) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(50) NOT NULL,
  [Legacy_Callback_Flag] bit NOT NULL,
  [Name] nvarchar(100) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Failed_Count] int NOT NULL,
  [Api_Version] nvarchar(10) NULL,
  [Is_Self_Suppressed_Flag] bit NOT NULL,
  [Date_Last_Failure_Logged_UTC] datetime2(2) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Api_Callback_Url
CREATE TABLE [dbo].[Api_Callback_Url] (
  [Api_Callback_Url_RecID] int NOT NULL,
  [Url] nvarchar(2048) NULL
);
GO

-- dbo.Api_Integration
CREATE TABLE [dbo].[Api_Integration] (
  [Api_Integration_RecID] int NOT NULL,
  [Integration_Type_Id] char(1) NOT NULL,
  [Integrator] nvarchar(100) NULL,
  [Action_Name] nvarchar(1000) NOT NULL,
  [Request_Url] nvarchar(4000) NOT NULL,
  [Token] nvarchar(200) NULL,
  [Help_Url] nvarchar(4000) NULL,
  [Disabled_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Date_Entered_UTC] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NULL
);
GO

-- dbo.Api_Request_Token
CREATE TABLE [dbo].[Api_Request_Token] (
  [Api_Request_Token_RecID] int NOT NULL,
  [Token] uniqueidentifier NOT NULL,
  [Api_Integration_RecID] int NOT NULL
);
GO

-- dbo.Audit_Data_Type_Format
CREATE TABLE [dbo].[Audit_Data_Type_Format] (
  [Audit_Data_Type_Format_RecID] int NOT NULL,
  [Data_Type] nvarchar(32) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Audit_Source
CREATE TABLE [dbo].[Audit_Source] (
  [Audit_Source_RecId] smallint NOT NULL,
  [Locale_Key_RecId] int NULL,
  [Audit_Source_ID] nvarchar(150) NOT NULL
);
GO

-- dbo.Audit_SubType
CREATE TABLE [dbo].[Audit_SubType] (
  [Audit_SubType_RecID] smallint NOT NULL,
  [Audit_SubType_ID] nvarchar(200) NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Audit_Type
CREATE TABLE [dbo].[Audit_Type] (
  [Audit_Type_RecId] smallint NOT NULL,
  [Locale_Key_RecId] int NOT NULL,
  [Audit_Type_ID] nvarchar(150) NOT NULL
);
GO

-- dbo.Authentication_Service
CREATE TABLE [dbo].[Authentication_Service] (
  [Authentication_Service_RecID] int NOT NULL,
  [Name] nvarchar(50) NOT NULL,
  [Authentication_Service_ID] nvarchar(10) NOT NULL,
  [Assembly_Name] nvarchar(50) NOT NULL,
  [Type_Name] nvarchar(1000) NOT NULL,
  [Plugin] nvarchar(100) NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Authentication_Service_Config
CREATE TABLE [dbo].[Authentication_Service_Config] (
  [Authentication_Service_Config_RecID] int NOT NULL,
  [Authentication_Service_RecID] int NOT NULL,
  [Name] nvarchar(50) NOT NULL,
  [Value] nvarchar(max) NOT NULL,
  [Member_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Authentication_Service_Email_Tokens
CREATE TABLE [dbo].[Authentication_Service_Email_Tokens] (
  [Token_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Date_Entered_UTC] datetime2(0) NULL,
  [Auth_Code] varchar(255) NULL
);
GO

-- dbo.AuthZ_Permissions
CREATE TABLE [dbo].[AuthZ_Permissions] (
  [AuthZ_Permissions_RecID] int NOT NULL,
  [AuthZ_Permission] nvarchar(50) NOT NULL,
  [Module_Function_Name] nvarchar(10) NULL,
  [Module_function_recID] int NULL,
  [System_Setup_Screens_RecId] int NULL,
  [System_MM_Screens_RecID] int NULL,
  [Display_Module_Function_RecID] int NULL,
  [Presenter_Identifier_RecID] int NULL,
  [Access_Type] nvarchar(50) NOT NULL,
  [Access_Level] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.AuthZ_Security_Role_Content
CREATE TABLE [dbo].[AuthZ_Security_Role_Content] (
  [AuthZ_Security_Role_Content_RecID] int NOT NULL,
  [Content_Type] nvarchar(50) NOT NULL,
  [Module_function_recID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Avalara_Setup
CREATE TABLE [dbo].[Avalara_Setup] (
  [Avalara_Setup_RecID] int NOT NULL,
  [Account_Number] nvarchar(50) NULL,
  [License_Key] nvarchar(50) NULL,
  [Service_URL] nvarchar(250) NULL,
  [Company_Code] nvarchar(50) NULL,
  [Time_Tax_Code] nvarchar(50) NULL,
  [Expense_Tax_Code] nvarchar(50) NULL,
  [Product_Tax_Code] nvarchar(50) NULL,
  [Invoice_Amount_Tax_Code] nvarchar(50) NULL,
  [Enable_Avalara_Flag] bit NOT NULL,
  [Commit_Transactions_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Sales_Invoice_Flag] bit NOT NULL,
  [Freight_Tax_Code] nvarchar(50) NULL,
  [Accounting_Integration_Flag] bit NOT NULL,
  [Tax_Line_Flag] bit NOT NULL,
  [Tax_Integration_RecID] int NOT NULL
);
GO

-- dbo.Bill_Rate_Type
CREATE TABLE [dbo].[Bill_Rate_Type] (
  [Rate_Type_RecID] int NOT NULL,
  [Rate_Type_ID] char(1) NOT NULL,
  [Description] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(20) NULL,
  [Sort_Order] smallint NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Billable_Options
CREATE TABLE [dbo].[Billable_Options] (
  [Billable_Options_RecID] int NOT NULL,
  [Option_ID] nvarchar(3) NULL,
  [Billable_Flag] bit NULL,
  [Invoice_Flag] bit NULL,
  [Time_Flag] bit NULL,
  [Expense_Flag] bit NULL,
  [Product_Flag] bit NULL,
  [Default_Flag] bit NULL,
  [Include_Nodefault_Flag] bit NULL,
  [Locale_Key_RecID] int NULL,
  [Enum_Id] nvarchar(15) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Billing_Application
CREATE TABLE [dbo].[Billing_Application] (
  [Billing_Application_RecID] int NOT NULL,
  [Billing_Log_RecID] int NOT NULL,
  [Credit_Memo_RecID] int NULL,
  [Payment_Type] char(1) NOT NULL,
  [Applied_Amount] decimal(18,2) NOT NULL,
  [Date_Applied] datetime NULL,
  [Applied_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Payment_Source_RecID] tinyint NOT NULL,
  [Debit_GL_Entry_RecID] int NULL,
  [Credit_GL_Entry_RecID] int NULL
);
GO

-- dbo.Billing_Application_Export_Data
CREATE TABLE [dbo].[Billing_Application_Export_Data] (
  [Billing_Application_Export_Data_RecID] int NOT NULL,
  [Billing_Application_RecID] int NOT NULL,
  [GL_BatchID_RecID] int NULL,
  [Export_Status_RecID] tinyint NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Payment_Sync_Date_UTC] datetime2(0) NULL,
  [Unbatched_GL_BatchID_RecID] int NULL,
  [Unbatched_Export_Status_RecID] int NULL
);
GO

-- dbo.Billing_Cycle
CREATE TABLE [dbo].[Billing_Cycle] (
  [Bill_Cycle_ID] nvarchar(5) NOT NULL,
  [Bill_Cycle_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Billing_CycleOption_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Billing_CycleOption
CREATE TABLE [dbo].[Billing_CycleOption] (
  [Billing_CycleOption_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Nbr_Cycles] int NULL,
  [Cycle_Basis] char(1) NULL,
  [cycle_interval] int NULL
);
GO

-- dbo.Billing_Delivery
CREATE TABLE [dbo].[Billing_Delivery] (
  [Billing_Delivery_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Email_Flag] bit NULL,
  [Integration_Email_Flag] bit NOT NULL,
  [Integration_Print_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Billing_Invoice_Gen
CREATE TABLE [dbo].[Billing_Invoice_Gen] (
  [Next_Invoice_Number] int NOT NULL
);
GO

-- dbo.Billing_Log
CREATE TABLE [dbo].[Billing_Log] (
  [Billing_Log_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Remit_To_RecID] int NOT NULL,
  [Attention] nvarchar(61) NULL,
  [Company_Address_RecID] int NULL,
  [Invoice_Number] nvarchar(15) NULL,
  [Date_Invoice] date NULL,
  [Date_Created] datetime NOT NULL,
  [Billing_Terms_RecID] int NOT NULL,
  [Closed_By] nvarchar(15) NULL,
  [Date_Closed] datetime NULL,
  [Closed_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NOT NULL,
  [Top_Comment] nvarchar(max) NULL,
  [Bottom_Comment] nvarchar(max) NULL,
  [Reference] nvarchar(50) NULL,
  [Created_By] nvarchar(15) NULL,
  [Internal_Note] nvarchar(max) NULL,
  [Adj_Amount] decimal(18,2) NOT NULL,
  [Adj_By] nvarchar(15) NULL,
  [Adj_Reason] nvarchar(max) NULL,
  [Billing_Unit_RecID] int NULL,
  [Billing_Status_RecID] int NOT NULL,
  [Invoice_Amount] decimal(18,2) NOT NULL,
  [DownPayment] decimal(18,2) NOT NULL,
  [PM_Project_RecID] int NULL,
  [PM_Phase_RecID] int NULL,
  [PrintAdjust_Flag] bit NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Type_ID] char(1) NOT NULL,
  [PrintDetail_Flag] bit NOT NULL,
  [PrintRole_Flag] bit NOT NULL,
  [PrintHours_Flag] bit NOT NULL,
  [PrintRate_Flag] bit NOT NULL,
  [PrintAmount_Flag] bit NOT NULL,
  [Progress_Amount_Applied] decimal(18,2) NOT NULL,
  [Time_Amount] decimal(18,2) NOT NULL,
  [WIP_Amount] decimal(18,2) NOT NULL,
  [Sales_Tax_Amount] decimal(18,2) NOT NULL,
  [Expense_Amount] decimal(18,2) NOT NULL,
  [Misc_Amount] decimal(18,2) NOT NULL,
  [Charge_Firm_Flag] bit NOT NULL,
  [rem_downpayment] decimal(18,2) NOT NULL,
  [Taxable_Amount] decimal(18,2) NOT NULL,
  [tax_code_recid] int NULL,
  [override_dp_flag] bit NOT NULL,
  [SR_Service_RecID] int NULL,
  [fixedfee_flag] bit NOT NULL,
  [bl_taxservices_flag] bit NOT NULL,
  [bl_taxdpapplied_flag] bit NOT NULL,
  [territory_recid] int NULL,
  [AGR_Header_RecID] int NULL,
  [Run_Month] int NULL,
  [Run_Year] int NULL,
  [AGR_Amount] decimal(18,2) NOT NULL,
  [AGR_Hours] decimal(18,2) NULL,
  [Agr_Adjustment] decimal(18,2) NOT NULL,
  [Run_Date] date NULL,
  [Email_Flag] bit NOT NULL,
  [Email_Template_RecID] int NULL,
  [show_all_time_flag] bit NOT NULL,
  [PO_Number] nvarchar(50) NULL,
  [Order_Header_RecID] int NULL,
  [Date_Paid] datetime NULL,
  [Processing_Flag] bit NOT NULL,
  [Date_Processing] datetime NULL,
  [Notification_History] nvarchar(max) NOT NULL,
  [DB_Timestamp] timestamp NOT NULL,
  [Restrict_Downpayment_Flag] bit NOT NULL,
  [Non_Addition_Amount] decimal(18,2) NOT NULL,
  [BL_InvTemplate_Setup_RecID] int NULL,
  [Ava_Committed_Flag] bit NOT NULL,
  [Ship_To_Company_RecID] int NULL,
  [Ship_To_Attention] nvarchar(61) NULL,
  [Ship_To_Company_Address_RecID] int NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Date_Closed_UTC] datetime NULL,
  [Date_Paid_UTC] datetime NULL,
  [Date_Processing_UTC] datetime NULL,
  [Unbatched_GL_BatchID_RecID] int NULL,
  [Ava_Calculated_Flag] bit NOT NULL,
  [Contact_RecID] int NULL,
  [Currency_RecID] int NOT NULL,
  [Id] uniqueidentifier NULL,
  [AsioInvoice_Flag] bit NOT NULL
);
GO

-- dbo.Billing_Log_Audit
CREATE TABLE [dbo].[Billing_Log_Audit] (
  [Billing_Log_Audit_RecId] int NOT NULL,
  [Billing_Log_RecId] int NOT NULL,
  [Locale_Key_RecId] int NULL,
  [Audit_Source_RecId] smallint NOT NULL,
  [Audit_Type_RecId] smallint NOT NULL,
  [Updated_by] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL
);
GO

-- dbo.Billing_Log_Audit_Value
CREATE TABLE [dbo].[Billing_Log_Audit_Value] (
  [Billing_Log_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(2000) NOT NULL,
  [Audit_Value] nvarchar(max) NOT NULL,
  [Billing_Log_Audit_RecID] int NOT NULL
);
GO

-- dbo.Billing_Log_Tax
CREATE TABLE [dbo].[Billing_Log_Tax] (
  [Billing_Log_Tax_RecID] int NOT NULL,
  [Billing_Log_RecID] int NOT NULL,
  [Tax_Level] tinyint NOT NULL,
  [Taxable_Amount] decimal(18,2) NULL,
  [Tax_Amount] decimal(18,2) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Billing_Log_User_Defined_Field_Value
CREATE TABLE [dbo].[Billing_Log_User_Defined_Field_Value] (
  [Billing_Log_User_Defined_Field_Value_RecID] bigint NOT NULL,
  [Billing_Log_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [User_Defined_Field_Value] nvarchar(1000) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Billing_Routing
CREATE TABLE [dbo].[Billing_Routing] (
  [Billing_Routing_RecID] int NOT NULL,
  [Billing_Log_RecID] int NOT NULL,
  [Seq_Nbr] smallint NULL,
  [Member_RecID] int NOT NULL,
  [Reviewed_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Reviewed_UTC] datetime2(0) NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.Billing_Setup
CREATE TABLE [dbo].[Billing_Setup] (
  [Billing_Setup_RecID] int NOT NULL,
  [Remit_Name] nvarchar(50) NOT NULL,
  [Remit_Address_Line1] nvarchar(50) NULL,
  [Remit_Address_Line2] nvarchar(50) NULL,
  [Remit_City] nvarchar(50) NULL,
  [Remit_State_ID] nvarchar(50) NULL,
  [Remit_Zip] nvarchar(12) NULL,
  [Payable_Name] nvarchar(50) NULL,
  [Remit_Phone] nvarchar(15) NULL,
  [Invoice_Footer] nvarchar(500) NULL,
  [top_comment] nvarchar(4000) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Owner_Level_RecID] int NULL,
  [PrintDetail_Flag] bit NOT NULL,
  [PrintRole_Flag] bit NOT NULL,
  [PrintHours_Flag] bit NOT NULL,
  [PrintRate_Flag] bit NOT NULL,
  [PrintAmount_Flag] bit NOT NULL,
  [PrintLogo_Flag] bit NOT NULL,
  [Logo_Link] nvarchar(500) NULL,
  [NoEmail_Flag] bit NULL,
  [BillSR_Flag] bit NULL,
  [BillComplete_Flag] bit NULL,
  [BillUnapp_Flag] bit NULL,
  [ProgressTime_flag] bit NULL,
  [PM_BillUnApp_Flag] bit NULL,
  [PM_BillComplete_Flag] bit NULL,
  [Charge_Firm_Flag] bit NULL,
  [Currency_RecID] int NULL,
  [PreSuf_Flag] bit NULL,
  [Invoice_PreSuf] nvarchar(5) NULL,
  [Email_Template_RecID] int NULL,
  [Quote_Footer] nvarchar(1000) NULL,
  [country_recid] int NULL,
  [Localization1] nvarchar(50) NULL,
  [Localization2] nvarchar(50) NULL,
  [Localization3] nvarchar(50) NULL,
  [Localization4] nvarchar(50) NULL,
  [Localization5] nvarchar(50) NULL,
  [Invoice_Title] nvarchar(50) NULL,
  [Remit_Country_RecID] int NULL,
  [Read_Receipt_Flag] bit NOT NULL,
  [Delivery_Receipt_Flag] bit NOT NULL,
  [SO_BillClosed_Flag] bit NULL,
  [SO_BillShipped_Flag] bit NULL,
  [EX_WriteOff_Flag] bit NOT NULL,
  [TE_WriteOff_Flag] bit NOT NULL,
  [IV_WriteOff_Flag] bit NOT NULL,
  [Invoice_Custom_Label] nvarchar(50) NULL,
  [Invoice_Custom_Text] nvarchar(500) NULL,
  [No_Watermark_Flag] bit NOT NULL,
  [Restrict_So_Downpayment] bit NOT NULL,
  [Restrict_Prj_Downpayment] bit NOT NULL,
  [Ava_Validated_Flag] bit NOT NULL,
  [Company_Code] nvarchar(250) NULL,
  [Exclude_Avalara_Flag] bit NOT NULL,
  [Default_InvTemplate_Setup_RecID] int NULL,
  [Actual_InvTemplate_Setup_RecID] int NULL,
  [Fixed_Fee_InvTemplate_Setup_RecID] int NULL,
  [Progress_InvTemplate_Setup_RecID] int NULL,
  [Agreement_InvTemplate_Setup_RecID] int NULL,
  [Credit_Memo_InvTemplate_Setup_RecID] int NULL,
  [Downpayment_InvTemplate_Setup_RecID] int NULL,
  [Misc_InvTemplate_Setup_RecID] int NULL,
  [Expense_Tax_Flag] bit NOT NULL,
  [SO_Copy_NonServiceProducts] bit NOT NULL,
  [SO_Copy_ServiceProducts] bit NOT NULL,
  [SO_Copy_AgreementProducts] bit NOT NULL,
  [SO_InvTemplate_Setup_RecID] int NULL,
  [Allow_Restricted_Dept_On_Routing_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Attach_Xml_Invoice_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Billing_Setup_Routing
CREATE TABLE [dbo].[Billing_Setup_Routing] (
  [Billing_Setup_Routing_RecID] int NOT NULL,
  [Billing_Setup_RecID] int NULL,
  [Seq_Nbr] smallint NULL,
  [Member_RecID] int NULL,
  [BL_Routing_Rule_ID] char(1) NULL,
  [BL_Invoice_Rule_ID] char(1) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Billing_Status
CREATE TABLE [dbo].[Billing_Status] (
  [Billing_Status_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Default_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Closed_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NULL,
  [Sent_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Sort_Order] int NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Billing_Terms
CREATE TABLE [dbo].[Billing_Terms] (
  [Billing_Terms_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Due_Days] int NULL,
  [Terms_Xref] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Billing_Type
CREATE TABLE [dbo].[Billing_Type] (
  [Billing_Type_ID] char(1) NOT NULL,
  [Description] nvarchar(20) NULL,
  [Billing_Type_RecID] int NOT NULL,
  [Downpayment_Flag] bit NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Billing_Unit
CREATE TABLE [dbo].[Billing_Unit] (
  [Billing_Unit_ID] nvarchar(15) NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Board_Icon] nvarchar(100) NULL,
  [service_flag] bit NULL,
  [NoService_Flag] bit NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Billing_Unit_Loc
CREATE TABLE [dbo].[Billing_Unit_Loc] (
  [Billing_Unit_Loc_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Member_RecID] int NULL,
  [Dispatch] int NULL,
  [ServiceManager] int NULL,
  [DutyManager] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Billing_Unit_Loc_Extended_Property
CREATE TABLE [dbo].[Billing_Unit_Loc_Extended_Property] (
  [Billing_Unit_Loc_Extended_Property_RecID] int NOT NULL,
  [Name] nvarchar(100) NOT NULL,
  [Default_Value] nvarchar(100) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Billing_Unit_Loc_Extended_Property_Value
CREATE TABLE [dbo].[Billing_Unit_Loc_Extended_Property_Value] (
  [Billing_Unit_Loc_Extended_Property_Value_RecID] int NOT NULL,
  [Billing_Unit_Loc_Extended_Property_RecID] int NOT NULL,
  [Billing_Unit_Loc_RecID] int NOT NULL,
  [Value] nvarchar(100) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.BL_Invoice_Rule
CREATE TABLE [dbo].[BL_Invoice_Rule] (
  [BL_Invoice_Rule_ID] char(1) NOT NULL,
  [Description] nvarchar(30) NULL,
  [BL_Invoice_Rule_RecID] int NOT NULL
);
GO

-- dbo.bl_invTemplate
CREATE TABLE [dbo].[bl_invTemplate] (
  [BL_InvTemplate_RecID] int NOT NULL,
  [Template_Name] nvarchar(50) NULL,
  [Header_Account_Caption] nvarchar(50) NULL,
  [Header_Terms_Caption] nvarchar(50) NULL,
  [Header_Due_Date_Caption] nvarchar(50) NULL,
  [Header_PO_Number_Caption] nvarchar(50) NULL,
  [Header_Reference_Caption] nvarchar(50) NULL,
  [Service_Header_Ticket_Number_Caption] nvarchar(50) NULL,
  [Service_Header_Summary_Caption] nvarchar(50) NULL,
  [Service_Header_Detail_Description_Caption] nvarchar(50) NULL,
  [Service_Header_Resolution_Caption] nvarchar(50) NULL,
  [Project_Header_Project_Name_Caption] nvarchar(50) NULL,
  [Project_Header_Billing_Type_Caption] nvarchar(50) NULL,
  [Project_Header_Original_Downpayment_Caption] nvarchar(50) NULL,
  [Project_Header_Amount_Caption] nvarchar(50) NULL,
  [Services_Work_Role_Caption] nvarchar(50) NULL,
  [Services_Work_Type_Caption] nvarchar(50) NULL,
  [Services_Staff_Caption] nvarchar(50) NULL,
  [Services_Hours_Caption] nvarchar(50) NULL,
  [Services_Rate_Caption] nvarchar(50) NULL,
  [Services_Amount_Caption] nvarchar(50) NULL,
  [Expenses_Type_Caption] nvarchar(50) NULL,
  [Expenses_Staff_Caption] nvarchar(50) NULL,
  [Expenses_Amount_Caption] nvarchar(50) NULL,
  [Other_Charges_Description_Caption] nvarchar(50) NULL,
  [Other_Charges_Quantity_Caption] nvarchar(50) NULL,
  [Other_Charges_Price_Caption] nvarchar(50) NULL,
  [Other_Charges_Amount_Caption] nvarchar(50) NULL,
  [Adjustment_Description_Caption] nvarchar(50) NULL,
  [Adjustment_Quantity_Caption] nvarchar(50) NULL,
  [Adjustment_Price_Caption] nvarchar(50) NULL,
  [Adjustment_Amount_Caption] nvarchar(50) NULL,
  [Services_Work_Role_Visible] bit NULL,
  [Services_Work_Type_Visible] bit NULL,
  [Services_Staff_Visible] bit NULL,
  [Services_Hours_Visible] bit NULL,
  [Services_Rate_Visible] bit NULL,
  [Services_Amount_Visible] bit NULL,
  [Expenses_Type_Visible] bit NULL,
  [Expenses_Staff_Visible] bit NULL,
  [Expenses_Amount_Visible] bit NULL,
  [Other_Charges_Description_Visible] bit NULL,
  [Other_Charges_Quantity_Visible] bit NULL,
  [Other_Charges_Price_Visible] bit NULL,
  [Other_Charges_Amount_Visible] bit NULL,
  [Adjustment_Description_Visible] bit NULL,
  [Adjustment_Quantity_Visible] bit NULL,
  [Adjustment_Price_Visible] bit NULL,
  [Adjustment_Amount_Visible] bit NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(50) NULL,
  [Time_Detail_Visible] bit NULL,
  [Time_Detail_Primary_Sort_Field] nvarchar(50) NULL,
  [Time_Detail_Primary_Sort_Direction] char(1) NULL,
  [Time_Detail_Secondary_Sort_Field] nvarchar(50) NULL,
  [Time_Detail_Secondary_Sort_Direction] char(1) NULL,
  [Time_Detail_Subtotal_Visible] bit NULL,
  [Time_Detail_Start_End_Time_Visible] bit NULL,
  [Time_Detail_Hours_Visible] bit NULL,
  [Time_Detail_Members_Visible] bit NULL,
  [Time_Detail_Billable_Visible] bit NULL,
  [Time_Detail_Extended_Amount_Visible] bit NULL,
  [Time_Detail_Dollar_Amounts_On_Hoursbased_Visible] bit NULL,
  [Service_Header_Detail_Description_Visible] bit NULL,
  [Service_Header_Resolution_Visible] bit NULL,
  [Service_Header_Company_Name_Caption] nvarchar(50) NULL,
  [Service_Header_Company_Name_Visible] bit NULL,
  [Project_Header_Company_Name_Caption] nvarchar(50) NULL,
  [Project_Header_Company_Name_Visible] bit NULL,
  [Project_Header_Billing_Type_Visible] bit NULL,
  [Project_Header_Original_Downpayment_Visible] bit NULL,
  [Project_Header_Amount_Visible] bit NULL,
  [Service_Header_Contact_Name_Caption] nvarchar(50) NULL,
  [Service_Header_Contact_Name_Visible] bit NULL,
  [Project_Header_Contact_Name_Caption] nvarchar(50) NULL,
  [Project_Header_Contact_Name_Visible] bit NULL,
  [Margin_Left] decimal(18,2) NULL,
  [Margin_Top] decimal(18,2) NULL,
  [Margin_Right] decimal(18,2) NULL,
  [Margin_Bottom] decimal(18,2) NULL,
  [Project_Header_Billing_Method_Caption] nvarchar(50) NULL,
  [Project_Header_Billing_Method_Visible] bit NULL,
  [Service_Header_Billing_Method_Visible] bit NULL,
  [Service_Header_Billing_Method_Caption] nvarchar(50) NULL,
  [Services_Total_Visible] bit NULL,
  [Expenses_Total_Visible] bit NULL,
  [Other_Charges_Total_Visible] bit NULL,
  [Adjustment_Total_Visible] bit NULL,
  [Service_Header_Display_Bundled_Tickets] bit NULL,
  [Time_Detail_Hourly_Rate_Visible] bit NULL,
  [Time_Detail_Contacts_Visible] bit NULL,
  [Time_Detail_Notes_Visible] bit NULL,
  [Time_Detail_NonBillable_Caption] nvarchar(100) NULL,
  [Expense_Detail_Subtotal_Visible] bit NULL,
  [Expense_Detail_Members_Visible] bit NULL,
  [Expense_Detail_Contacts_Visible] bit NULL,
  [Expense_Detail_Billable_Visible] bit NULL,
  [Expense_Detail_Ext_Amount_Visible] bit NULL,
  [Expense_Detail_Notes_Visible] bit NULL,
  [Expense_Detail_Primary_Sort_Field] nvarchar(50) NULL,
  [Expense_Detail_Primary_Sort_Direction] char(1) NULL,
  [Expense_Detail_Secondary_Sort_Field] nvarchar(50) NULL,
  [Expense_Detail_Secondary_Sort_Direction] char(1) NULL,
  [Expense_Detail_Nonbillable_Caption] nvarchar(100) NULL,
  [Expense_Detail_Visible] bit NULL,
  [Payable_Caption] nvarchar(1000) NULL,
  [Logo_Visible] bit NULL,
  [Remit_To_Visible] bit NULL,
  [Other_Charges_Item_ID_Visible] bit NULL,
  [Currency_Symbol_Visible] bit NULL,
  [Currency_ID_Visible] bit NULL,
  [SR_Open_Tasks_Visible] bit NULL,
  [SR_Closed_Tasks_Visible] bit NULL,
  [Adjustment_Agr_Type_Visible] bit NOT NULL,
  [Service_Header_Ticket_Number_Visible] bit NULL,
  [Service_Header_Summary_Visible] bit NULL,
  [Project_Header_Project_Name_Visible] bit NULL,
  [Services_Member_Name_Visible] bit NULL,
  [Services_Member_Name_Caption] nvarchar(50) NULL,
  [Header_Account_Visible] bit NOT NULL,
  [Header_Terms_Visible] bit NOT NULL,
  [Header_Due_Date_Visible] bit NOT NULL,
  [Header_PO_Number_Visible] bit NOT NULL,
  [Header_Reference_Visible] bit NOT NULL,
  [Header_TaxID_Caption] nvarchar(50) NULL,
  [Header_Logo_Position] char(1) NULL,
  [Header_Title_Position] char(1) NULL,
  [Header_Title_Caption] nvarchar(50) NULL,
  [Header_TaxID_Visible] bit NOT NULL,
  [Header_Title_Visible] bit NOT NULL,
  [Header_Title_Font] nvarchar(10) NULL,
  [Header_Address_Position] char(1) NULL,
  [Time_Detail_Agreement_Visible] bit NOT NULL,
  [Time_Detail_Hoursbased_Hours_Visible] bit NOT NULL,
  [Time_Detail_Hoursbased_Ext_Amount_Visible] bit NOT NULL,
  [Time_Detail_Hoursbased_Hourly_Rate_Visible] bit NOT NULL,
  [Time_Detail_Amountbased_Hours_Visible] bit NOT NULL,
  [Time_Detail_Amountbased_Ext_Amount_Visible] bit NOT NULL,
  [Time_Detail_Amountbased_Hourly_Rate_Visible] bit NOT NULL,
  [Time_Detail_SR_Ticket_Summary_Visible] bit NOT NULL,
  [Time_Detail_SR_Contact_Visible] bit NOT NULL,
  [Time_Detail_SR_Address_Visible] bit NOT NULL,
  [Time_Detail_PM_Phase_Visible] bit NOT NULL,
  [Time_Detail_PM_Summary_Visible] bit NOT NULL,
  [Expense_Detail_Agreement_Visible] bit NOT NULL,
  [Expense_Detail_Agreement_Ext_Amount_Visible] bit NOT NULL,
  [Expense_Detail_Ticket_Number_Visible] bit NOT NULL,
  [Expense_Detail_SR_Ticket_Summary_Visible] bit NOT NULL,
  [Time_Detail_Ticket_Number_Visible] bit NOT NULL,
  [Expense_Detail_SR_Contact_Visible] bit NOT NULL,
  [Expense_Detail_SR_Address_Visible] bit NOT NULL,
  [Expense_Detail_PM_Phase_Visible] bit NOT NULL,
  [Expense_Detail_PM_Summary_Visible] bit NOT NULL,
  [Other_Charges_Serial_Nbr_Visible] bit NOT NULL,
  [Service_Header_Amount_Caption] nvarchar(50) NULL,
  [Header_Hoursbased_Extended_Amount_Visible] bit NOT NULL,
  [Service_Header_Amount_Visible] bit NOT NULL,
  [Time_Detail_Dates_Visible] bit NULL,
  [Header_Ship_To_Visible] bit NOT NULL,
  [Header_Ship_To_Caption] nvarchar(50) NULL,
  [Other_Charges_Display_Six_Decimals] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Invoice_Payment_Amount_Caption] nvarchar(50) NULL,
  [Invoice_Credit_Amount_Caption] nvarchar(50) NULL,
  [Invoice_Balance_Due_Caption] nvarchar(50) NULL,
  [Credit_Credit_Amount_Caption] nvarchar(50) NULL,
  [Credit_Remaining_Amount_Caption] nvarchar(50) NULL,
  [Invoice_Payment_Amount_Visible] bit NOT NULL,
  [Invoice_Credit_Amount_Visible] bit NOT NULL,
  [Invoice_Balance_Due_Visible] bit NOT NULL,
  [Credit_Credit_Amount_Visible] bit NOT NULL,
  [Credit_Remaining_Amount_Visible] bit NOT NULL,
  [Portal_Flag] bit NOT NULL,
  [Services_Collapsed_Flag] bit NOT NULL,
  [Expenses_Collapsed_Flag] bit NOT NULL,
  [Other_Charges_Collapsed_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.BL_InvTemplate_Setup
CREATE TABLE [dbo].[BL_InvTemplate_Setup] (
  [BL_InvTemplate_Setup_RecID] int NOT NULL,
  [BL_InvTemplate_RecID] int NULL,
  [BL_InvTemplate_Custom_RecID] int NULL
);
GO

-- dbo.BL_Routing_Rule
CREATE TABLE [dbo].[BL_Routing_Rule] (
  [BL_Routing_Rule_ID] char(1) NOT NULL,
  [Description] nvarchar(50) NULL,
  [BL_Routing_Rule_RecID] int NOT NULL
);
GO

-- dbo.BR_Detail
CREATE TABLE [dbo].[BR_Detail] (
  [BR_Detail_RecID] int NOT NULL,
  [BR_Header_RecID] int NOT NULL,
  [BR_KPI_RecID] int NOT NULL,
  [Sort_Order] int NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.BR_Header
CREATE TABLE [dbo].[BR_Header] (
  [BR_Header_RecID] int NOT NULL,
  [Name] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.BR_KPI
CREATE TABLE [dbo].[BR_KPI] (
  [BR_KPI_RecID] int NOT NULL,
  [BR_KPI_Category_RecID] int NOT NULL,
  [Description] nvarchar(100) NULL,
  [Stored_Procedure] nvarchar(50) NULL,
  [Output_Format] nvarchar(3) NULL,
  [Date_Filter] nvarchar(50) NULL,
  [Sort_Order] int NULL,
  [Inactive_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.BR_KPI_Category
CREATE TABLE [dbo].[BR_KPI_Category] (
  [BR_KPI_Category_RecID] int NOT NULL,
  [Description] nvarchar(100) NULL,
  [Sort_Order] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.BR_Kpi_Color
CREATE TABLE [dbo].[BR_Kpi_Color] (
  [BR_Kpi_Color_RecID] int NOT NULL,
  [Color] nvarchar(50) NULL,
  [Image_Link] nvarchar(255) NULL,
  [Minimum_Value] decimal(18,2) NOT NULL
);
GO

-- dbo.Budget_Analysis
CREATE TABLE [dbo].[Budget_Analysis] (
  [Budget_Analysis_RecID] int NOT NULL,
  [Budget_Analysis_ID] nvarchar(2) NOT NULL,
  [Analysis_Description] nvarchar(30) NOT NULL,
  [Last_Updated_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Default_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Calendar_Setup
CREATE TABLE [dbo].[Calendar_Setup] (
  [Calendar_Setup_RecID] int NOT NULL,
  [Week_Start] smallint NULL,
  [Updated_by] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Adj1Start] datetime2(0) NULL,
  [Adj1End] datetime2(0) NULL,
  [Adj1Hours] float NULL,
  [Adj2Start] datetime2(0) NULL,
  [Adj2End] datetime2(0) NULL,
  [Adj2Hours] float NULL,
  [Adj3Start] datetime2(0) NULL,
  [Adj3End] datetime2(0) NULL,
  [Adj3Hours] float NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Calendar_Sync
CREATE TABLE [dbo].[Calendar_Sync] (
  [Calendar_Sync_RecID] int NOT NULL,
  [Type] int NOT NULL,
  [Tenant_ID] nvarchar(4000) NULL,
  [Client_ID] nvarchar(100) NULL,
  [Gmail_Flag] bit NOT NULL,
  [Office365_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Server_Url] nvarchar(2000) NULL,
  [Username] nvarchar(320) NULL,
  [Password] nvarchar(4000) NULL,
  [Domain] nvarchar(100) NULL,
  [Company_Contacts_Folder] nvarchar(255) NULL,
  [Service_Account_Email] nvarchar(320) NULL,
  [P12_File] nvarchar(max) NULL,
  [P12_File_Name] nvarchar(255) NULL,
  [Authorized_Flag] bit NOT NULL,
  [Date_Authorized_UTC] datetime2(0) NULL,
  [Authorized_By] nvarchar(15) NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Token] nvarchar(100) NULL,
  [Token_Expiration_UTC] datetime2(0) NULL,
  [Token_Entered_By] nvarchar(15) NULL,
  [Queue_Name] nvarchar(150) NULL,
  [Client_Secret] nvarchar(4000) NULL,
  [Impersonation_Flag] bit NOT NULL,
  [Log_Flag] bit NOT NULL,
  [Company] nvarchar(150) NULL,
  [Import_Days_Back] int NOT NULL,
  [Import_Days_Future] int NOT NULL
);
GO

-- dbo.Campaign_Status
CREATE TABLE [dbo].[Campaign_Status] (
  [Campaign_Status_RecID] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Campaign_SubType
CREATE TABLE [dbo].[Campaign_SubType] (
  [Campaign_Subtype_RecID] int NOT NULL,
  [Campaign_Type_RecID] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Campaign_Type
CREATE TABLE [dbo].[Campaign_Type] (
  [Campaign_Type_RecID] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Client_Api_Hosted
CREATE TABLE [dbo].[Client_Api_Hosted] (
  [Client_Api_Hosted_RecID] int NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Origin] nvarchar(100) NULL,
  [Url] nvarchar(1024) NOT NULL,
  [Created_By] nvarchar(50) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(50) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Pod_Height] int NULL,
  [Client_Api_Hosted_Type] nvarchar(25) NOT NULL,
  [Toolbar_Button_Dialog_Height] int NULL,
  [Toolbar_Button_Dialog_Width] int NULL,
  [Toolbar_Button_Text] nvarchar(50) NULL,
  [Toolbar_Button_ToolTip] nvarchar(50) NULL,
  [Presenter_Identifier_Client_Api_RecID] int NULL,
  [Locations_Enabled_Flag] bit NOT NULL,
  [Client_ID] nvarchar(255) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Client_API_Hosted_Owner_Level
CREATE TABLE [dbo].[Client_API_Hosted_Owner_Level] (
  [Client_API_Hosted_Owner_Level_RecID] int NOT NULL,
  [Client_API_Hosted_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Client_Module_Identifier
CREATE TABLE [dbo].[Client_Module_Identifier] (
  [Client_Module_Identifier_RecID] int NOT NULL,
  [Client_Module_Identifier] nvarchar(50) NOT NULL
);
GO

-- dbo.Commission
CREATE TABLE [dbo].[Commission] (
  [Commission_RecID] int NOT NULL,
  [Member_RecID] int NULL,
  [Commission_Percent] decimal(8,2) NULL,
  [Date_Start] date NOT NULL,
  [Date_end] date NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Company_RecID] int NULL,
  [Company_Address_RecID] int NULL,
  [AGR_Header_RecID] int NULL,
  [PM_Project_RecID] int NULL,
  [SR_Board_RecID] int NULL,
  [SR_Service_RecID] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Territory_RecID] int NULL,
  [Billing_Method_ID] char(1) NULL,
  [SR_Type_RecID] int NULL,
  [PM_Board_RecID] int NULL,
  [PM_Type_RecID] int NULL,
  [AGR_Type_RecID] int NULL,
  [Nbr_Months] int NULL,
  [IV_Cat_RecID] int NULL,
  [IV_SubCat_RecID] int NULL,
  [IV_Item_RecID] int NULL,
  [Commission_Basis] char(1) NULL,
  [Invoice_Option] char(1) NULL,
  [Services_Flag] bit NOT NULL,
  [Agreements_Flag] bit NOT NULL,
  [Products_Flag] bit NOT NULL,
  [MyOpps_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Communication_Type
CREATE TABLE [dbo].[Communication_Type] (
  [Communication_Type_RecID] int NOT NULL,
  [Communication_Name] nvarchar(30) NULL,
  [Phone_Flag] bit NOT NULL,
  [Fax_Flag] bit NOT NULL,
  [Email_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [default_flag] bit NOT NULL,
  [Exchange_Xref] nvarchar(50) NULL,
  [Iphone_Xref] nvarchar(50) NULL,
  [Android_Xref] nvarchar(25) NULL,
  [Google_Xref] nvarchar(25) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Created_UTC] datetime2(0) NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NOT NULL,
  [Disabled] bit NOT NULL
);
GO

-- dbo.Company
CREATE TABLE [dbo].[Company] (
  [Company_RecID] int NOT NULL,
  [Company_ID] nvarchar(50) NULL,
  [Company_Name] nvarchar(50) NULL,
  [PhoneNbr] nvarchar(30) NULL,
  [PhoneNbr_Fax] nvarchar(30) NULL,
  [Website_URL] nvarchar(255) NULL,
  [Account_Nbr] nvarchar(128) NULL,
  [Time_Zone_RecID] int NULL,
  [SIC_Code_ID] nvarchar(10) NULL,
  [Remit_To_RecID] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Company_Status_RecID] int NULL,
  [Tax_Code_RecID] int NULL,
  [Currency_RecID] int NULL,
  [Owner_Level_RecID] int NULL,
  [Userfield_1] nvarchar(50) NULL,
  [Userfield_2] nvarchar(50) NULL,
  [Userfield_3] nvarchar(50) NULL,
  [Userfield_4] nvarchar(50) NULL,
  [Userfield_5] nvarchar(50) NULL,
  [Userfield_6] nvarchar(50) NULL,
  [Userfield_7] nvarchar(50) NULL,
  [Userfield_8] nvarchar(50) NULL,
  [Userfield_9] nvarchar(50) NULL,
  [Userfield_10] nvarchar(50) NULL,
  [Delete_Flag] bit NOT NULL,
  [Date_Deleted] datetime2(0) NULL,
  [deleted_by] nvarchar(15) NULL,
  [Market_RecID] int NULL,
  [Lead_Flag] bit NOT NULL,
  [Lead_Source] nvarchar(50) NULL,
  [Parent_Company_RecID] int NULL,
  [Annual_Revenue] decimal(18,2) NOT NULL,
  [Revenue_Year] int NULL,
  [Nbr_Employees] int NULL,
  [Ownership_Type_RecID] int NULL,
  [Date_Entered] datetime2(0) NOT NULL,
  [Billing_Terms_RecID] int NULL,
  [Billing_Delivery_RecID] int NULL,
  [Internal_Flag] bit NOT NULL,
  [SR_Notify] char(1) NULL,
  [AutoAssign_Flag] bit NOT NULL,
  [SR_Signoff_RecID] int NOT NULL,
  [Bill_Override_Flag] bit NOT NULL,
  [Bill_SR_Flag] bit NOT NULL,
  [Bill_Complete_SR_Flag] bit NOT NULL,
  [Bill_Unapproved_SR_Flag] bit NOT NULL,
  [Bill_Complete_PM_Flag] bit NOT NULL,
  [Bill_Unapproved_PM_Flag] bit NOT NULL,
  [Bill_Restrict_Down_Payment_PM_Flag] bit NOT NULL,
  [Approval_Flag] bit NOT NULL,
  [Tax_ID] nvarchar(50) NULL,
  [Exchange_Href] nvarchar(500) NULL,
  [Unsubscribe_Flag] bit NULL,
  [Vendor_Nbr] nvarchar(128) NULL,
  [IV_Price_Header_RecID] int NULL,
  [Email_Cc_Flag] bit NOT NULL,
  [Email_Cc_Address] nvarchar(1000) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Office_Calendar_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Deleted_UTC] datetime2(0) NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Acquired_UTC] datetime2(0) NULL,
  [Profile_Last_Update_UTC] datetime2(0) NULL,
  [Profile_Last_Updated_By] nvarchar(15) NULL,
  [Annual_Revenue_Update_UTC] datetime2(0) NOT NULL,
  [Customer_Usage_Type_RecID] int NULL,
  [Notification_History] nvarchar(max) NOT NULL,
  [BL_InvTemplate_Setup_RecID] int NULL,
  [Email_Template_RecID] int NULL,
  [Options_Last_Update_UTC] datetime2(0) NOT NULL,
  [Options_Updated_By] nvarchar(15) NOT NULL,
  [Year_Established] smallint NULL,
  [Reseller_Id] nvarchar(128) NULL,
  [Core_Entity_Company_ID] nvarchar(36) NULL,
  [Core_Entity_Updated_By] nvarchar(15) NOT NULL,
  [Core_Entity_Last_Update_UTC] datetime2(0) NOT NULL,
  [M365_Contact_Sync_Flag] bit NOT NULL,
  [Id] uniqueidentifier NULL,
  [Credit_Limit] decimal(18,2) NULL,
  [Additional_Debt] decimal(18,2) NULL
);
GO

-- dbo.Company_Activity_Type
CREATE TABLE [dbo].[Company_Activity_Type] (
  [Company_Activity_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Hours_Min] decimal(18,2) NULL,
  [Rate_Type] char(1) NOT NULL,
  [Rate] decimal(18,2) NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update] datetime NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Hours_Max] decimal(18,2) NULL,
  [Billable_Flag] bit NOT NULL,
  [Activity_Type_RecID] int NULL,
  [AGR_Header_RecID] int NULL,
  [Invoice_Flag] bit NULL,
  [Owner_Level_RecID] int NULL,
  [Date_Effective] datetime NOT NULL,
  [Date_Ending] datetime NULL,
  [Company_Address_RecID] int NULL,
  [Round_Bill_Hrs] decimal(18,2) NULL,
  [AGR_Limit] decimal(18,2) NOT NULL,
  [Date_Created_UTC] datetime NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Overage_Rate_Type] char(1) NULL,
  [Overage_Rate] decimal(18,2) NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.Company_Activity_Type_Audit
CREATE TABLE [dbo].[Company_Activity_Type_Audit] (
  [Company_Activity_Type_Audit_RecID] int NOT NULL,
  [Company_Activity_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Company_Activity_Type_Audit_Value
CREATE TABLE [dbo].[Company_Activity_Type_Audit_Value] (
  [Company_Activity_Type_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(50) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(100) NOT NULL,
  [Company_Activity_Type_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Company_Address
CREATE TABLE [dbo].[Company_Address] (
  [Company_Address_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Company_Name] nvarchar(50) NULL,
  [Address_Line1] nvarchar(50) NULL,
  [Address_Line2] nvarchar(50) NULL,
  [City] nvarchar(50) NULL,
  [State_ID] nvarchar(50) NULL,
  [Zip] nvarchar(12) NULL,
  [PhoneNbr] nvarchar(30) NULL,
  [PhoneNbr_Fax] nvarchar(30) NULL,
  [Default_Flag] bit NOT NULL,
  [Default_Mail_Flag] bit NOT NULL,
  [Default_Ship_Flag] bit NOT NULL,
  [Default_Bill_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Description] nvarchar(50) NULL,
  [tax_code_recid] int NULL,
  [EX_Reimb] decimal(18,2) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Country_RecID] int NULL,
  [Office_Calendar_RecID] int NULL,
  [Time_Zone_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Ava_Validated_Flag] bit NOT NULL,
  [DB_Timestamp] timestamp NOT NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Customer_Usage_Type_RecID] int NULL,
  [Bill_Separate_Flag] bit NOT NULL,
  [Core_Entity_Site_ID] nvarchar(36) NULL,
  [Last_Update_UTC_CES_Address] datetime2(0) NOT NULL,
  [Updated_By_CES_Address] nvarchar(15) NOT NULL,
  [Last_Update_UTC_CES_Phone] datetime2(0) NOT NULL,
  [Updated_By_CES_Phone] nvarchar(15) NOT NULL,
  [PhoneNbrExt] nvarchar(15) NULL,
  [Last_Update_UTC_CES_Site] datetime NULL,
  [Updated_By_CES_Site] nvarchar(15) NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.Company_Audit
CREATE TABLE [dbo].[Company_Audit] (
  [Company_Audit_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL
);
GO

-- dbo.Company_Audit_Value
CREATE TABLE [dbo].[Company_Audit_Value] (
  [Company_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(50) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(max) NOT NULL,
  [Company_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Company_Billing_Rate
CREATE TABLE [dbo].[Company_Billing_Rate] (
  [Billing_Rate_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Date_Effective] datetime NOT NULL,
  [Last_Update] datetime NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Date_Ending] datetime NULL,
  [Rate_Type] char(1) NULL,
  [Activity_Class_RecID] int NULL,
  [BR_Option] char(1) NULL,
  [Owner_Level_RecID] int NULL,
  [AGR_Header_RecID] int NULL,
  [AGR_Limit] decimal(18,2) NULL,
  [Hourly_Rate] decimal(18,2) NOT NULL,
  [Date_Created_UTC] datetime NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Company_Billing_Rate_Audit
CREATE TABLE [dbo].[Company_Billing_Rate_Audit] (
  [Company_Billing_Rate_Audit_RecID] int NOT NULL,
  [Billing_Rate_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL
);
GO

-- dbo.Company_Billing_Rate_Audit_Value
CREATE TABLE [dbo].[Company_Billing_Rate_Audit_Value] (
  [Company_Billing_Rate_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(50) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(100) NOT NULL,
  [Company_Billing_Rate_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Company_Company_Type
CREATE TABLE [dbo].[Company_Company_Type] (
  [Company_Company_Type_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Company_Type_RecID] int NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Company_Extended_Property
CREATE TABLE [dbo].[Company_Extended_Property] (
  [Company_Extended_Property_RecID] int NOT NULL,
  [Name] nvarchar(100) NOT NULL,
  [Default_Value] nvarchar(1024) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Company_Extended_Property_Value
CREATE TABLE [dbo].[Company_Extended_Property_Value] (
  [Company_Extended_Property_Value_RecID] int NOT NULL,
  [Company_Extended_Property_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Value] nvarchar(1024) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Company_Finance_Audit
CREATE TABLE [dbo].[Company_Finance_Audit] (
  [Company_Finance_Audit_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL
);
GO

-- dbo.Company_Finance_Audit_Value
CREATE TABLE [dbo].[Company_Finance_Audit_Value] (
  [Company_Finance_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(50) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(1000) NOT NULL,
  [Company_Finance_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Company_Group
CREATE TABLE [dbo].[Company_Group] (
  [Company_Group_RecID] int NOT NULL,
  [Group_Type_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [DefaultContact_Flag] bit NOT NULL,
  [AllContacts_Flag] bit NOT NULL,
  [Unsubscribe_Flag] bit NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Company_Integrator_Tag
CREATE TABLE [dbo].[Company_Integrator_Tag] (
  [Company_Integrator_Tag_Recid] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [System_Integrator_Tag_RecID] int NOT NULL,
  [Member_Recid] int NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Company_Merge_Table
CREATE TABLE [dbo].[Company_Merge_Table] (
  [Company_Merge_Table_RecID] int NOT NULL,
  [Table_Name] nvarchar(50) NOT NULL,
  [Action] nvarchar(50) NOT NULL,
  [Record_Count] int NOT NULL
);
GO

-- dbo.Company_Note
CREATE TABLE [dbo].[Company_Note] (
  [Company_RecID] int NOT NULL,
  [Company_Note_RecID] int NOT NULL,
  [Note_Type_RecID] int NOT NULL,
  [Notes] nvarchar(max) NULL,
  [Company_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Company_Related_Record
CREATE TABLE [dbo].[Company_Related_Record] (
  [Company_Related_Record_RecID] int NOT NULL,
  [Change_Table_Name] nvarchar(50) NOT NULL,
  [Change_RecID] int NOT NULL,
  [Old_Company_RecID] int NOT NULL,
  [New_Company_RecID] int NOT NULL
);
GO

-- dbo.Company_Status
CREATE TABLE [dbo].[Company_Status] (
  [Company_Status_ID] nvarchar(5) NOT NULL,
  [Company_Status_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Import_Flag] bit NOT NULL,
  [Survey_RecID] int NULL,
  [Notify_Flag] bit NULL,
  [NoService_Flag] bit NULL,
  [Notify_Message] nvarchar(500) NULL,
  [StandardNote_Flag] bit NULL,
  [CustomNote_Flag] bit NULL,
  [Cancel_Track_Flag] bit NULL,
  [WF_Track_Header_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Company_Status_Note
CREATE TABLE [dbo].[Company_Status_Note] (
  [Company_Status_Note_RecID] int NOT NULL,
  [Company_Status_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Custom_Note] nvarchar(1500) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime NOT NULL
);
GO

-- dbo.Company_Team
CREATE TABLE [dbo].[Company_Team] (
  [Company_Team_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Member_RecID] int NULL,
  [AcctMgr_Flag] bit NOT NULL,
  [Tech_Flag] bit NOT NULL,
  [Sales_Flag] bit NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Contact_Recid] int NULL,
  [Team_Role_Recid] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Company_Type
CREATE TABLE [dbo].[Company_Type] (
  [Company_Type_ID] nvarchar(5) NOT NULL,
  [Company_Type_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Import_Flag] bit NOT NULL,
  [Vendor_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Service_Alert_Flag] bit NOT NULL,
  [Service_Alert_Message] nvarchar(150) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Company_User_Defined_Field_Value
CREATE TABLE [dbo].[Company_User_Defined_Field_Value] (
  [Company_User_Defined_Field_Value_RecID] bigint NOT NULL,
  [Company_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [User_Defined_Field_Value] nvarchar(1000) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Config
CREATE TABLE [dbo].[Config] (
  [Config_RecID] int NOT NULL,
  [CS_Survey_RecID] int NOT NULL,
  [Config_Name] nvarchar(100) NULL,
  [Mfg_Company_RecID] int NULL,
  [Serial_Number] nvarchar(max) NULL,
  [Date_Purchased] datetime NULL,
  [Date_Installed] datetime NULL,
  [Installed_By] int NULL,
  [Date_Expiration] datetime NULL,
  [Company_RecID] int NOT NULL,
  [Contact_RecID] int NULL,
  [Company_Address_RecID] int NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Contract_RecID] int NULL,
  [Notes] nvarchar(max) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Model_Number] nvarchar(50) NULL,
  [Tag_Number] nvarchar(50) NULL,
  [Notification_History] varchar(max) NULL,
  [Config_Status_RecID] int NULL,
  [Device_ID] nvarchar(100) NULL,
  [Mgmt_Link] nvarchar(1000) NULL,
  [Last_Login] nvarchar(100) NULL,
  [Msp_Last_Updated_By] nvarchar(50) NULL,
  [Msp_Last_Updated] datetime NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Parent_RecID] int NULL,
  [Bill_Flag] bit NOT NULL,
  [Backup_Successes] int NULL,
  [Backup_Incomplete] int NULL,
  [Backup_Failed] int NULL,
  [Backup_Restores] int NULL,
  [Backup_Last_Backup_Date] datetime NULL,
  [Backup_Server_Name] nvarchar(50) NULL,
  [Backup_Billable_Space_Gb] decimal(18,2) NULL,
  [Backup_Protected_Device_List] nvarchar(max) NULL,
  [Backup_Year] int NULL,
  [Backup_Month] int NULL,
  [MAC_Address] nvarchar(25) NULL,
  [Custom_Field] nvarchar(max) NULL,
  [IP_Address] nvarchar(50) NULL,
  [Default_Gateway] nvarchar(50) NULL,
  [Os_Type] nvarchar(250) NULL,
  [Os_Info] nvarchar(250) NULL,
  [Cpu_Speed] nvarchar(100) NULL,
  [RAM] nvarchar(25) NULL,
  [Local_Hard_Drives] nvarchar(max) NULL,
  [Manufacturer_RecID] int NULL,
  [SR_SLA_RecID] int NULL,
  [Remote_Link] nvarchar(1000) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [IV_Product_RecID] int NULL,
  [Incomplete_Flag] bit NOT NULL,
  [Conversion_Source] nvarchar(15) NULL,
  [Show_Remote_Flag] bit NOT NULL,
  [Show_Automate_Flag] bit NOT NULL,
  [Needs_Renewal] bit NOT NULL,
  [Manufacturer_Part_Number] nvarchar(50) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Config_Status
CREATE TABLE [dbo].[Config_Status] (
  [Config_Status_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Closed_Flag] bit NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Default_Flag] bit NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Configuration_Audit
CREATE TABLE [dbo].[Configuration_Audit] (
  [Configuration_Audit_RecId] int NOT NULL,
  [Configuration_RecId] int NOT NULL,
  [Locale_Key_RecId] int NULL,
  [Audit_Source_RecId] smallint NOT NULL,
  [Audit_Type_RecId] smallint NOT NULL,
  [Updated_by] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL
);
GO

-- dbo.Configuration_Audit_Value
CREATE TABLE [dbo].[Configuration_Audit_Value] (
  [Configuration_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(2000) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(max) NOT NULL,
  [Configuration_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.ConnectWise_Labs
CREATE TABLE [dbo].[ConnectWise_Labs] (
  [ConnectWise_Labs_RecID] int NOT NULL,
  [Lab_ID] nvarchar(50) NOT NULL,
  [Name_Locale_Key_RecID] int NOT NULL,
  [Description_Locale_Key_RecID] int NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Imported_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Admin_Lock] bit NOT NULL,
  [Module_Function_RecID] int NULL,
  [Preprocessing_Type] nvarchar(64) NULL,
  [CWSSO_Only_Flag] bit NOT NULL,
  [Cloud_Only_Flag] bit NOT NULL,
  [Partner_Visible_Flag] bit NOT NULL,
  [Preprocessing_State] nvarchar(64) NULL,
  [Preprocessing_Message] nvarchar(256) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Contact
CREATE TABLE [dbo].[Contact] (
  [Company_RecID] int NULL,
  [Contact_RecID] int NOT NULL,
  [Member_ID] nvarchar(15) NULL,
  [Company_Name] nvarchar(50) NULL,
  [Seq_Nbr] int NULL,
  [First_Name] nvarchar(50) NULL,
  [Last_Name] nvarchar(50) NULL,
  [Title] nvarchar(128) NULL,
  [Relationship] nvarchar(50) NULL,
  [Default_Flag] bit NULL,
  [Exchange_Flag] bit NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Relationship_RecID] int NULL,
  [Contact_Status_RecID] int NULL,
  [Gender] char(1) NULL,
  [NickName] nvarchar(30) NULL,
  [Date_Birth] datetime2(0) NULL,
  [Married_Flag] bit NOT NULL,
  [Spouse_Name] nvarchar(30) NULL,
  [Date_Anniversary] datetime2(0) NULL,
  [Children_Flag] bit NOT NULL,
  [Children_Info] nvarchar(max) NULL,
  [School] nvarchar(50) NULL,
  [Hobbies] nvarchar(max) NULL,
  [Reports_To_RecID] int NULL,
  [Assistant_RecID] int NULL,
  [Userfield1] nvarchar(50) NULL,
  [Userfield2] nvarchar(50) NULL,
  [Userfield3] nvarchar(50) NULL,
  [Userfield4] nvarchar(50) NULL,
  [Userfield5] nvarchar(50) NULL,
  [Userfield6] nvarchar(50) NULL,
  [Userfield7] nvarchar(50) NULL,
  [Userfield8] nvarchar(50) NULL,
  [Userfield9] nvarchar(50) NULL,
  [Userfield10] nvarchar(50) NULL,
  [Reports_To_Name] nvarchar(101) NULL,
  [Assistant_Name] nvarchar(101) NULL,
  [Company_Address_RecID] int NULL,
  [Personal_Address_Flag] bit NOT NULL,
  [Address_Line1] nvarchar(50) NULL,
  [Address_Line2] nvarchar(50) NULL,
  [City] nvarchar(50) NULL,
  [State_ID] nvarchar(50) NULL,
  [Zip] nvarchar(12) NULL,
  [Country] nvarchar(50) NULL,
  [Default_Billing_Flag] bit NOT NULL,
  [exchange_guid] nvarchar(200) NULL,
  [Admin_Flag] bit NULL,
  [Date_Entered] datetime2(0) NOT NULL,
  [Exchange_Href] nvarchar(500) NULL,
  [Unsubscribe_Flag] bit NOT NULL,
  [Inactive_Flag] bit NULL,
  [Image_Link] nvarchar(255) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [SID] nvarchar(184) NULL,
  [Department_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Default_PhoneNbr] nvarchar(30) NULL,
  [Default_PhoneExtension] nvarchar(15) NULL,
  [Default_Phone_Type] nvarchar(30) NULL,
  [Core_Entity_Contact_ID] nvarchar(36) NULL,
  [Last_Update_UTC_CES_Contact] datetime2(0) NULL,
  [Updated_By_CES_Contact] nvarchar(15) NULL,
  [Non_Sync_Flag] bit NOT NULL,
  [Core_Entity_Reference_ID] nvarchar(36) NULL,
  [M365_Contact_Sync_Flag] bit NOT NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.Contact_Audit
CREATE TABLE [dbo].[Contact_Audit] (
  [Contact_Audit_RecID] int NOT NULL,
  [Contact_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.Contact_Audit_Value
CREATE TABLE [dbo].[Contact_Audit_Value] (
  [Contact_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(50) NOT NULL,
  [Audit_Value] nvarchar(max) NOT NULL,
  [Contact_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Contact_Communication
CREATE TABLE [dbo].[Contact_Communication] (
  [Contact_Communication_RecID] int NOT NULL,
  [Contact_RecID] int NOT NULL,
  [Communication_Type_RecID] int NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Description] nvarchar(250) NULL,
  [Extension] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Domain] nvarchar(250) NULL,
  [Core_Entity_Contact_Communication_ID] nvarchar(36) NULL
);
GO

-- dbo.Contact_Contact_Type
CREATE TABLE [dbo].[Contact_Contact_Type] (
  [Contact_Contact_Type_RecID] int NOT NULL,
  [Contact_RecID] int NOT NULL,
  [Contact_Type_RecID] int NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Contact_Extended_Property
CREATE TABLE [dbo].[Contact_Extended_Property] (
  [Contact_Extended_Property_RecID] int NOT NULL,
  [Name] nvarchar(100) NOT NULL,
  [Default_Value] nvarchar(1024) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Contact_Extended_Property_Value
CREATE TABLE [dbo].[Contact_Extended_Property_Value] (
  [Contact_Extended_Property_Value_RecID] int NOT NULL,
  [Contact_Extended_Property_RecID] int NOT NULL,
  [Contact_RecID] int NOT NULL,
  [Value] nvarchar(1024) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Contact_Group
CREATE TABLE [dbo].[Contact_Group] (
  [Contact_Group_RecID] int NOT NULL,
  [Group_Type_RecID] int NOT NULL,
  [Contact_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Unsubscribe_Flag] bit NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL
);
GO

-- dbo.Contact_Merge_Audit
CREATE TABLE [dbo].[Contact_Merge_Audit] (
  [Contact_Merge_Audit_RecID] int NOT NULL,
  [From_RecID] int NULL,
  [To_RecID] int NULL,
  [Audit_Description] nvarchar(500) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(3) NULL,
  [Audit_Source] nvarchar(1) NULL,
  [Last_Update_UTC] datetime2(3) NOT NULL
);
GO

-- dbo.Contact_Note
CREATE TABLE [dbo].[Contact_Note] (
  [Contact_RecID] int NOT NULL,
  [Contact_Note_RecID] int NOT NULL,
  [Note_Type_RecID] int NULL,
  [Notes] nvarchar(max) NULL,
  [Red_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Contact_Portal_Access
CREATE TABLE [dbo].[Contact_Portal_Access] (
  [Contact_Portal_Access_RecID] int NOT NULL,
  [Contact_RecID] int NOT NULL,
  [CM_Password] nvarchar(60) NOT NULL,
  [Disable_Flag] bit NOT NULL,
  [Portal_Security_Level] int NOT NULL,
  [Temp_Guid] nvarchar(100) NULL,
  [Last_Login_UTC] datetime NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Login_Attempts] tinyint NOT NULL,
  [Account_Locked] bit NOT NULL,
  [Locked_Until] datetime NULL,
  [Last_Login_Attempt_UTC] datetime NULL,
  [use_bcrypt] bit NOT NULL,
  [Reset_Guid_Valid_Until_UTC] datetime2(2) NULL
);
GO

-- dbo.Contact_Presence_Type
CREATE TABLE [dbo].[Contact_Presence_Type] (
  [Contact_Presence_Type_RecID] int NOT NULL,
  [Contact_Presence_Description] nvarchar(50) NOT NULL,
  [Contact_Presence_Id] int NULL
);
GO

-- dbo.Contact_Relationship
CREATE TABLE [dbo].[Contact_Relationship] (
  [Relationship] nvarchar(50) NULL,
  [Relationship_RecID] int NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Contact_Type
CREATE TABLE [dbo].[Contact_Type] (
  [Contact_Type_ID] nvarchar(10) NOT NULL,
  [Contact_Type_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Service_Alert_Flag] bit NOT NULL,
  [Service_Alert_Message] nvarchar(150) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Contact_User_Defined_Field_Value
CREATE TABLE [dbo].[Contact_User_Defined_Field_Value] (
  [Contact_User_Defined_Field_Value_RecID] bigint NOT NULL,
  [Contact_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [User_Defined_Field_Value] nvarchar(1000) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.ContactSync_Option
CREATE TABLE [dbo].[ContactSync_Option] (
  [ContactSync_Option_ID] smallint NOT NULL,
  [Description] nvarchar(50) NULL
);
GO

-- dbo.Contract_Type
CREATE TABLE [dbo].[Contract_Type] (
  [Contract_Type_ID] nvarchar(20) NULL,
  [Contract_Type_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Monthly_Rate] decimal(18,2) NULL,
  [Max_Length_Months] smallint NULL,
  [SR_Urgency_RecID] int NULL
);
GO

-- dbo.Conversion_History
CREATE TABLE [dbo].[Conversion_History] (
  [Conversion_History_RecID] int NOT NULL,
  [Conversion_Type_ID] nvarchar(2) NOT NULL,
  [Parent_Type_ID] nvarchar(2) NOT NULL,
  [Parent_RecID] int NOT NULL,
  [Converted_To_RecID] int NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Created_UTC] datetime NOT NULL
);
GO

-- dbo.Conversion_Parent_Type
CREATE TABLE [dbo].[Conversion_Parent_Type] (
  [Conversion_Parent_Type_ID] nvarchar(2) NOT NULL,
  [Description] nvarchar(50) NOT NULL
);
GO

-- dbo.Conversion_Type
CREATE TABLE [dbo].[Conversion_Type] (
  [Conversion_Type_ID] nvarchar(2) NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Country
CREATE TABLE [dbo].[Country] (
  [Country] nvarchar(50) NOT NULL,
  [Country_RecID] int NOT NULL,
  [Currency_ID] nvarchar(10) NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Localization_ID] char(1) NULL,
  [Caption1] char(25) NULL,
  [Caption2] char(25) NULL,
  [Caption3] char(25) NULL,
  [Caption4] char(25) NULL,
  [Caption5] char(25) NULL,
  [Value1] char(50) NULL,
  [Value2] char(50) NULL,
  [Value3] char(50) NULL,
  [Value4] char(50) NULL,
  [Value5] char(50) NULL,
  [City_Caption] nvarchar(25) NULL,
  [State_Caption] nvarchar(25) NULL,
  [Zip_Caption] nvarchar(25) NULL,
  [Dial_Prefix] nvarchar(5) NULL,
  [Zip_Min_Length] smallint NOT NULL,
  [Address_Format_RecID] int NULL,
  [Country_Code] nvarchar(2) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Country_Code_ISO_ALPHA2] nvarchar(2) NULL,
  [Id] uniqueidentifier NOT NULL,
  [Disabled] bit NOT NULL
);
GO

-- dbo.CS_Result_Detail
CREATE TABLE [dbo].[CS_Result_Detail] (
  [CS_Result_Detail_RecID] int NOT NULL,
  [CS_Result_RecID] int NOT NULL,
  [CS_Survey_Detail_RecID] int NOT NULL,
  [Answer] nvarchar(2000) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Config_Recid] int NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [CS_Survey_Value_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.CS_Survey
CREATE TABLE [dbo].[CS_Survey] (
  [CS_Survey_RecID] int NOT NULL,
  [Survey_Name] nvarchar(50) NULL,
  [Instructions] nvarchar(1000) NULL,
  [Inactive_Flag] bit NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Survey_Flag] bit NULL,
  [System_Flag] bit NULL,
  [Backup_Display_Flag] bit NOT NULL,
  [Device_Display_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.CS_Survey_Detail
CREATE TABLE [dbo].[CS_Survey_Detail] (
  [CS_Survey_Detail_RecID] int NOT NULL,
  [CS_Survey_RecID] int NOT NULL,
  [Seq_Nbr] decimal(8,2) NOT NULL,
  [Question] nvarchar(1000) NULL,
  [SF_Field_Type_ID] char(1) NULL,
  [Nbr_Decimals] smallint NULL,
  [SF_Entry_Type_ID] char(1) NULL,
  [Required_Flag] bit NULL,
  [Inactive_Flag] bit NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.CS_Survey_Value
CREATE TABLE [dbo].[CS_Survey_Value] (
  [CS_Survey_Value_RecID] int NOT NULL,
  [CS_Survey_Detail_RecID] int NOT NULL,
  [CS_Survey_Value] nvarchar(1000) NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Point_Value] int NULL,
  [Display_Color] nvarchar(50) NULL,
  [Sort_Order] int NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Currency
CREATE TABLE [dbo].[Currency] (
  [Currency_ID] nvarchar(10) NOT NULL,
  [Currency_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Currency_Symbol] nvarchar(10) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [DisplayID_Flag] bit NOT NULL,
  [DisplaySymbol_Flag] bit NOT NULL,
  [Iso_Code] nvarchar(3) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Locale] nvarchar(15) NULL,
  [Thousands_Separator] nvarchar(10) NOT NULL,
  [Decimal_Separator] nvarchar(10) NOT NULL,
  [Use_Parentheses_Flag] bit NOT NULL,
  [Num_Decimals] tinyint NOT NULL,
  [Right_Align_Flag] bit NOT NULL,
  [Updated_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Currency_Code
CREATE TABLE [dbo].[Currency_Code] (
  [ISO_Currency_Code] nvarchar(3) NOT NULL,
  [Currency_Code_RecID] int NOT NULL
);
GO

-- dbo.Custom_Caption
CREATE TABLE [dbo].[Custom_Caption] (
  [Custom_Caption_RecID] int NOT NULL,
  [Field_Name] nvarchar(50) NULL,
  [Caption] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Custom_Image_Type
CREATE TABLE [dbo].[Custom_Image_Type] (
  [Custom_Image_Type_RecID] int NOT NULL,
  [Custom_Image_Type_ID] nvarchar(50) NULL
);
GO

-- dbo.Customer_Usage_Type
CREATE TABLE [dbo].[Customer_Usage_Type] (
  [Customer_Usage_Type_RecID] int NOT NULL,
  [Customer_Usage_Type_Code] varchar(8) NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.CW_Now_Widget
CREATE TABLE [dbo].[CW_Now_Widget] (
  [Widget_RecID] int NOT NULL,
  [Widget_Identifier] nvarchar(100) NOT NULL,
  [Module_Function_RecID] int NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Cache_Flag] bit NOT NULL,
  [Location_Security_Flag] bit NOT NULL,
  [SR_Board_Security_Flag] bit NOT NULL,
  [PM_Board_Security_Flag] bit NOT NULL
);
GO

-- dbo.CW_Start_Detail
CREATE TABLE [dbo].[CW_Start_Detail] (
  [CW_Start_Detail_RecID] int NOT NULL,
  [Teams_Audio_Visual_Flag] bit NOT NULL,
  [Teams_Cloud_Service_Provider_Flag] bit NOT NULL,
  [Teams_Internal_It_Flag] bit NOT NULL,
  [Teams_Managed_Security_Flag] bit NOT NULL,
  [Teams_Managed_Services_Flag] bit NOT NULL,
  [Teams_Physical_Security_Flag] bit NOT NULL,
  [Teams_Value_Added_Reseller_Flag] bit NOT NULL,
  [Goals_CRM_Flag] bit NOT NULL,
  [Goals_Time_Tracking_Flag] bit NOT NULL,
  [Goals_Ticketing_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Go_Live_Date] datetime NULL
);
GO

-- dbo.Date_Dimension
CREATE TABLE [dbo].[Date_Dimension] (
  [DateKey] int NOT NULL,
  [Date] date NOT NULL,
  [Date_DateTime] datetime NOT NULL,
  [Date_DMY] nvarchar(10) NOT NULL,
  [Date_MDY] nvarchar(10) NOT NULL,
  [Date_YMD] nvarchar(10) NOT NULL,
  [Date_YM] nvarchar(7) NOT NULL,
  [Date_MY] nvarchar(6) NOT NULL,
  [DayOfMonthNbr] int NOT NULL,
  [DaySuffix] nvarchar(4) NOT NULL,
  [DayName_Full] nvarchar(9) NOT NULL,
  [DayName_Short] nvarchar(3) NOT NULL,
  [DayOfWeek_Sun_Start] int NOT NULL,
  [DayOfWeek_Mon_Start] int NOT NULL,
  [DayOfWeekInMonth] nvarchar(2) NOT NULL,
  [DayOfWeekInYear] nvarchar(2) NOT NULL,
  [DayOfYearNbr] int NOT NULL,
  [WeekOfMonth] nvarchar(1) NOT NULL,
  [WeekOfQuarter] int NOT NULL,
  [WeekOfYear] nvarchar(2) NOT NULL,
  [MonthNbr] int NOT NULL,
  [MonthName_Full] nvarchar(9) NOT NULL,
  [MonthName_Short] nvarchar(3) NOT NULL,
  [MonthOfQuarter] int NOT NULL,
  [QuarterNbr] int NOT NULL,
  [QuarterName] nvarchar(9) NOT NULL,
  [YearNbr] int NOT NULL,
  [YearName] nvarchar(7) NOT NULL,
  [MonthYear] nvarchar(10) NOT NULL,
  [FirstDayOfMonth] date NOT NULL,
  [LastDayOfMonth] date NOT NULL,
  [FirstDayOfQuarter] date NOT NULL,
  [LastDayOfQuarter] date NOT NULL,
  [FirstDayOfYear] date NOT NULL,
  [LastDayOfYear] date NOT NULL,
  [IsWeekday] bit NOT NULL
);
GO

-- dbo.Default_Favorites_Screens
CREATE TABLE [dbo].[Default_Favorites_Screens] (
  [default_favorites_screens_recid] int NOT NULL,
  [system_screens_recid] int NOT NULL
);
GO

-- dbo.Department
CREATE TABLE [dbo].[Department] (
  [Department_RecID] int NOT NULL,
  [Department_Name] nvarchar(30) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(30) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Directional_Sync
CREATE TABLE [dbo].[Directional_Sync] (
  [Directional_Sync_RecID] int NOT NULL,
  [Directional_Sync_Name] nvarchar(30) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Locale_Key_RecID] int NOT NULL
);
GO

-- dbo.Dismissed_Help_Text
CREATE TABLE [dbo].[Dismissed_Help_Text] (
  [HelpText_RecID] int NOT NULL,
  [ReleaseId] nvarchar(8) NOT NULL,
  [PresenterIdentifier] nvarchar(30) NOT NULL,
  [Member_RecId] int NOT NULL
);
GO

-- dbo.DM_Document
CREATE TABLE [dbo].[DM_Document] (
  [DM_Document_RecID] int NOT NULL,
  [Title] nvarchar(100) NULL,
  [DM_Type_RecID] int NULL,
  [Filename] nvarchar(500) NULL,
  [ServerFilename] nvarchar(500) NULL,
  [Member_RecID] int NULL,
  [Size] int NULL,
  [Public_Flag] bit NOT NULL,
  [Read_Only_Flag] bit NOT NULL,
  [Template_Flag] bit NOT NULL,
  [Updated_By] nvarchar(150) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Link_Flag] bit NULL,
  [Marketing_Manager_Flag] bit NOT NULL,
  [DM_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Uploaded_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Path] nvarchar(255) NULL,
  [Keywords] nvarchar(255) NULL,
  [Thumbnail_Url] nvarchar(500) NULL,
  [Id] uniqueidentifier NULL,
  [DM_Guid_Secondary] uniqueidentifier NOT NULL
);
GO

-- dbo.DM_Relationship
CREATE TABLE [dbo].[DM_Relationship] (
  [DM_Relationship_RecID] int NOT NULL,
  [DM_Document_RecID] int NULL,
  [Updated_By] nvarchar(150) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [AGR_Header_RecID] int NULL,
  [Company_RecID] int NULL,
  [Config_RecID] int NULL,
  [Contact_RecID] int NULL,
  [PM_Project_RecID] int NULL,
  [Opportunity_RecID] int NULL,
  [SR_Service_RecID] int NULL,
  [SRT_Service_RecID] int NULL,
  [SR_Detail_RecID] int NULL,
  [EX_Detail_RecID] int NULL,
  [pending] bit NULL,
  [Time_RecID] int NULL,
  [Purchase_Header_RecID] int NULL,
  [Order_Header_RecID] int NULL,
  [RMA_Tag_RecID] int NULL,
  [Billing_Log_RecID] int NULL,
  [Custom_Image_Type_RecID] int NOT NULL,
  [Custom_Image_Xref_RecID] int NULL,
  [Job_Header_RecID] int NULL,
  [Marketing_Manager_Audit_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [KB_Resolution_RecID] int NULL,
  [Client_Api_Hosted_RecID] int NULL,
  [IV_Item_RecID] int NULL,
  [Meeting_RecID] int NULL,
  [Meeting_Note_RecID] int NULL,
  [PM_Tmp_Activity_RecID] int NULL,
  [SO_Activity_RecID] int NULL,
  [Attached_Record_Type] varchar(16) NOT NULL
);
GO

-- dbo.DM_Type
CREATE TABLE [dbo].[DM_Type] (
  [DM_Type_RecID] int NOT NULL,
  [File_Extension] nvarchar(10) NOT NULL,
  [Icon] nvarchar(100) NULL,
  [Mime_Type] nvarchar(100) NULL,
  [Description] nvarchar(100) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NULL
);
GO

-- dbo.Email_Address_Exclusion
CREATE TABLE [dbo].[Email_Address_Exclusion] (
  [Email_Address_Exclusion_RecID] int NOT NULL,
  [Description] nvarchar(100) NULL,
  [Date_Created_UTC] datetime2(0) NULL,
  [Created_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Email_Template
CREATE TABLE [dbo].[Email_Template] (
  [Email_Template_RecID] int NOT NULL,
  [Subject] nvarchar(200) NULL,
  [Notes] nvarchar(max) NULL,
  [Include_Tasks] bit NULL,
  [Include_Resources] bit NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [From_Email_Address] nvarchar(100) NULL,
  [Default_Flag] bit NULL,
  [Email_Type_RecID] int NULL,
  [Template_Name] nvarchar(50) NULL,
  [Use_Sender] bit NULL,
  [Copy_Sender] bit NULL,
  [Billing_Status_RecID] int NULL,
  [From_First_Name] nvarchar(100) NULL,
  [From_Last_Name] nvarchar(100) NULL,
  [SR_Status_RecID] int NULL,
  [RMA_Status_RecID] int NULL,
  [SR_Internal_Flag] bit NOT NULL,
  [SR_External_Flag] bit NOT NULL,
  [Order_Status_RecID] int NULL,
  [SV_SetupHdr_RecID] int NULL,
  [PO_Status_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Attach_Invoice_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Email_Type
CREATE TABLE [dbo].[Email_Type] (
  [Email_Type_RecID] int NOT NULL,
  [Email_Type_ID] char(1) NULL,
  [Description] nvarchar(50) NULL,
  [Service_Flag] bit NULL,
  [Invoice_Flag] bit NULL,
  [Rma_Flag] bit NULL,
  [Sales_Flag] bit NULL,
  [PO_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Email_Variable
CREATE TABLE [dbo].[Email_Variable] (
  [Email_Variable_RecID] int NOT NULL,
  [Email_Variable] nvarchar(50) NULL,
  [Variable_Description] nvarchar(100) NULL,
  [Service_Flag] bit NULL,
  [Invoice_Flag] bit NULL,
  [Sales_Flag] bit NULL,
  [Agreement_Flag] bit NOT NULL,
  [Company_Flag] bit NOT NULL,
  [Contact_Flag] bit NOT NULL,
  [Workflow_Flag] bit NOT NULL,
  [Rma_Flag] bit NULL,
  [Tracks_Flag] bit NOT NULL,
  [PO_Flag] bit NOT NULL,
  [Address_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL,
  [PO_Status_Flag] bit NOT NULL,
  [Config_Flag] bit NOT NULL,
  [Portal_Password_Flag] bit NOT NULL
);
GO

-- dbo.Escalation_Status
CREATE TABLE [dbo].[Escalation_Status] (
  [Escalation_Status_RecID] int NOT NULL,
  [Escalation_Desc] nvarchar(100) NULL,
  [Escalation_Short] nvarchar(20) NULL,
  [Escalation_Level] smallint NULL
);
GO

-- dbo.Eula
CREATE TABLE [dbo].[Eula] (
  [Eula_RecID] int NOT NULL,
  [Eula_Key] nvarchar(50) NOT NULL,
  [Eula_Service_Link] nvarchar(255) NOT NULL,
  [Signed_Member_RecID] int NULL,
  [Signed_Date_UTC] datetime2(0) NULL
);
GO

-- dbo.EX_Audit
CREATE TABLE [dbo].[EX_Audit] (
  [EX_Audit_RecID] int NOT NULL,
  [EX_Header_RecID] int NOT NULL,
  [EX_Detail_RecID] int NULL,
  [Date_Updated] datetime2(3) NULL,
  [Audit_Type_RecID] smallint NULL,
  [Audit_Source_RecID] smallint NULL,
  [Locale_Key_RecID] int NULL,
  [Old_Value] nvarchar(max) NULL,
  [New_Value] nvarchar(max) NULL,
  [Last_Update_UTC] datetime2(3) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Reason] nvarchar(255) NULL,
  [OldValue_Locale_Key_RecID] int NULL,
  [NewValue_Locale_Key_RecID] int NULL
);
GO

-- dbo.EX_Class
CREATE TABLE [dbo].[EX_Class] (
  [EX_Class_RecID] int NOT NULL,
  [Multiplier] decimal(1,0) NULL,
  [Description] nvarchar(20) NULL,
  [Default_Flag] bit NOT NULL,
  [Company_Flag] bit NOT NULL,
  [Employee_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.EX_Detail
CREATE TABLE [dbo].[EX_Detail] (
  [EX_Detail_RecID] int NOT NULL,
  [EX_Header_RecID] int NOT NULL,
  [EX_Type_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Charge_Code_RecID] int NULL,
  [PM_Project_RecID] int NULL,
  [PM_Phase_RecID] int NULL,
  [EX_Payment_RecID] int NULL,
  [EX_Class_RecID] int NULL,
  [Amount] decimal(18,2) NULL,
  [Reason] nvarchar(max) NULL,
  [Billable_Flag] bit NOT NULL,
  [Date_Expense] datetime NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NULL,
  [TE_Status_ID] smallint NULL,
  [Billing_Log_RecID] int NULL,
  [Billing_Select_Flag] bit NOT NULL,
  [Bill_Amount] decimal(18,2) NULL,
  [Date_Interface_PR] datetime NULL,
  [SR_Service_RecID] int NULL,
  [AGR_Amount] decimal(18,2) NOT NULL,
  [AGR_Month] smallint NULL,
  [AGR_Year] smallint NULL,
  [AGR_Header_RecID] int NULL,
  [Invoice_Flag] bit NOT NULL,
  [Invoice_Amount] decimal(18,2) NOT NULL,
  [Start_Odometer] decimal(18,2) NULL,
  [End_Odometer] decimal(18,2) NULL,
  [SO_Activity_RecID] int NULL,
  [billing_sr] int NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Date_Entered] datetime NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Unbatched_GL_BatchID_RecID] int NULL
);
GO

-- dbo.EX_Header
CREATE TABLE [dbo].[EX_Header] (
  [EX_Header_RecID] int NOT NULL,
  [TE_Period_RecID] int NULL,
  [Member_RecID] int NOT NULL,
  [TE_Status_ID] smallint NOT NULL,
  [Closed_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Reversed_Flag] bit NOT NULL
);
GO

-- dbo.EX_Payment
CREATE TABLE [dbo].[EX_Payment] (
  [EX_Payment_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Company_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [EX_Class_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.EX_Tax_Type
CREATE TABLE [dbo].[EX_Tax_Type] (
  [EX_Tax_Type_RecID] int NOT NULL,
  [EX_Tax_Type_Desc] nvarchar(25) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.EX_Type
CREATE TABLE [dbo].[EX_Type] (
  [EX_Type_RecID] int NOT NULL,
  [Description] nvarchar(30) NOT NULL,
  [Mileage_Flag] bit NOT NULL,
  [Quantity_Flag] bit NOT NULL,
  [Quantity_Rate] decimal(18,4) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Amount_Caption] nvarchar(20) NULL,
  [Advance_Flag] bit NOT NULL,
  [Billable_Flag] bit NULL,
  [Invoice_Flag] bit NULL,
  [Markup_Option] char(1) NULL,
  [Markup_Amount] decimal(18,2) NULL,
  [Inactive_Flag] bit NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [Max_Amount] decimal(18,2) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Exchange_Parsing_ColumnType
CREATE TABLE [dbo].[Exchange_Parsing_ColumnType] (
  [Exchange_Parsing_ColumnType_Recid] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Code] nvarchar(50) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Exchange_Parsing_Type
CREATE TABLE [dbo].[Exchange_Parsing_Type] (
  [Exchange_Parsing_Type_Recid] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [ParseRule] nvarchar(500) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Exchange_Robot
CREATE TABLE [dbo].[Exchange_Robot] (
  [Exchange_Robot_Recid] int NOT NULL,
  [Folder_Name] nvarchar(100) NOT NULL,
  [Folder_Type] nvarchar(20) NOT NULL,
  [Owner_Level_Recid] int NOT NULL,
  [Billing_Unit_Recid] int NOT NULL,
  [Response_Text] nvarchar(max) NULL,
  [Default_Company_Recid] int NULL,
  [Email_Notify_Bcc] nvarchar(250) NULL,
  [Email_Notify_From] nvarchar(50) NULL,
  [Default_Member_Recid] int NULL,
  [Email_Exceptions] nvarchar(50) NULL,
  [DoNotRespond_Flag] bit NULL,
  [last_update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Default_SR_Source_RecID] int NULL,
  [Default_SR_Urgency_RecID] int NULL,
  [Default_SR_Type_RecID] int NULL,
  [Default_SR_Status_RecID] int NULL,
  [Exchange_Parsing_Style_RecID] int NULL,
  [DiscardDuplicatesFlag] bit NULL,
  [NeverRespondFlag] bit NULL,
  [SR_Board_RecID] int NULL,
  [AppendReplies_Flag] bit NULL,
  [UseDefaultContactEmail_Flag] bit NULL,
  [Existing_Ticket_Response_Text] nvarchar(max) NULL,
  [Default_SR_SubType_RecID] int NULL,
  [Default_SR_SubTypeItem_RecID] int NULL,
  [Add_Contact_Flag] bit NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Inbound_Ticket_Mailbox_Id] nvarchar(36) NULL,
  [UseEmailMessageIdFlag] bit NOT NULL
);
GO

-- dbo.Exchange_Robot_Imap_Folder
CREATE TABLE [dbo].[Exchange_Robot_Imap_Folder] (
  [Exchange_Robot_Imap_Folder_RecID] int NOT NULL,
  [Name] nvarchar(200) NOT NULL,
  [Imap_Name] nvarchar(20) NULL,
  [Processed_Name] nvarchar(20) NOT NULL,
  [Exchange_Robot_Imap_Server_RecID] int NOT NULL,
  [Exchange_Robot_RecID] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Failed_Folder] nvarchar(40) NOT NULL
);
GO

-- dbo.Exchange_Robot_Imap_Server
CREATE TABLE [dbo].[Exchange_Robot_Imap_Server] (
  [Exchange_Robot_Imap_Server_RecID] int NOT NULL,
  [Name] nvarchar(200) NOT NULL,
  [Username] nvarchar(80) NOT NULL,
  [Password] nvarchar(2000) NOT NULL,
  [Port] int NOT NULL,
  [Ssl_Flag] bit NOT NULL
);
GO

-- dbo.Export_Audit
CREATE TABLE [dbo].[Export_Audit] (
  [Export_Audit_RecID] int NOT NULL,
  [Screen_ID] nvarchar(20) NULL,
  [Multiline_Name] nvarchar(255) NOT NULL,
  [Attributes] nvarchar(4000) NULL,
  [Date_Exported_UTC] datetime2(3) NOT NULL,
  [Exported_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Export_Statuses
CREATE TABLE [dbo].[Export_Statuses] (
  [Export_Status_RecID] tinyint NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.File_Upload_Settings
CREATE TABLE [dbo].[File_Upload_Settings] (
  [File_Upload_Settings_RecID] int NOT NULL,
  [Restrict_File_Types_Flag] bit NOT NULL,
  [Global_File_Size_Limit] int NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.FO_Role
CREATE TABLE [dbo].[FO_Role] (
  [FO_Role_RecID] int NOT NULL,
  [FO_Role_ID] nvarchar(30) NULL,
  [Admin_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Inactive_Flag] bit NULL,
  [FO_Role_Type] nvarchar(30) NULL,
  [Id] uniqueidentifier NOT NULL,
  [Permissions_Hash] nvarchar(max) NULL
);
GO

-- dbo.FO_Role_Custom
CREATE TABLE [dbo].[FO_Role_Custom] (
  [FO_Role_Custom_RecID] int NOT NULL,
  [FO_Role_RecID] int NOT NULL,
  [RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Table_Reference] nvarchar(75) NOT NULL
);
GO

-- dbo.FO_Role_Reports
CREATE TABLE [dbo].[FO_Role_Reports] (
  [FO_Role_Reports_RecID] int NOT NULL,
  [FO_Role_RecID] int NOT NULL,
  [System_Reports_RecID] int NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.FO_Role_Security
CREATE TABLE [dbo].[FO_Role_Security] (
  [FO_Role_Security_RecID] int NOT NULL,
  [FO_Role_RecID] int NOT NULL,
  [Module_Function_Recid] int NULL,
  [Add_Level] smallint NULL,
  [Edit_Level] smallint NULL,
  [Delete_Level] smallint NULL,
  [Inquire_Level] smallint NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.FO_Role_Setup
CREATE TABLE [dbo].[FO_Role_Setup] (
  [FO_Role_Setup_RecID] int NOT NULL,
  [FO_Role_RecID] int NULL,
  [System_Setup_Screens_RecID] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [System_MM_Screens_RecID] int NULL,
  [System_Screens_RecID] int NULL
);
GO

-- dbo.GL_Account
CREATE TABLE [dbo].[GL_Account] (
  [GL_Account_RecID] int NOT NULL,
  [GL_Setup_RecID] int NULL,
  [RecID] int NULL,
  [Account_Seg] nvarchar(255) NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NULL,
  [GL_Item] nvarchar(255) NULL,
  [GL_SalesCode] nvarchar(255) NULL,
  [GL_Cogs] nvarchar(255) NULL,
  [GL_Inventory] nvarchar(255) NULL,
  [Segment1] nvarchar(255) NULL,
  [Segment2] nvarchar(255) NULL,
  [Segment3] nvarchar(255) NULL,
  [Segment4] nvarchar(255) NULL,
  [Segment5] nvarchar(255) NULL,
  [Segment6] nvarchar(255) NULL,
  [Segment7] nvarchar(255) NULL,
  [Segment8] nvarchar(255) NULL,
  [Segment9] nvarchar(255) NULL,
  [Segment10] nvarchar(255) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [GL_Cogs2] nvarchar(255) NULL,
  [GL_Cogs3] nvarchar(255) NULL,
  [GL_Cogs4] nvarchar(255) NULL,
  [GL_Cogs5] nvarchar(255) NULL,
  [GL_Cogs6] nvarchar(255) NULL,
  [GL_Cogs7] nvarchar(255) NULL,
  [GL_Cogs8] nvarchar(255) NULL,
  [GL_Cogs9] nvarchar(255) NULL,
  [GL_Cogs10] nvarchar(255) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.GL_BatchID
CREATE TABLE [dbo].[GL_BatchID] (
  [GL_BatchID_RecID] int NOT NULL,
  [GL_BatchID] nvarchar(50) NULL,
  [GL_Batch_Date] datetime NULL,
  [Date_Posted] datetime NULL,
  [Posted_By] nvarchar(15) NULL,
  [Expense_Detail_Flag] bit NULL,
  [Closed_Flag] bit NULL,
  [Date_Closed] datetime NULL,
  [Closed_By] nvarchar(15) NULL,
  [GL_Batch_Date_UTC] datetime NULL
);
GO

-- dbo.GL_Caption
CREATE TABLE [dbo].[GL_Caption] (
  [GL_Caption_RecID] int NOT NULL,
  [Segment_Nbr] smallint NOT NULL,
  [Caption] nvarchar(30) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Segment1] nvarchar(255) NULL,
  [Segment2] nvarchar(255) NULL,
  [Segment3] nvarchar(255) NULL,
  [Segment4] nvarchar(255) NULL,
  [Segment5] nvarchar(255) NULL,
  [Segment6] nvarchar(255) NULL,
  [Segment7] nvarchar(255) NULL,
  [Segment8] nvarchar(255) NULL,
  [Segment9] nvarchar(255) NULL,
  [Segment10] nvarchar(255) NULL,
  [Segment1_Type] char(1) NULL,
  [Segment2_Type] char(1) NULL,
  [Segment3_Type] char(1) NULL,
  [Segment4_Type] char(1) NULL,
  [Segment5_Type] char(1) NULL,
  [Segment6_Type] char(1) NULL,
  [Segment7_Type] char(1) NULL,
  [Segment8_Type] char(1) NULL,
  [Segment9_Type] char(1) NULL,
  [Segment10_Type] char(1) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Cogs1] nvarchar(255) NULL,
  [Cogs2] nvarchar(255) NULL,
  [Cogs3] nvarchar(255) NULL,
  [Cogs4] nvarchar(255) NULL,
  [Cogs5] nvarchar(255) NULL,
  [Cogs6] nvarchar(255) NULL,
  [Cogs7] nvarchar(255) NULL,
  [Cogs8] nvarchar(255) NULL,
  [Cogs9] nvarchar(255) NULL,
  [Cogs10] nvarchar(255) NULL,
  [Cogs1_Type] char(1) NULL,
  [Cogs2_Type] char(1) NULL,
  [Cogs3_Type] char(1) NULL,
  [Cogs4_Type] char(1) NULL,
  [Cogs5_Type] char(1) NULL,
  [Cogs6_Type] char(1) NULL,
  [Cogs7_Type] char(1) NULL,
  [Cogs8_Type] char(1) NULL,
  [Cogs9_Type] char(1) NULL,
  [Cogs10_Type] char(1) NULL
);
GO

-- dbo.GL_Entry
CREATE TABLE [dbo].[GL_Entry] (
  [GL_Entry_RecID] int NOT NULL,
  [GL_BatchID_RecID] int NULL,
  [Table_Reference] nvarchar(100) NULL,
  [RecID] int NOT NULL,
  [GL_Type_ID] char(2) NULL,
  [GL_Amount] decimal(18,2) NULL,
  [GL_Description] nvarchar(100) NULL,
  [Override_By] nvarchar(15) NULL,
  [Override_Date] datetime NULL,
  [Override_Reason] nvarchar(255) NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime NOT NULL,
  [GL_Cost] decimal(18,2) NULL,
  [iv_product_recid] int NULL,
  [GL_Item] nvarchar(255) NULL,
  [GL_SalesCode] nvarchar(255) NULL,
  [GL_COGS] nvarchar(255) NULL,
  [GL_Inventory] nvarchar(255) NULL,
  [Segment1] nvarchar(255) NULL,
  [Segment2] nvarchar(255) NULL,
  [Segment3] nvarchar(255) NULL,
  [Segment4] nvarchar(255) NULL,
  [Segment5] nvarchar(255) NULL,
  [Segment6] nvarchar(255) NULL,
  [Segment7] nvarchar(255) NULL,
  [Segment8] nvarchar(255) NULL,
  [Segment9] nvarchar(255) NULL,
  [Segment10] nvarchar(255) NULL,
  [Item_Taxable_Flag] bit NOT NULL,
  [SR_Service_RecID] int NULL,
  [PM_Project_RecID] int NULL,
  [PM_Phase_RecID] int NULL,
  [EX_Type_RecID] int NULL,
  [Time_RecID] int NULL,
  [SO_Activity_RecID] int NULL,
  [Quantity] decimal(18,2) NOT NULL,
  [Packing_Slip] nvarchar(50) NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [GL_Cogs2] nvarchar(255) NULL,
  [GL_Cogs3] nvarchar(255) NULL,
  [GL_Cogs4] nvarchar(255) NULL,
  [GL_Cogs5] nvarchar(255) NULL,
  [GL_Cogs6] nvarchar(255) NULL,
  [GL_Cogs7] nvarchar(255) NULL,
  [GL_Cogs8] nvarchar(255) NULL,
  [GL_Cogs9] nvarchar(255) NULL,
  [GL_Cogs10] nvarchar(255) NULL,
  [Tax_Level] tinyint NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.GL_Entry_Taxable_Level
CREATE TABLE [dbo].[GL_Entry_Taxable_Level] (
  [GL_Entry_Taxable_Level_RecID] int NOT NULL,
  [GL_Entry_RecID] int NOT NULL,
  [Tax_Level] tinyint NOT NULL
);
GO

-- dbo.GL_Interface
CREATE TABLE [dbo].[GL_Interface] (
  [GL_Interface_RecID] int NOT NULL,
  [GL_Interface_ID] nvarchar(10) NOT NULL,
  [Description] nvarchar(30) NULL,
  [XSL_Path] nvarchar(100) NULL,
  [tax_option] bit NOT NULL,
  [Name_Address_Option] bit NULL,
  [Expense_AP_Option] bit NULL,
  [Inventory_Post_Option] bit NULL,
  [COGS_Account] nvarchar(50) NULL,
  [invoice_option] bit NULL,
  [expense_option] bit NULL,
  [expensedetail_option] bit NULL,
  [Inv_Valid] bit NULL,
  [Exp_Valid] bit NULL,
  [ExpSum_Valid] bit NULL,
  [Inven_Valid] bit NULL,
  [Tax_Valid] bit NULL,
  [Entry_Item_Valid] bit NULL,
  [Entry_Cost_Valid] bit NULL,
  [Entry_SalesCode_Valid] bit NULL,
  [Entry_COGS_Valid] bit NULL,
  [Entry_Inven_Valid] bit NULL,
  [GL_Separator] char(1) NULL,
  [SuppressMemo_Flag] bit NULL,
  [SuppressMemo_Valid] bit NULL,
  [ExpAsBill_Valid] bit NULL,
  [ExpAsBill_Flag] bit NULL,
  [Direct_Export_Flag] bit NULL,
  [Direct_Export_Valid] bit NULL,
  [COGS_Option] bit NULL,
  [COGS_Valid] bit NULL,
  [Company_Length] smallint NULL,
  [Tax_Groups_Option] bit NULL,
  [Tax_Groups_Valid] bit NULL,
  [Inventory_Option] bit NULL,
  [Inventory_Valid] bit NULL,
  [Payment_Sync_Option] bit NOT NULL,
  [Payment_Sync_Valid] bit NOT NULL,
  [Last_Payment_Sync] datetime NULL,
  [Last_Payment_Sync_By] nvarchar(15) NULL,
  [InvoiceDetail_Option] smallint NULL,
  [InvoiceDetail_Valid] bit NOT NULL,
  [DropShip_Cogs_Option] bit NOT NULL,
  [DropShip_Cogs_Valid] bit NOT NULL,
  [Component_Amount_Option] bit NOT NULL,
  [Zero_Nontaxable_Flag] bit NOT NULL,
  [UOM_Product_Option] bit NOT NULL
);
GO

-- dbo.GL_InterfaceDtl
CREATE TABLE [dbo].[GL_InterfaceDtl] (
  [GL_InterfaceDtl_RecID] int NOT NULL,
  [GL_Interface_ID] nvarchar(10) NULL,
  [Sequence_Nbr] smallint NOT NULL,
  [GL_Attribute] nvarchar(50) NULL,
  [GL_Separator] nvarchar(1) NULL
);
GO

-- dbo.GL_Path
CREATE TABLE [dbo].[GL_Path] (
  [GL_Path_RecID] int NOT NULL,
  [Owner_Level_Recid] int NULL,
  [GL_Path_Name] nvarchar(255) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Server_Name] nvarchar(100) NULL,
  [Sql_Server_Name] nvarchar(255) NULL,
  [Database_Name] nvarchar(100) NULL,
  [Last_Payment_Sync] datetime2(0) NULL,
  [Last_Payment_Sync_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Last_Payment_Sync_UTC] datetime2(0) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.GL_Setup
CREATE TABLE [dbo].[GL_Setup] (
  [GL_Setup_RecID] int NOT NULL,
  [Table_Name] nvarchar(50) NOT NULL,
  [GL_Type_ID] nvarchar(2) NOT NULL,
  [GL_Table_RecID] int NULL
);
GO

-- dbo.GL_Sync_Option
CREATE TABLE [dbo].[GL_Sync_Option] (
  [GL_Sync_Option_RecID] int NOT NULL,
  [ID] nvarchar(50) NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Sort_Order] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.GL_Table
CREATE TABLE [dbo].[GL_Table] (
  [GL_Table_RecID] int NOT NULL,
  [GL_Table_Name] nvarchar(100) NULL,
  [GL_Table_Desc] nvarchar(50) NULL,
  [Selection_Order] int NULL,
  [GL_RecID_Field] nvarchar(100) NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.GL_Type
CREATE TABLE [dbo].[GL_Type] (
  [GL_Type_ID] varchar(2) NOT NULL,
  [GL_Type_Name] nvarchar(30) NULL,
  [Sort_Order] smallint NULL,
  [Balance] char(2) NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Group_Type
CREATE TABLE [dbo].[Group_Type] (
  [Group_Type_RecID] int NOT NULL,
  [Company_Group_Name] nvarchar(255) NULL,
  [Company_Flag] bit NOT NULL,
  [Contact_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Public_Flag] bit NOT NULL,
  [Public_Description] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Group_Type_Audit
CREATE TABLE [dbo].[Group_Type_Audit] (
  [Group_Type_Audit_RecID] int NOT NULL,
  [Group_Type_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Audit_SubType_RecID] smallint NULL,
  [Audit_Data_Type_Format_RecID] int NOT NULL,
  [OldValue_Text] nvarchar(2000) NULL,
  [NewValue_Text] nvarchar(2000) NULL,
  [Affected_Record] nvarchar(100) NULL,
  [DM_Document_RecID] int NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [AffectedRecord_Locale_Key_RecId] int NULL,
  [OldValue_Locale_Key_RecID] int NULL,
  [NewValue_Locale_Key_RecID] int NULL
);
GO

-- dbo.Holiday
CREATE TABLE [dbo].[Holiday] (
  [Holiday_List_RecID] int NOT NULL,
  [Holiday_Date] date NOT NULL,
  [Time_Start] time(0) NULL,
  [Time_End] time(0) NULL,
  [Description] nvarchar(50) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Holiday_RecID] int NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Holiday_List
CREATE TABLE [dbo].[Holiday_List] (
  [Holiday_List_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Html_Editor
CREATE TABLE [dbo].[Html_Editor] (
  [Html_Editor_RecId] int NOT NULL,
  [Html_Editor_Name] nvarchar(25) NOT NULL,
  [Table_Reference] nvarchar(100) NOT NULL
);
GO

-- dbo.Html_Editor_Image
CREATE TABLE [dbo].[Html_Editor_Image] (
  [Html_Editor_RecId] int NOT NULL,
  [Html_Editor_Image_Data_RecId] int NOT NULL,
  [RecId] int NOT NULL,
  [Is_Private] bit NOT NULL,
  [Image_Access_Id] nvarchar(36) NOT NULL
);
GO

-- dbo.Html_Editor_Image_Data
CREATE TABLE [dbo].[Html_Editor_Image_Data] (
  [Html_Editor_Image_Data_RecId] int NOT NULL,
  [File_Name] nvarchar(100) NOT NULL,
  [Mime_Type] nvarchar(100) NOT NULL,
  [Image_Binary] varbinary(max) NOT NULL
);
GO

-- dbo.Import_Map
CREATE TABLE [dbo].[Import_Map] (
  [id] int NOT NULL,
  [fldFile] nvarchar(50) NULL,
  [fldFO] nvarchar(50) NULL,
  [tableFO] nvarchar(50) NULL,
  [batch] int NULL,
  [lastUpdate] datetime2(0) NULL
);
GO

-- dbo.InOut_Type
CREATE TABLE [dbo].[InOut_Type] (
  [InOut_Type_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.integration_api
CREATE TABLE [dbo].[integration_api] (
  [Integration_API_Recid] int NOT NULL,
  [API_Id] nvarchar(50) NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Callback_Enabled] bit NOT NULL,
  [Hierarchical_Callback_System_Flag] bit NOT NULL
);
GO

-- dbo.integration_configuration_api
CREATE TABLE [dbo].[integration_configuration_api] (
  [integration_configuration_api_recid] int NOT NULL,
  [integration_login_recid] int NOT NULL,
  [auto_child_flag] bit NOT NULL,
  [manual_child_flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.integration_login
CREATE TABLE [dbo].[integration_login] (
  [integration_login_recid] int NOT NULL,
  [username] nvarchar(50) NOT NULL,
  [password] nvarchar(100) NULL,
  [updated_by] nvarchar(50) NOT NULL,
  [last_update] datetime2(0) NOT NULL,
  [can_access_all_records] bit NOT NULL,
  [System_Flag] bit NOT NULL,
  [Log_End_Date_Time_Utc] datetime2(0) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Date_Inactivated_UTC] datetime2(0) NULL,
  [Inactivated_By_RecID] int NULL,
  [Admin_Override_Flag] bit NOT NULL,
  [Inactivation_Reason] nvarchar(255) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.integration_login_api
CREATE TABLE [dbo].[integration_login_api] (
  [Integration_Login_Api_Recid] int NOT NULL,
  [Integration_Login_Recid] int NOT NULL,
  [Integration_Api_Recid] int NOT NULL,
  [Callback_Url] nvarchar(1000) NULL,
  [Legacy_Callback_Flag] bit NOT NULL
);
GO

-- dbo.integration_login_object
CREATE TABLE [dbo].[integration_login_object] (
  [Integration_Login_Object_Recid] int NOT NULL,
  [Integration_Login_Recid] int NOT NULL,
  [Recid] int NOT NULL,
  [Integration_Object_Type_Recid] int NOT NULL
);
GO

-- dbo.integration_login_sr_service
CREATE TABLE [dbo].[integration_login_sr_service] (
  [Integration_Login_Sr_Service_RecID] int NOT NULL,
  [Integration_Login_Recid] int NOT NULL,
  [Sr_Service_Recid] int NOT NULL
);
GO

-- dbo.integration_managed_services_api
CREATE TABLE [dbo].[integration_managed_services_api] (
  [integration_managed_services_api_recid] int NOT NULL,
  [integration_login_recid] int NOT NULL,
  [auto_child_flag] bit NOT NULL,
  [manual_child_flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.integration_object_type
CREATE TABLE [dbo].[integration_object_type] (
  [Integration_Object_Type_Recid] int NOT NULL,
  [Object_Id] nvarchar(50) NOT NULL
);
GO

-- dbo.integration_service_api
CREATE TABLE [dbo].[integration_service_api] (
  [integration_service_api_recid] int NOT NULL,
  [integration_login_recid] int NOT NULL,
  [sr_board_recid] int NOT NULL,
  [ticket_update_callback_url] nvarchar(1024) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(50) NOT NULL,
  [Legacy_Callback_Flag] bit NOT NULL
);
GO

-- dbo.integration_time_api
CREATE TABLE [dbo].[integration_time_api] (
  [integration_time_api_recid] int NOT NULL,
  [integration_login_recid] int NOT NULL,
  [member_recid] int NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(50) NOT NULL
);
GO

-- dbo.Inventory_By_Warehouse
CREATE TABLE [dbo].[Inventory_By_Warehouse] (
  [Inventory_By_Warehouse_RecID] int NOT NULL,
  [IV_Item_RecID] int NOT NULL,
  [Warehouse_RecID] int NOT NULL,
  [Warehouse_Bin_RecID] int NOT NULL,
  [Qty_On_Hand] decimal(18,2) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.Inventory_By_Warehouse_Audit
CREATE TABLE [dbo].[Inventory_By_Warehouse_Audit] (
  [Inventory_By_Warehouse_Audit_RecID] bigint NOT NULL,
  [Inventory_By_Warehouse_RecID] bigint NOT NULL,
  [IV_Item_RecID] int NOT NULL,
  [Warehouse_RecID] int NOT NULL,
  [Warehouse_Bin_RecID] int NOT NULL,
  [Before_Qty_On_Hand] decimal(18,2) NOT NULL,
  [After_Qty_On_Hand] decimal(18,2) NOT NULL,
  [Last_Update] datetime2(3) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [LOG_Transaction_User] nvarchar(50) NOT NULL,
  [LOG_Transaction_Statement] nvarchar(max) NOT NULL
);
GO

-- dbo.Invoice_Grouping
CREATE TABLE [dbo].[Invoice_Grouping] (
  [Invoice_Grouping_RecID] int NOT NULL,
  [Invoice_Grouping_ID] nvarchar(50) NOT NULL,
  [Customer_Description] nvarchar(1000) NOT NULL,
  [Show_Price_Flag] bit NOT NULL,
  [Show_Sub_Items_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Group_Parent_Child_Additions_Flag] bit NOT NULL
);
GO

-- dbo.IV_Adjustment
CREATE TABLE [dbo].[IV_Adjustment] (
  [IV_Adjustment_RecID] int NOT NULL,
  [IV_Adjustment_Type_RecID] int NULL,
  [Description] nvarchar(50) NULL,
  [Reason] nvarchar(100) NULL,
  [Notes] nvarchar(max) NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Closed_Flag] bit NOT NULL,
  [Date_Closed] datetime2(0) NULL,
  [Closed_By] nvarchar(15) NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Closed_UTC] datetime2(0) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_Adjustment_Detail
CREATE TABLE [dbo].[IV_Adjustment_Detail] (
  [IV_Adjustment_Detail_RecID] int NOT NULL,
  [IV_Adjustment_RecID] int NOT NULL,
  [IV_Item_RecID] int NOT NULL,
  [Description] nvarchar(100) NULL,
  [On_Hand_Qty] decimal(18,2) NULL,
  [Adjusted_Qty] int NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Warehouse_RecID] int NULL,
  [Warehouse_Bin_RecID] int NULL,
  [Unit_Cost] decimal(18,6) NULL,
  [Serial_Number_Audit_List] nvarchar(1000) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_Adjustment_Type
CREATE TABLE [dbo].[IV_Adjustment_Type] (
  [IV_Adjustment_Type_RecID] int NOT NULL,
  [IV_Adjustment_Type_ID] nvarchar(50) NOT NULL,
  [Description] nvarchar(100) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Audit_Trail_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Created_By] nvarchar(15) NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_Audit
CREATE TABLE [dbo].[IV_Audit] (
  [IV_Item_RecID] int NOT NULL,
  [Warehouse_RecID] int NULL,
  [Warehouse_Bin_RecID] int NULL,
  [Quantity_Change] decimal(18,2) NULL,
  [Transaction_Type] nvarchar(200) NULL,
  [IV_Product_RecID] int NULL,
  [Purchase_Detail_RecID] int NULL,
  [Updated_By] nvarchar(15) NULL,
  [Transaction_Date] datetime NULL,
  [Transfer_Audit_RecID] int NULL,
  [Avg_Cost] decimal(18,6) NULL,
  [LIFO_Cost] decimal(18,6) NULL,
  [FIFO_Cost] decimal(18,6) NULL,
  [Unit_Cost] decimal(18,6) NULL,
  [LIFO_Balance] decimal(18,2) NULL,
  [FIFO_Balance] decimal(18,2) NULL,
  [IV_Adjustment_Detail_RecID] int NULL,
  [Serial_Numbers] nvarchar(max) NULL,
  [Quantity_On_Hand] int NULL,
  [Recreate_Flag] bit NOT NULL,
  [IV_Audit_RecID] int NOT NULL,
  [Id] uniqueidentifier NOT NULL,
  [Ship_Pick_Date] datetime NULL
);
GO

-- dbo.IV_Category
CREATE TABLE [dbo].[IV_Category] (
  [IV_Cat_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Mobile_Download] bit NOT NULL,
  [Price_Level_Xref] nvarchar(10) NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_Category_Loc
CREATE TABLE [dbo].[IV_Category_Loc] (
  [IV_Category_Loc_RecID] int NOT NULL,
  [IV_Cat_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.IV_Class
CREATE TABLE [dbo].[IV_Class] (
  [IV_Class_RecID] smallint NOT NULL,
  [IV_Class_ID] char(1) NOT NULL,
  [Class_Description] nvarchar(25) NULL,
  [Locale_Key_RecID] int NOT NULL
);
GO

-- dbo.IV_Costing_Method
CREATE TABLE [dbo].[IV_Costing_Method] (
  [IV_Costing_Method_RecID] int NOT NULL,
  [IV_Costing_Method_Name] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NULL
);
GO

-- dbo.IV_Item
CREATE TABLE [dbo].[IV_Item] (
  [IV_Item_RecID] int NOT NULL,
  [Item_ID] nvarchar(75) NULL,
  [Description] nvarchar(60) NULL,
  [IV_Type_RecID] int NULL,
  [IV_SubCat_RecID] int NULL,
  [IV_UOM_RecID] int NULL,
  [Current_Cost] decimal(18,6) NULL,
  [List_Price] decimal(18,6) NOT NULL,
  [Taxable_Flag] bit NOT NULL,
  [Mfg_Item_ID] nvarchar(50) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NOT NULL,
  [Long_Description] nvarchar(max) NULL,
  [Serialized_Flag] bit NULL,
  [IV_Class_ID] char(1) NULL,
  [Manufacturer_RecID] int NULL,
  [Vendor_RecID] int NULL,
  [Vendor_SKU] nvarchar(50) NULL,
  [Notes] nvarchar(max) NULL,
  [Minimum_Stock] int NULL,
  [IV_Price_Attribute_ID] char(1) NULL,
  [Calc_Price_Flag] bit NOT NULL,
  [Calc_Cost_Flag] bit NOT NULL,
  [SerializedCost_Flag] bit NOT NULL,
  [Phase_Product_Flag] bit NOT NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [SR_SLA_RecID] int NULL,
  [Recurring_Revenue] decimal(18,2) NULL,
  [Recurring_Cost] decimal(18,2) NULL,
  [Recurring_Date_Start] datetime NULL,
  [Recurring_Date_End] datetime NULL,
  [Bill_Cycle_ID] nvarchar(5) NULL,
  [Cycle_Basis_ID] char(1) NULL,
  [Recurring_Flag] bit NOT NULL,
  [Customer_Usage_Type_RecID] int NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Recurring_OneTime_Flag] bit NOT NULL,
  [Purchase_Tax_Flag] bit NOT NULL,
  [Drop_Ship_Flag] bit NOT NULL,
  [Special_Order_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Billable_Options_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL,
  [AGR_Type_RecID] int NULL,
  [Markup_Percentage] decimal(5,2) NULL,
  [Markup_Flag] bit NOT NULL,
  [Auto_Update_Unit_Cost_Flag] bit NOT NULL,
  [Auto_Update_Unit_Price_Flag] bit NOT NULL
);
GO

-- dbo.IV_Item_Bundle
CREATE TABLE [dbo].[IV_Item_Bundle] (
  [IV_Item_Bundle_RecID] int NOT NULL,
  [Iv_Item_Recid] int NOT NULL,
  [parent_recid] int NULL,
  [Sequence_Number] int NOT NULL,
  [Quantity] decimal(18,2) NOT NULL,
  [Hide_Price_Flag] bit NOT NULL,
  [Hide_Item_ID_Flag] bit NOT NULL,
  [Hide_Description_Flag] bit NOT NULL,
  [Hide_Quantity_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Hide_Ext_Price_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_Item_User_Defined_Field_Value
CREATE TABLE [dbo].[IV_Item_User_Defined_Field_Value] (
  [IV_Item_User_Defined_Field_Value_RecID] bigint NOT NULL,
  [IV_Item_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [User_Defined_Field_Value] nvarchar(1000) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.iv_item_Vendor
CREATE TABLE [dbo].[iv_item_Vendor] (
  [IV_Item_Vendor_ID] int NOT NULL,
  [IV_Item_RecID] int NOT NULL,
  [Vendor_RecID] int NULL,
  [Vendor_SKU] nvarchar(50) NULL,
  [Is_Preferred_Vendor] bit NOT NULL
);
GO

-- dbo.IV_Price_Attribute
CREATE TABLE [dbo].[IV_Price_Attribute] (
  [IV_Price_Attribute_RecID] int NOT NULL,
  [IV_Price_Attribute_ID] char(1) NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.IV_Price_Header
CREATE TABLE [dbo].[IV_Price_Header] (
  [IV_Price_Header_RecID] int NOT NULL,
  [Price_Schedule_Name] nvarchar(30) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Inactive_Flag] bit NULL,
  [Default_Flag] bit NULL,
  [Currency_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_Price_Method
CREATE TABLE [dbo].[IV_Price_Method] (
  [IV_Price_Method_ID] char(2) NOT NULL,
  [Short_Name] nvarchar(30) NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.IV_Product
CREATE TABLE [dbo].[IV_Product] (
  [IV_Product_RecID] int NOT NULL,
  [Billing_Log_RecID] int NULL,
  [IV_Item_RecID] int NOT NULL,
  [Description] nvarchar(max) NULL,
  [Quantity] decimal(18,2) NULL,
  [Unit_Price] decimal(18,6) NULL,
  [Unit_Cost] decimal(18,6) NULL,
  [Billable_Flag] bit NOT NULL,
  [Invoice_Flag] bit NOT NULL,
  [Taxable_Flag] bit NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NULL,
  [SR_Service_RecID] int NULL,
  [PM_Project_RecID] int NULL,
  [AGR_Header_RecID] int NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NOT NULL,
  [AGR_Amount] decimal(18,2) NULL,
  [Date_Entered] datetime NULL,
  [AGR_Month] smallint NULL,
  [AGR_Year] smallint NULL,
  [TE_Status_ID] smallint NOT NULL,
  [AGR_Detail_RecID] int NULL,
  [billing_sr] int NULL,
  [DropShip_Flag] bit NOT NULL,
  [ShipmentMethod_RecID] int NULL,
  [Sub_Supplied_Flag] bit NOT NULL,
  [Sub_ShipTo_RecID] int NULL,
  [Sub_Limit] decimal(18,2) NULL,
  [cn_guid] nvarchar(50) NULL,
  [Cn_Dirty_Flag] bit NOT NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Warehouse_Bin_RecID] int NULL,
  [Warehouse_RecID] int NULL,
  [Received] bit NULL,
  [Order_Header_RecID] int NULL,
  [Cancel_Flag] bit NOT NULL,
  [Cancel_Date] datetime NULL,
  [Cancel_By] int NULL,
  [Internal_Note] nvarchar(1000) NULL,
  [PO_Approved_Flag] bit NOT NULL,
  [Cancel_Reason] nvarchar(100) NULL,
  [Audit_Text] nvarchar(50) NULL,
  [Opportunity_RecID] int NULL,
  [SO_Forecast_Dtl_RecID] int NULL,
  [Calc_Price_Flag] bit NOT NULL,
  [Calc_Cost_Flag] bit NOT NULL,
  [Quote_Flag] bit NOT NULL,
  [QuoteWerks_Flag] bit NOT NULL,
  [Sub_Number] int NOT NULL,
  [QuoteWerks_DocNO] nvarchar(50) NULL,
  [QuoteWerks_DocName] nvarchar(255) NULL,
  [Closed_Flag] bit NOT NULL,
  [Closed_By] nvarchar(15) NULL,
  [Date_Closed] datetime NULL,
  [Quantity_Cancelled] decimal(18,2) NULL,
  [Flatrate_Flag] bit NOT NULL,
  [Extended_Price_Amount] decimal(18,6) NULL,
  [Extended_Cost_Amount] decimal(18,6) NULL,
  [Converted_RecID] int NULL,
  [Qty_Included] decimal(18,2) NOT NULL,
  [Special_Order_Flag] bit NOT NULL,
  [Minimum_Stock_Flag] bit NOT NULL,
  [Qty_Shipped] decimal(18,2) NOT NULL,
  [Qty_Picked] decimal(18,2) NOT NULL,
  [Received_Flag] bit NOT NULL,
  [Detail_ShipmentMethod] nvarchar(200) NULL,
  [Purchase_Info] nvarchar(max) NULL,
  [Detail_Serial_List] nvarchar(max) NULL,
  [AGD_Addition_Serial_Number] nvarchar(50) NULL,
  [Phase_Product_Flag] bit NOT NULL,
  [Short_Description] nvarchar(2000) NULL,
  [Converted_Project_RecID] int NULL,
  [Sequence_Number] decimal(8,2) NOT NULL,
  [Child_Invoice_Override_Flag] bit NOT NULL,
  [Opportunity_Ext_Price_Amount] decimal(18,6) NULL,
  [Opportunity_Ext_Cost_Amount] decimal(18,6) NULL,
  [SO_Opp_Status_RecID] int NULL,
  [Qty_Purchased] int NOT NULL,
  [Vendor_RecID] int NULL,
  [SR_SLA_RecID] int NULL,
  [Qty_Convert] int NOT NULL,
  [Recurring_Revenue] decimal(18,2) NULL,
  [Recurring_Cost] decimal(18,6) NULL,
  [Recurring_Date_Start] datetime NULL,
  [Recurring_Date_End] datetime NULL,
  [Bill_Cycle_ID] nvarchar(5) NULL,
  [Cycle_Basis_ID] char(1) NULL,
  [Recurring_Flag] bit NOT NULL,
  [Customer_Usage_Type_RecID] int NULL,
  [Purchase_Date] date NULL,
  [IV_Price_Method_ID] nvarchar(2) NULL,
  [Discount_Amount] decimal(18,6) NULL,
  [List_Price] decimal(18,6) NULL,
  [Vendor_SKU] nvarchar(50) NULL,
  [Converted_AGR_Detail_RecID] int NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Purchase_Tracking_Numbers] nvarchar(200) NULL,
  [Recurring_OneTime_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Cancel_Date_UTC] datetime NULL,
  [Date_Closed_UTC] datetime NULL,
  [Ship_Set] nvarchar(10) NULL,
  [Invoice_Grouping_RecID] int NULL,
  [Asio_Subscriptions_ID] uniqueidentifier NULL,
  [Id] uniqueidentifier NULL,
  [Change_Order_Flag] bit NOT NULL,
  [AGR_Type_RecID] int NULL,
  [Split_From_RecID] int NULL
);
GO

-- dbo.IV_Product_Bundle
CREATE TABLE [dbo].[IV_Product_Bundle] (
  [IV_Product_Bundle_RecID] int NOT NULL,
  [IV_Product_RecID] int NOT NULL,
  [parent_recid] int NULL,
  [Sequence_Number] int NOT NULL,
  [Quantity] decimal(18,2) NOT NULL,
  [Hide_Price_Flag] bit NOT NULL,
  [Hide_Item_ID_Flag] bit NOT NULL,
  [Hide_Description_Flag] bit NOT NULL,
  [Hide_Quantity_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Parent_Item_RecID] int NULL,
  [Hide_Ext_Price_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_Product_Detail
CREATE TABLE [dbo].[IV_Product_Detail] (
  [IV_Product_Detail_RecID] bigint NOT NULL,
  [IV_Product_RecID] int NOT NULL,
  [Line_Number] int NOT NULL,
  [Billing_Log_RecID] int NULL,
  [Warehouse_Bin_RecID] int NULL,
  [ShipmentMethod_RecID] int NULL,
  [Purchase_Detail_RecID] int NULL,
  [Tracking_Number] nvarchar(50) NULL,
  [Serial_Number] nvarchar(max) NULL,
  [Date_Picked] datetime NULL,
  [Date_Shipped] datetime NULL,
  [Picked_By] nvarchar(15) NULL,
  [Shipped_By] nvarchar(15) NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Quantity_Picked] int NOT NULL,
  [Quantity_Shipped] int NOT NULL,
  [Quantity] int NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Picked_UTC] datetime NULL,
  [Date_Shipped_UTC] datetime NULL,
  [Expected_Arrival_Date] datetime NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.IV_Product_IW
CREATE TABLE [dbo].[IV_Product_IW] (
  [IV_Product_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [PM_Project_RecID] int NULL,
  [SR_Service_RecID] int NULL,
  [SR_Service_Group] int NULL,
  [Bill_Type] char(1) NULL,
  [PM_Phase_RecID] int NULL,
  [Prod_Amount] decimal(18,6) NULL,
  [RecType] char(1) NOT NULL,
  [Member_RecID] int NULL,
  [Member_Name] char(1) NULL,
  [Billable_Text] nvarchar(3) NULL,
  [Product_RecID] int NOT NULL,
  [IV_Item_RecID] int NOT NULL,
  [EX_Class_Description] char(1) NULL,
  [Unit_Price] decimal(18,6) NULL,
  [Rec_Date] datetime NULL,
  [Tax_RecID] int NULL,
  [P_Rec_Count] int NOT NULL,
  [AGR_Header_RecID] int NULL,
  [PM_Activity_RecID] int NULL,
  [Order_Header_RecID] int NULL,
  [Billing_Start_Date] datetime NULL,
  [Fixed_Fee] decimal(18,6) NULL,
  [SR_Status_RecID] int NULL,
  [Company_Address_RecID] int NULL,
  [AGR_Amount] decimal(18,6) NOT NULL,
  [Customer_PO] nvarchar(50) NULL,
  [Shipping_Address_RecID] int NULL,
  [Shipping_Company_RecID] int NULL,
  [Iso_Code] nvarchar(3) NULL,
  [Currency_RecID] int NOT NULL
);
GO

-- dbo.IV_Product_Purchase_Detail
CREATE TABLE [dbo].[IV_Product_Purchase_Detail] (
  [IV_Product_Purchase_Detail_RecID] int NOT NULL,
  [IV_Product_RecID] int NOT NULL,
  [Purchase_Detail_RecID] int NOT NULL,
  [Quantity] int NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_Product_User_Defined_Field_Value
CREATE TABLE [dbo].[IV_Product_User_Defined_Field_Value] (
  [IV_Product_User_Defined_Field_Value_RecID] bigint NOT NULL,
  [IV_Product_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [User_Defined_Field_Value] nvarchar(1000) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.IV_Recurring
CREATE TABLE [dbo].[IV_Recurring] (
  [IV_Recurring_RecID] int NOT NULL,
  [IV_Item_RecID] int NULL,
  [IV_Product_RecID] int NULL,
  [Revenue] decimal(18,2) NULL,
  [Cost] decimal(18,2) NULL,
  [Period_Start] date NOT NULL,
  [Period_End] date NOT NULL
);
GO

-- dbo.IV_Serial_Number
CREATE TABLE [dbo].[IV_Serial_Number] (
  [IV_Serial_Number_RecID] int NOT NULL,
  [Serial_Number] nvarchar(100) NOT NULL,
  [IV_Item_RecID] int NOT NULL,
  [Purchase_Detail_RecID] int NULL,
  [Warehouse_Bin_RecID] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Date_Received] datetime2(0) NOT NULL,
  [IV_Adjustment_Detail_RecID] int NULL,
  [Unit_Cost] decimal(18,6) NULL,
  [Returned_Product_Detail_RecID] bigint NULL,
  [IV_Product_Detail_RecID] bigint NULL,
  [Negative_Adjustment_Detail_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Received_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.IV_SubCategory
CREATE TABLE [dbo].[IV_SubCategory] (
  [IV_SubCat_RecID] int NOT NULL,
  [IV_Cat_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_Type
CREATE TABLE [dbo].[IV_Type] (
  [IV_Type_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Item_Type_Xref] nvarchar(30) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.IV_UOM
CREATE TABLE [dbo].[IV_UOM] (
  [IV_UOM_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [UOM_Schedule_Xref] nvarchar(31) NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Job_Header
CREATE TABLE [dbo].[Job_Header] (
  [Job_Header_RecID] int NOT NULL,
  [Job_Type] nvarchar(100) NULL,
  [Date_Created] datetime NULL,
  [Date_Started] datetime NULL,
  [Member_Started] nvarchar(15) NULL,
  [Action1] nvarchar(100) NULL,
  [Action1_Params] nvarchar(max) NULL,
  [Action2] nvarchar(100) NULL,
  [Action2_Params] nvarchar(max) NULL
);
GO

-- dbo.KB_Category
CREATE TABLE [dbo].[KB_Category] (
  [KB_Category_RecID] int NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Description] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Member_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.KB_Resolution
CREATE TABLE [dbo].[KB_Resolution] (
  [KB_Resolution_RecID] int NOT NULL,
  [KB_Category_RecID] int NULL,
  [KB_SubCategory_RecID] int NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [SR_Board_RecID] int NULL,
  [Summary] nvarchar(max) NULL,
  [Detail_Problem] nvarchar(max) NULL,
  [Resolution] nvarchar(max) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Company_RecId] int NULL,
  [Configuration_Type_RecId] int NULL,
  [KB_Status_Key] varchar(1) NULL,
  [Internal_Notes] nvarchar(max) NULL,
  [Notification_History] nvarchar(4000) NOT NULL,
  [Submitted_By] nvarchar(15) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.KB_Resolution_Audit
CREATE TABLE [dbo].[KB_Resolution_Audit] (
  [KB_Resolution_Audit_RecID] int NOT NULL,
  [KB_Resolution_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Audit_SubType_RecID] smallint NULL,
  [Audit_Data_Type_Format_RecID] int NOT NULL,
  [OldValue_Text] nvarchar(2000) NULL,
  [NewValue_Text] nvarchar(2000) NULL,
  [Affected_Record] nvarchar(100) NULL,
  [DM_Document_RecID] int NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(3) NOT NULL,
  [AffectedRecord_Locale_Key_RecId] int NULL,
  [OldValue_Locale_Key_RecID] int NULL,
  [NewValue_Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.KB_Settings
CREATE TABLE [dbo].[KB_Settings] (
  [KB_Settings_RecID] int NOT NULL,
  [Member_RecID] int NULL,
  [Require_Approval] bit NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.KB_Status
CREATE TABLE [dbo].[KB_Status] (
  [KB_Status_Key] varchar(1) NOT NULL,
  [Description] nvarchar(20) NOT NULL
);
GO

-- dbo.KB_SubCategory
CREATE TABLE [dbo].[KB_SubCategory] (
  [KB_SubCategory_RecID] int NOT NULL,
  [KB_Category_RecID] int NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Description] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Lead_Import_Batch
CREATE TABLE [dbo].[Lead_Import_Batch] (
  [Lead_Import_Batch_RecID] int NOT NULL,
  [Description] nvarchar(100) NULL,
  [L_Company_Type_RecID] int NULL,
  [L_Company_Status_RecID] int NULL,
  [L_Lead_Flag] bit NULL,
  [L_Owner_Level_RecID] int NULL,
  [L_Market_RecID] int NULL,
  [L_Source_List] nvarchar(50) NULL,
  [L_Group_Type_RecID] int NULL,
  [L_Activity_Flag] bit NULL,
  [L_Activity_NewOnly_Flag] bit NULL,
  [L_Activity_Date] datetime2(0) NULL,
  [L_Activity_AssignTo_RecID] int NULL,
  [L_Activity_AssignBy_RecID] int NULL,
  [L_Activity_Subject] nvarchar(100) NULL,
  [L_Activity_Type_RecID] int NULL,
  [L_Activity_Status_RecID] int NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [L_Marketing_ID] nvarchar(50) NULL,
  [L_Marketing_Campaign_RecID] int NULL,
  [L_WF_Track_Header_RecID] int NULL
);
GO

-- dbo.Lead_Import_Batch_Details
CREATE TABLE [dbo].[Lead_Import_Batch_Details] (
  [Lead_Import_Batch_Details_RecID] int NOT NULL,
  [Lead_Import_Batch_RecID] int NOT NULL,
  [Company_RecID] int NULL,
  [NewCompany_Flag] bit NOT NULL,
  [Contact_RecID] int NULL,
  [NewContact_Flag] bit NOT NULL,
  [SO_Activity_RecID] int NULL,
  [NewSite_Flag] bit NOT NULL,
  [Company_Address_RecID] int NULL
);
GO

-- dbo.Lead_Import_Rule
CREATE TABLE [dbo].[Lead_Import_Rule] (
  [Lead_Import_RecID] int NOT NULL,
  [Rule_Table] nvarchar(50) NULL,
  [Rule_Field] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.Lead_Import_Value
CREATE TABLE [dbo].[Lead_Import_Value] (
  [Lead_Import_Value_RecID] int NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Field_Value] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.Locale
CREATE TABLE [dbo].[Locale] (
  [Locale_RecId] int NOT NULL,
  [Locale] nvarchar(5) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Description] nvarchar(100) NOT NULL
);
GO

-- dbo.Locale_Key
CREATE TABLE [dbo].[Locale_Key] (
  [Locale_Key_RecId] int NOT NULL,
  [Locale_Text_key] nvarchar(50) NOT NULL
);
GO

-- dbo.Locale_Text
CREATE TABLE [dbo].[Locale_Text] (
  [Locale_Text_RecID] int NOT NULL,
  [TextString] nvarchar(1024) NOT NULL,
  [Locale_Key_RecId] int NOT NULL,
  [Locale_RecId] int NOT NULL
);
GO

-- dbo.Login_Audit
CREATE TABLE [dbo].[Login_Audit] (
  [Login_Audit_RecID] int NOT NULL,
  [Member_ID] nvarchar(15) NOT NULL,
  [Date_Login_Attempted_UTC] datetime2(3) NOT NULL,
  [Session_Context] nvarchar(25) NOT NULL,
  [Remote_Host] nvarchar(100) NOT NULL,
  [Remote_Address] nvarchar(15) NOT NULL,
  [HTTP_X_FORWARDED_FOR] nvarchar(15) NOT NULL,
  [Successful_Login] bit NOT NULL,
  [Exceeded_Session_Limit] bit NOT NULL,
  [Attrs] nvarchar(4000) NULL
);
GO

-- dbo.Manage_Origin
CREATE TABLE [dbo].[Manage_Origin] (
  [Manage_Origin_RecID] int NOT NULL,
  [Origin] nvarchar(2000) NOT NULL,
  [Description] nvarchar(2000) NULL,
  [System_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Manufacturer
CREATE TABLE [dbo].[Manufacturer] (
  [Manufacturer_RecID] int NOT NULL,
  [Manufacturer_Name] nvarchar(50) NOT NULL,
  [Inactive_Flag] bit NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(30) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Market
CREATE TABLE [dbo].[Market] (
  [Market_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Marketing_Campaign
CREATE TABLE [dbo].[Marketing_Campaign] (
  [Marketing_Campaign_RecID] int NOT NULL,
  [Marketing_ID] nvarchar(50) NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Campaign_Subtype_RecID] int NOT NULL,
  [Campaign_Status_RecID] int NOT NULL,
  [Date_Start] datetime NULL,
  [Date_End] datetime NULL,
  [Owner_Level_RecID] int NULL,
  [Member_RecID] int NULL,
  [Date_Cancel] datetime NULL,
  [Cancel_Days] int NULL,
  [Cancel_Type] char(1) NULL,
  [Notes] nvarchar(max) NULL,
  [Budget_Revenue] decimal(18,2) NOT NULL,
  [Budget_Cost] decimal(18,2) NOT NULL,
  [Actual_Cost] decimal(18,2) NOT NULL,
  [Group_Type_RecID] int NULL,
  [WF_Track_Header_RecID] int NULL,
  [WF_Opp_Track_Header_RecID] int NULL,
  [Impressions] int NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Billing_Unit_RecID] int NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Marketing_Manager_Audit
CREATE TABLE [dbo].[Marketing_Manager_Audit] (
  [Marketing_Manager_Audit_RecID] int NOT NULL,
  [Email_Count] int NOT NULL,
  [Email_Subject] nvarchar(1000) NULL,
  [Followup_Activity_Count] int NOT NULL,
  [Followup_Activity_Subject] nvarchar(1000) NULL,
  [Followup_NotifyWho_ID] nvarchar(2) NULL,
  [Followup_Member_RecID] int NULL,
  [Historic_Activity_Count] int NOT NULL,
  [Historic_Activity_Subject] nvarchar(1000) NULL,
  [Historic_NotifyWho_ID] nvarchar(2) NULL,
  [Historic_Member_RecID] int NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [WF_Track_Header_RecID] int NULL,
  [Group_Type_RecID] int NULL,
  [followup_marketing_campaign_recid] int NULL,
  [historic_marketing_campaign_recid] int NULL,
  [Marketing_Campaign_RecID] int NULL,
  [Document_Count] int NULL,
  [Unsent] int NOT NULL,
  [Date_Entered_UTC] datetime2(3) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Meeting
CREATE TABLE [dbo].[Meeting] (
  [Meeting_RecID] int NOT NULL,
  [SR_Location_RecID] int NOT NULL,
  [SR_Service_RecID] int NOT NULL,
  [Assign_By_RecID] int NOT NULL,
  [On_Behalf_Of_Flag] bit NOT NULL,
  [On_Behalf_Of_Member_RecID] int NULL,
  [Subject] nvarchar(100) NULL,
  [Closed_Flag] bit NOT NULL,
  [Date_Close_UTC] datetime2(0) NULL,
  [Created_By] nvarchar(15) NULL,
  [Date_Time_Start_UTC] datetime2(0) NULL,
  [Date_Time_End_UTC] datetime2(0) NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Mobile_GUID] uniqueidentifier NOT NULL,
  [Exchange_Href] nvarchar(300) NULL,
  [Calendar_Invite_Sequence] int NOT NULL
);
GO

-- dbo.Meeting_Invitee
CREATE TABLE [dbo].[Meeting_Invitee] (
  [Meeting_Invitee_RecID] int NOT NULL,
  [Meeting_RecID] int NOT NULL,
  [Schedule_RecID] int NULL,
  [Contact_RecID] int NULL,
  [Email] nvarchar(100) NULL,
  [Meeting_Invitee_Status_RecID] int NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Created_By] nvarchar(15) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Mobile_GUID] uniqueidentifier NOT NULL
);
GO

-- dbo.Meeting_Invitee_Status
CREATE TABLE [dbo].[Meeting_Invitee_Status] (
  [Meeting_Invitee_Status_RecID] int NOT NULL,
  [Meeting_Invitee_Status_ID] nvarchar(15) NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Member
CREATE TABLE [dbo].[Member] (
  [Member_RecID] int NOT NULL,
  [Member_ID] nvarchar(15) NOT NULL,
  [First_Name] nvarchar(30) NULL,
  [Last_Name] nvarchar(30) NULL,
  [MAPI_Name] nvarchar(256) NULL,
  [Owner_Level_ID] smallint NULL,
  [Owner_Level_RecID] int NULL,
  [Role_ID] nvarchar(30) NULL,
  [Email_Address] nvarchar(250) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Member_PW] nvarchar(60) NULL,
  [Days_Tolerance] int NULL,
  [Hours_Min] decimal(18,2) NULL,
  [Time_Flag] bit NOT NULL,
  [Reports_To] nvarchar(15) NULL,
  [Approved_By] nvarchar(15) NULL,
  [Notes] nvarchar(max) NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Exchange_Server] nvarchar(50) NULL,
  [ConnectSync] bit NOT NULL,
  [Admin_Flag] bit NOT NULL,
  [Billing_Unit_RecID] int NULL,
  [Time_StartEnd_Flag] bit NOT NULL,
  [Time_24hr_Flag] bit NOT NULL,
  [Activity_Class_RecID] int NULL,
  [Billable_Forecast] decimal(18,2) NULL,
  [Daily_Capacity] decimal(18,2) NULL,
  [Disable_Login_Flag] bit NULL,
  [Default_Loc_RecID] int NULL,
  [Restrict_Loc_Flag] bit NULL,
  [Restrict_BU_Flag] bit NULL,
  [Require_Exp_Flag] bit NULL,
  [Require_Time_Flag] bit NULL,
  [Restrict_SB_Flag] bit NULL,
  [Restrict_Ter_Flag] bit NULL,
  [Default_Ter_RecID] int NULL,
  [Hourly_Cost] nvarchar(10) NULL,
  [TE_Date_Start] date NULL,
  [Time_Entry_Screen] nvarchar(10) NULL,
  [Hourly_Rate] decimal(18,2) NULL,
  [Enter_Parts_Flag] bit NOT NULL,
  [Enter_Company_Flag] bit NOT NULL,
  [Exp_Approver] nvarchar(15) NULL,
  [Utilization_Flag] bit NOT NULL,
  [Member_Type_RecID] int NULL,
  [SR_Owner_Level_RecID] int NULL,
  [SR_Billing_Unit_RecID] int NULL,
  [Title] nvarchar(50) NULL,
  [Middle_Initial] char(1) NULL,
  [Email_Override] nvarchar(50) NULL,
  [Date_Inactive] datetime NULL,
  [System_Flag] bit NULL,
  [Sch_OL_RecID] int NULL,
  [Sch_BU_RecID] int NULL,
  [Sch_Restrict_Flag] bit NULL,
  [Sch_NoDisplay_Flag] bit NULL,
  [Restrict_SB_Loc_Flag] bit NULL,
  [SR_Board_RecID] int NULL,
  [Mobile_Flag] bit NULL,
  [Sched_Capacity] decimal(18,2) NULL,
  [MemberChooserLast] nvarchar(30) NULL,
  [SkillChooserLast] int NULL,
  [time_zone_recid] int NULL,
  [BR_Header_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [ShowDispatchPortal] bit NULL,
  [DefaultScheduleView] tinyint NOT NULL,
  [EX_Company_Flag] bit NOT NULL,
  [TE_CellEntry] bit NULL,
  [PhoneNbr] nvarchar(15) NULL,
  [PhoneNbr_Ext] nvarchar(10) NULL,
  [PhoneNbr2] nvarchar(15) NULL,
  [PhoneNbr2_Mobile] nvarchar(10) NULL,
  [PhoneNbr3] nvarchar(15) NULL,
  [PhoneNbr3_Ext] nvarchar(10) NULL,
  [Email_Address2] nvarchar(250) NULL,
  [Email_Address3] nvarchar(250) NULL,
  [Default_Phone] smallint NULL,
  [Default_Email] smallint NULL,
  [Member_Class] char(1) NOT NULL,
  [Use_Skype_Flag] bit NULL,
  [PhoneInt_Flag] bit NOT NULL,
  [DefaultMyScheduleView] tinyint NOT NULL,
  [Signature] nvarchar(max) NULL,
  [Restrict_PM_Loc_Flag] bit NOT NULL,
  [PM_Owner_Level_RecID] int NULL,
  [Restrict_PM_BU_Flag] bit NOT NULL,
  [PM_Billing_Unit_Recid] int NULL,
  [Default_Auto_Refresh_Option] int NULL,
  [DescSize] nvarchar(50) NULL,
  [AnalysisSize] nvarchar(50) NULL,
  [ResolutionSize] nvarchar(50) NULL,
  [Default_Dispatch_Panel] int NULL,
  [Default_Opportunity_Show_All] bit NULL,
  [Date_Hire] date NULL,
  [Warehouse_RecID] int NULL,
  [Warehouse_Flag] bit NULL,
  [ShowMySchedulePortal] bit NULL,
  [Default_MySchedule_Panel] int NULL,
  [Warehouse_Bin_RecID] int NULL,
  [Warehouse_Bin_Flag] bit NOT NULL,
  [SR_Location_RecID] int NULL,
  [Image_Link] nvarchar(255) NULL,
  [Country_RecID] int NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Last_Login_UTC] datetime NULL,
  [Mobile_GPS_Flag] bit NOT NULL,
  [DescNewSize] int NOT NULL,
  [AnalysisNewSize] int NOT NULL,
  [ResolutionNewSize] int NOT NULL,
  [Scheduling_Auto_Stopwatch] bit NOT NULL,
  [Scheduling_Auto_Popup_Quick_Notes] bit NOT NULL,
  [Partner_Portal_Flag] bit NOT NULL,
  [Toast_Notification_Flag] bit NOT NULL,
  [Office365_ID] nvarchar(40) NULL,
  [PW_Last_Update_UTC] datetime NULL,
  [Use_Browser_Language_Flag] bit NOT NULL,
  [Member_Guid] uniqueidentifier NOT NULL,
  [Directional_Sync_RecID] int NOT NULL,
  [Use_Tel_Flag] bit NULL,
  [Use_Callto_Flag] bit NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Member_Api_Key
CREATE TABLE [dbo].[Member_Api_Key] (
  [Member_Api_Key_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Public_Key] nvarchar(16) NOT NULL,
  [Private_Key_Hash] nvarchar(256) NOT NULL,
  [Description] nvarchar(100) NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Expiration_Date_UTC] datetime2(0) NULL,
  [Generated_Salt] nvarchar(32) NULL,
  [System_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Date_Inactivated_UTC] datetime2(0) NULL,
  [Admin_Override_Inactive_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Member_Audit
CREATE TABLE [dbo].[Member_Audit] (
  [Member_Audit_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_UTC] datetime2(3) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Member_Audit_Value
CREATE TABLE [dbo].[Member_Audit_Value] (
  [Member_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(50) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(max) NOT NULL,
  [Member_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Member_Authentication_Service
CREATE TABLE [dbo].[Member_Authentication_Service] (
  [Member_Authentication_Service_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Authentication_Service_RecID] int NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Member_Chooser
CREATE TABLE [dbo].[Member_Chooser] (
  [Member_Chooser_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Restrict_OwnerLevel] int NULL,
  [Restrict_BillingUnit] int NULL,
  [Choice] int NOT NULL,
  [Team_RecID] int NULL,
  [Custom_Name] nvarchar(100) NOT NULL,
  [Custom_Recids] nvarchar(2000) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Member_Company
CREATE TABLE [dbo].[Member_Company] (
  [Member_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Date_Created] datetime2(0) NULL,
  [Vendor_Picker_Flag] bit NOT NULL,
  [Member_Company_RecID] int NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Member_Extended_Property
CREATE TABLE [dbo].[Member_Extended_Property] (
  [Member_Extended_Property_RecID] int NOT NULL,
  [Name] nvarchar(100) NOT NULL,
  [Default_Value] nvarchar(1024) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Member_Extended_Property_Value
CREATE TABLE [dbo].[Member_Extended_Property_Value] (
  [Member_Extended_Property_Value_RecID] int NOT NULL,
  [Member_Extended_Property_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Value] nvarchar(1024) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Member_Favorites_Screens
CREATE TABLE [dbo].[Member_Favorites_Screens] (
  [favorite_system_screens_recid] int NOT NULL,
  [system_screens_recid] int NOT NULL,
  [member_recid] int NOT NULL,
  [Sort_Order] int NOT NULL,
  [default_flag] int NOT NULL
);
GO

-- dbo.Member_InOut_Board
CREATE TABLE [dbo].[Member_InOut_Board] (
  [Member_InOut_Board_RecID] int NOT NULL,
  [InOut_Out_Flag] bit NOT NULL,
  [InOut_Type_RecID] int NOT NULL,
  [InOut_Additional] nvarchar(100) NULL,
  [InOut_Last_Update_UTC] datetime2(0) NOT NULL,
  [InOut_Updated_By] nvarchar(15) NOT NULL,
  [Member_RecID] int NOT NULL,
  [InOut_DateTime_Back_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Member_Link_Header
CREATE TABLE [dbo].[Member_Link_Header] (
  [Member_Link_Header_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Name] nvarchar(30) NULL,
  [Sort_Order] int NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.Member_Notification_Trigger
CREATE TABLE [dbo].[Member_Notification_Trigger] (
  [Member_Notification_Trigger_RecID] int NOT NULL,
  [Member_Notification_Trigger_ID] nvarchar(20) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Member_Notification_Trigger_Event
CREATE TABLE [dbo].[Member_Notification_Trigger_Event] (
  [Member_Notification_Trigger_Event_RecID] int NOT NULL,
  [Member_Notification_Trigger_Event_ID] nvarchar(30) NOT NULL,
  [Member_Notification_Trigger_RecID] int NOT NULL,
  [Record_Table_Reference] nvarchar(20) NULL,
  [Locale_Key_RecID] int NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Member_Persona
CREATE TABLE [dbo].[Member_Persona] (
  [Member_Persona_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Persona_RecID] int NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_UTC] datetime2(0) NOT NULL,
  [Job_Role_Percentage] int NULL
);
GO

-- dbo.Member_Placeholder_Pod
CREATE TABLE [dbo].[Member_Placeholder_Pod] (
  [Member_Placeholder_Pod_RecID] int NOT NULL,
  [PresenterIdentifier] nvarchar(50) NOT NULL,
  [Member_RecID] int NOT NULL
);
GO

-- dbo.Member_Recent_Item
CREATE TABLE [dbo].[Member_Recent_Item] (
  [Member_Recent_Item_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Created] datetime2(0) NOT NULL,
  [Description] nvarchar(256) NOT NULL,
  [Url] nvarchar(4000) NOT NULL,
  [ItemType] nvarchar(64) NOT NULL,
  [RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.member_saved_tabs
CREATE TABLE [dbo].[member_saved_tabs] (
  [Member_Saved_Tabs_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Tabs_Slob] nvarchar(max) NOT NULL
);
GO

-- dbo.Member_Screen_Layout
CREATE TABLE [dbo].[Member_Screen_Layout] (
  [Member_Screen_Layout_Recid] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Pod_RecID] int NULL,
  [Screen_Column] smallint NOT NULL,
  [Screen_Row] smallint NOT NULL,
  [Presenter_Identifier] nvarchar(50) NOT NULL,
  [Collapsed_Flag] bit NOT NULL,
  [Max_Column] smallint NOT NULL,
  [Client_Api_Hosted_RecID] int NULL,
  [Enabled_Flag] bit NOT NULL,
  [Pod_Height] int NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Member_Screen_Settings
CREATE TABLE [dbo].[Member_Screen_Settings] (
  [Member_Screen_Settings_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Presenter_Identifier] nvarchar(50) NOT NULL,
  [Num_Columns] int NOT NULL,
  [Left_Column_Width] smallint NOT NULL
);
GO

-- dbo.Member_Type
CREATE TABLE [dbo].[Member_Type] (
  [Member_Type_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Mgmt_It_Log_Type
CREATE TABLE [dbo].[Mgmt_It_Log_Type] (
  [Mgmt_It_Log_Type_RecID] int NOT NULL,
  [Description] nvarchar(255) NOT NULL
);
GO

-- dbo.Mgmt_It_Setup
CREATE TABLE [dbo].[Mgmt_It_Setup] (
  [Mgmt_It_Setup_Recid] int NOT NULL,
  [Mgmt_Server_Url] nvarchar(200) NULL,
  [Mgmt_Server_Url2] nvarchar(200) NULL,
  [Mgmt_Server_Url3] nvarchar(200) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [GlobalLogin_Flag] bit NULL,
  [Username] nvarchar(50) NULL,
  [Password] nvarchar(2000) NULL,
  [UsingSSL_Flag] bit NULL,
  [Mgmt_Solution_Name] nvarchar(30) NULL,
  [Login_ViewState] nvarchar(100) NULL,
  [Mgmt_Setup_Name] nvarchar(30) NULL,
  [NAble_Username] nvarchar(50) NULL,
  [NAble_Password] nvarchar(2000) NULL,
  [Override_WS_Location_Flag] bit NULL,
  [Override_Login_Location_Flag] bit NULL,
  [NAble_Integration_Version] nvarchar(10) NULL,
  [Zenith_Member_Code] nvarchar(100) NULL,
  [Zenith_Api_Password] nvarchar(2000) NULL,
  [Zenith_Api_Username] nvarchar(100) NULL,
  [Custom_Flag] bit NULL,
  [lp_version] nvarchar(20) NULL,
  [Mgmt_Solution_Type_ID] char(1) NULL,
  [Product1_Caption] nvarchar(30) NULL,
  [Product2_Caption] nvarchar(30) NULL,
  [Billing_Level_ID] char(1) NULL,
  [Billing_Level_Flag] bit NULL,
  [Level_Api_Username] nvarchar(100) NULL,
  [level_api_password] nvarchar(2000) NULL,
  [level_var_domain] nvarchar(100) NULL,
  [NoDisplay_Flag] bit NULL,
  [Mgmt_It_Setup_Type_RecID] int NOT NULL,
  [Default_Owner_Level_RecID] int NULL,
  [Default_Billing_Unit_RecID] int NULL,
  [Integration_Login_RecID] int NULL,
  [Match_On_Serial_Number] bit NOT NULL,
  [New_Levels_Disabled] bit NOT NULL,
  [New_Configs_Billable] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Mgmt_It_Setup_Type
CREATE TABLE [dbo].[Mgmt_It_Setup_Type] (
  [Mgmt_It_Setup_Type_RecID] int NOT NULL,
  [Description] nvarchar(255) NOT NULL
);
GO

-- dbo.Mgmt_Os_Grade_Weights
CREATE TABLE [dbo].[Mgmt_Os_Grade_Weights] (
  [Mgmt_Os_Grade_Weights_Recid] int NOT NULL,
  [OS_Type] nvarchar(50) NULL,
  [OS_Grade_Weight] float NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [OS_Name] nvarchar(50) NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Mgmt_Setup
CREATE TABLE [dbo].[Mgmt_Setup] (
  [Mgmt_Setup_RecID] int NOT NULL,
  [Mgmt_Server_URL] nvarchar(200) NULL,
  [WS_Config_RecID] int NULL,
  [Server_Config_RecID] int NULL,
  [Audit_Config_RecID] int NULL,
  [Add_Status_RecID] int NULL,
  [RunTime] datetime NULL,
  [Del_Status_RecID] int NULL,
  [Use_Company_ID_Flag] bit NULL,
  [updated_by] nvarchar(15) NULL,
  [last_update] datetime2(0) NOT NULL,
  [GlobalLogin_Flag] bit NULL,
  [Username] nvarchar(50) NULL,
  [Password] nvarchar(50) NULL,
  [UsingSSL_Flag] bit NULL,
  [WebService_Location] nvarchar(100) NULL,
  [Mgmt_Solution_Name] nvarchar(30) NULL,
  [Login_ViewState] nvarchar(100) NULL,
  [Mgmt_Email_Solution_Name] nvarchar(30) NULL,
  [Mgmt_Email_Config_RecID] int NULL,
  [Mgmt_Email_Organization_ID] nvarchar(30) NULL,
  [Mgmt_Email_Username] nvarchar(50) NULL,
  [Mgmt_Email_Password] nvarchar(50) NULL,
  [SonicWall_Config_Recid] int NULL,
  [Integration_Login_Recid] int NULL,
  [exec_next_run_time] datetime NULL,
  [exec_day_of_month] int NULL,
  [exec_hour_of_day] int NULL,
  [exec_minute_of_hour] int NULL,
  [next_run_time] datetime NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Schedule_Executive_Summary_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Mgmt_Solution_Type
CREATE TABLE [dbo].[Mgmt_Solution_Type] (
  [Mgmt_Solution_Type_ID] char(1) NOT NULL,
  [Mgmt_Type_Description] nvarchar(50) NULL
);
GO

-- dbo.Microsoft_365_Contact_Sync_Monitoring_Type
CREATE TABLE [dbo].[Microsoft_365_Contact_Sync_Monitoring_Type] (
  [Microsoft_365_Contact_Sync_Monitoring_Type_RecID] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Minimum_Stock_By_Warehouse
CREATE TABLE [dbo].[Minimum_Stock_By_Warehouse] (
  [Minimum_Stock_By_Warehouse_RecID] int NOT NULL,
  [IV_Item_RecID] int NOT NULL,
  [Warehouse_RecID] int NOT NULL,
  [Minimum_Stock] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NULL
);
GO

-- dbo.Mobile_Subscriptions
CREATE TABLE [dbo].[Mobile_Subscriptions] (
  [Mobile_Subscription_RecID] int NOT NULL,
  [Member_RecId] int NOT NULL,
  [Subscription_Start] datetime NOT NULL,
  [Subscription_Expires] datetime NOT NULL,
  [RecId] int NOT NULL,
  [Rec_Type] char(2) NOT NULL,
  [Last_Update] datetime NOT NULL,
  [Last_Update_UTC] datetime NOT NULL
);
GO

-- dbo.Module
CREATE TABLE [dbo].[Module] (
  [Module_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Module_ID] char(2) NOT NULL,
  [Role_Security_Table] nvarchar(50) NULL,
  [Role_Table] nvarchar(50) NULL,
  [Last_Update] datetime NOT NULL,
  [Restrict_Flag] bit NOT NULL,
  [Display_Name] nvarchar(50) NULL,
  [Sort_Order] int NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Module_Function
CREATE TABLE [dbo].[Module_Function] (
  [Module_Function_RecID] int NOT NULL,
  [Module_ID] char(2) NULL,
  [Name] nvarchar(10) NULL,
  [Description] nvarchar(50) NULL,
  [myAll_flag] bit NOT NULL,
  [PM_Security_Flag] bit NOT NULL,
  [Module_Function_ID] char(5) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Report_Flag] bit NULL,
  [Restrict_Flag] bit NOT NULL,
  [Display_Module_RecID] int NULL,
  [Custom_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Months
CREATE TABLE [dbo].[Months] (
  [MonthID] int NOT NULL,
  [MonthName] nvarchar(25) NOT NULL
);
GO

-- dbo.Multiline
CREATE TABLE [dbo].[Multiline] (
  [Multiline_RecID] int NOT NULL,
  [Name] nvarchar(255) NOT NULL,
  [Module_Function_RecID] int NULL
);
GO

-- dbo.multiline_autorefresh
CREATE TABLE [dbo].[multiline_autorefresh] (
  [Multiline_AutoRefresh_RecID] int NOT NULL,
  [Multiline_Name] nvarchar(100) NOT NULL,
  [Refresh_Minutes] tinyint NOT NULL,
  [Member_RecID] int NOT NULL
);
GO

-- dbo.Multiline_Column
CREATE TABLE [dbo].[Multiline_Column] (
  [Multiline_Column_RecID] int NOT NULL,
  [Multiline_RecID] int NOT NULL,
  [Member_RecID] int NULL,
  [Name] nvarchar(100) NOT NULL,
  [Caption] nvarchar(50) NOT NULL,
  [Pixel_Width] int NOT NULL,
  [Type] nvarchar(50) NOT NULL,
  [Filter_Text] nvarchar(255) NOT NULL,
  [Icon] nvarchar(255) NOT NULL,
  [Column_Number] int NOT NULL,
  [Filter_Flag] bit NOT NULL,
  [Style] nvarchar(255) NOT NULL,
  [Alignment] nvarchar(10) NOT NULL,
  [Visible_Flag] bit NOT NULL,
  [Sortable_Flag] bit NOT NULL,
  [Editable_Flag] bit NOT NULL,
  [ID_Field] nvarchar(50) NOT NULL,
  [Filter_Type] nvarchar(50) NOT NULL,
  [Clr_Type] nvarchar(50) NOT NULL,
  [View_Function] nvarchar(255) NOT NULL,
  [Max_Display_Length] int NOT NULL,
  [Context_Menu] nvarchar(50) NULL,
  [locale_key_recid] int NULL,
  [custom_caption_key] nvarchar(50) NULL,
  [caption_visible] bit NOT NULL,
  [Resizable_Flag] bit NOT NULL,
  [DB_Field] nvarchar(50) NULL
);
GO

-- dbo.multiline_expression
CREATE TABLE [dbo].[multiline_expression] (
  [Multiline_Expression_RecID] int NOT NULL,
  [Multiline_Name] nvarchar(100) NOT NULL,
  [Name] nvarchar(50) NOT NULL,
  [Member_RecID] int NOT NULL,
  [Expression] nvarchar(max) NOT NULL,
  [Public_Flag] bit NOT NULL,
  [Owner_Locked_Flag] bit NOT NULL,
  [Legacy_View_Flag] bit NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Multiline_Expression_Billing_Unit
CREATE TABLE [dbo].[Multiline_Expression_Billing_Unit] (
  [Multiline_Expression_Billing_Unit_RecID] int NOT NULL,
  [Multiline_Expression_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NOT NULL
);
GO

-- dbo.Multiline_Expression_Default
CREATE TABLE [dbo].[Multiline_Expression_Default] (
  [Multiline_Expression_Default_RecID] int NOT NULL,
  [Multiline_Expression_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL
);
GO

-- dbo.Multiline_Expression_Owner_Level
CREATE TABLE [dbo].[Multiline_Expression_Owner_Level] (
  [Multiline_Expression_Owner_Level_RecID] int NOT NULL,
  [Multiline_Expression_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL
);
GO

-- dbo.Multiline_Expression_SR_Board
CREATE TABLE [dbo].[Multiline_Expression_SR_Board] (
  [Multiline_Expression_SR_Board_RecID] int NOT NULL,
  [Multiline_Expression_RecID] int NOT NULL,
  [SR_Board_RecID] int NOT NULL
);
GO

-- dbo.Multiline_Expression_SR_Team
CREATE TABLE [dbo].[Multiline_Expression_SR_Team] (
  [Multiline_Expression_SR_Team_RecID] int NOT NULL,
  [Multiline_Expression_RecID] int NOT NULL,
  [SR_Team_RecID] int NOT NULL
);
GO

-- dbo.Multiline_Property
CREATE TABLE [dbo].[Multiline_Property] (
  [Multiline_Property_RecID] int NOT NULL,
  [Multiline_RecID] int NOT NULL,
  [Member_RecID] int NULL,
  [Auto_Refresh_Flag] int NOT NULL,
  [Auto_Load_Flag] bit NOT NULL,
  [Page_Max_Result] int NOT NULL,
  [On_Open_Refresh_Flag] bit NOT NULL,
  [Sort_Direction] nvarchar(50) NULL,
  [Sort_Field] nvarchar(50) NULL,
  [Single_Record_Auto_Load_Flag] bit NOT NULL
);
GO

-- dbo.Multiline_Toolbar
CREATE TABLE [dbo].[Multiline_Toolbar] (
  [Multiline_Toolbar_RecID] int NOT NULL,
  [Multiline_RecID] int NOT NULL,
  [Icon] nvarchar(255) NOT NULL,
  [Caption] nvarchar(255) NOT NULL,
  [Tooltip] nvarchar(255) NOT NULL,
  [Field_Id] nvarchar(255) NOT NULL,
  [Sort_Order] int NULL
);
GO

-- dbo.My_Report
CREATE TABLE [dbo].[My_Report] (
  [My_Report_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [My_Report_Name] nvarchar(200) NOT NULL,
  [System_Reports_RecID] int NOT NULL,
  [TodayPage_Flag] bit NOT NULL,
  [Schedule_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.My_Report_Parameter_Value
CREATE TABLE [dbo].[My_Report_Parameter_Value] (
  [My_Report_Parameter_Value_RecID] int NOT NULL,
  [My_Report_RecID] int NOT NULL,
  [system_report_field_recid] int NOT NULL,
  [system_report_field_value] nvarchar(200) NULL
);
GO

-- dbo.Nable_Machine_Type
CREATE TABLE [dbo].[Nable_Machine_Type] (
  [Nable_Machine_Type_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Device_Class] char(1) NULL
);
GO

-- dbo.Note_Type
CREATE TABLE [dbo].[Note_Type] (
  [Note_Type_ID] nvarchar(15) NOT NULL,
  [Note_Type_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Import_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Office_365_Application
CREATE TABLE [dbo].[Office_365_Application] (
  [Office_365_Application_RecID] int NOT NULL,
  [Type] nvarchar(50) NOT NULL,
  [Tenant_ID] nvarchar(4000) NULL,
  [Client_ID] nvarchar(36) NULL,
  [Client_Secret] nvarchar(4000) NULL,
  [Token] nvarchar(100) NULL,
  [Token_Expiration_UTC] datetime2(0) NULL,
  [Token_Entered_By] nvarchar(15) NULL,
  [Authorized_Flag] bit NOT NULL,
  [Date_Authorized_UTC] datetime2(0) NULL,
  [Authorized_By] nvarchar(15) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Office_365_Email_Setup
CREATE TABLE [dbo].[Office_365_Email_Setup] (
  [Office_365_Email_Setup_RecID] int NOT NULL,
  [Name] nvarchar(200) NOT NULL,
  [Username] nvarchar(100) NULL,
  [Inbox_Folder] nvarchar(40) NOT NULL,
  [Processed_Folder] nvarchar(40) NOT NULL,
  [Failed_Folder] nvarchar(40) NOT NULL,
  [Office_365_Application_RecID] int NOT NULL,
  [Exchange_Robot_RecID] int NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Source] tinyint NOT NULL,
  [UseExistingTenant_Flag] bit NOT NULL,
  [ExistingTenant] nvarchar(100) NULL,
  [Inactive_Flag] bit NOT NULL
);
GO

-- dbo.Office_Calendar
CREATE TABLE [dbo].[Office_Calendar] (
  [Office_Calendar_RecID] int NOT NULL,
  [Holiday_List_RecID] int NULL,
  [Sunday_Start] time(0) NULL,
  [Sunday_End] time(0) NULL,
  [Monday_Start] time(0) NULL,
  [Monday_End] time(0) NULL,
  [Tuesday_Start] time(0) NULL,
  [Tuesday_End] time(0) NULL,
  [Wednesday_Start] time(0) NULL,
  [Wednesday_End] time(0) NULL,
  [Thursday_Start] time(0) NULL,
  [Thursday_End] time(0) NULL,
  [Friday_Start] time(0) NULL,
  [Friday_End] time(0) NULL,
  [Saturday_Start] time(0) NULL,
  [Saturday_End] time(0) NULL,
  [Description] nvarchar(50) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Created_By] nvarchar(30) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Office_Calendar_Working_Days
CREATE TABLE [dbo].[Office_Calendar_Working_Days] (
  [Office_Calendar_RecID] int NOT NULL,
  [Office_Calendar_Date] date NOT NULL,
  [Time_Start] time(0) NULL,
  [Time_End] time(0) NULL,
  [NW_Flag] int NOT NULL,
  [Shift_Order] smallint NOT NULL,
  [Hours] float NULL
);
GO

-- dbo.Order_Header
CREATE TABLE [dbo].[Order_Header] (
  [Order_Header_RecID] int NOT NULL,
  [Order_Date] datetime NULL,
  [Order_Due_Date] datetime NULL,
  [Purchase_Order_Number] nvarchar(50) NULL,
  [Tax_Code_RecID] int NULL,
  [Company_RecID] int NOT NULL,
  [Billing_Terms_RecID] int NULL,
  [Customer_Drop_Shipment] bit NOT NULL,
  [Company_Address_RecID] int NULL,
  [Billed] bit NOT NULL,
  [Entered_By] nvarchar(36) NULL,
  [Opportunity_RecID] int NULL,
  [Member_RecID] int NOT NULL,
  [Last_Update] datetime NULL,
  [Updated_By] nvarchar(15) NULL,
  [Contact_Recid] int NULL,
  [Description] nvarchar(max) NULL,
  [Top_Comment_Flag] bit NOT NULL,
  [Bottom_Comment_Flag] bit NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [ShipmentMethod_RecID] int NULL,
  [Order_Status_RecID] int NOT NULL,
  [Invoiced] bit NOT NULL,
  [Total] decimal(18,2) NULL,
  [Internal_Notes] nvarchar(max) NULL,
  [SO_BillClosed_Flag] bit NOT NULL,
  [SO_BillShipped_Flag] bit NOT NULL,
  [Save_Guid] uniqueidentifier NULL,
  [Shipped_In_Full] bit NOT NULL,
  [Restrict_Downpayment_Flag] bit NOT NULL,
  [Ship_To_Company_RecID] int NULL,
  [Ship_To_Contact_RecID] int NULL,
  [Ship_To_Company_Address_RecID] int NULL,
  [Bill_To_Company_RecID] int NULL,
  [Bill_To_Contact_RecID] int NULL,
  [Bill_To_Company_Address_RecID] int NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Userfield_1] nvarchar(50) NULL,
  [Userfield_2] nvarchar(50) NULL,
  [Userfield_3] nvarchar(50) NULL,
  [Userfield_4] nvarchar(50) NULL,
  [Userfield_5] nvarchar(50) NULL,
  [Userfield_6] nvarchar(50) NULL,
  [Userfield_7] nvarchar(50) NULL,
  [Userfield_8] nvarchar(50) NULL,
  [Userfield_9] nvarchar(50) NULL,
  [Userfield_10] nvarchar(50) NULL,
  [Tax_Total] decimal(18,2) NOT NULL,
  [Notification_History] nvarchar(4000) NOT NULL,
  [Currency_RecID] int NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Order_Header_Audit
CREATE TABLE [dbo].[Order_Header_Audit] (
  [Order_Header_Audit_RecID] int NOT NULL,
  [Order_Header_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Order_Header_Audit_Value
CREATE TABLE [dbo].[Order_Header_Audit_Value] (
  [Order_Header_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(50) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(max) NOT NULL,
  [Order_Header_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Order_Header_Tax
CREATE TABLE [dbo].[Order_Header_Tax] (
  [Order_Header_Tax_RecID] int NOT NULL,
  [Order_Header_RecID] int NOT NULL,
  [Tax_Level] tinyint NOT NULL,
  [Tax_Amount] decimal(18,2) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Order_Status
CREATE TABLE [dbo].[Order_Status] (
  [Order_Status_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NOT NULL,
  [Closed_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Sort_Order] smallint NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Order_Workflow
CREATE TABLE [dbo].[Order_Workflow] (
  [Order_Workflow_RecID] int NOT NULL,
  [Order_Status_RecID] int NULL,
  [Workflow_Step] int NULL,
  [WF_NotifyWhoID] nvarchar(2) NULL,
  [Member_RecID] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Specific_Email] nvarchar(50) NULL,
  [POS_Flag] bit NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Owner
CREATE TABLE [dbo].[Owner] (
  [Owner_ID] int NOT NULL,
  [Company_RecID] int NULL,
  [Company_Name] nvarchar(50) NULL,
  [Company_AutoComplete_Flag] bit NOT NULL,
  [Today_Title] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Company_ID_Flag] bit NOT NULL,
  [Hours_Round] decimal(18,2) NULL,
  [Company_Level] smallint NULL,
  [Nbr_of_Levels] smallint NULL,
  [Billing_Level] smallint NULL,
  [Owner_Level_1] nvarchar(20) NULL,
  [Owner_Level_2] nvarchar(20) NULL,
  [Owner_Level_3] nvarchar(20) NULL,
  [Owner_Level_4] nvarchar(20) NULL,
  [Owner_Level_5] nvarchar(20) NULL,
  [Sales_Module_Flag] bit NOT NULL,
  [Service_Module_Flag] bit NOT NULL,
  [Project_Module_Flag] bit NOT NULL,
  [Contract_Module_Flag] bit NOT NULL,
  [Time_Module_Flag] bit NOT NULL,
  [Billable_Flag] bit NOT NULL,
  [Company_Userfield_1] nvarchar(25) NULL,
  [Company_Userfield_2] nvarchar(25) NULL,
  [Company_Userfield_3] nvarchar(25) NULL,
  [Company_Userfield_4] nvarchar(25) NULL,
  [Company_Userfield_5] nvarchar(25) NULL,
  [Company_Userfield_6] nvarchar(25) NULL,
  [Company_Userfield_7] nvarchar(25) NULL,
  [Company_Userfield_8] nvarchar(25) NULL,
  [Company_Userfield_9] nvarchar(25) NULL,
  [Company_Userfield_10] nvarchar(25) NULL,
  [DM_UNC_Path] nvarchar(100) NULL,
  [ConnectSync] bit NOT NULL,
  [Company_Link] nvarchar(50) NULL,
  [User_Count] nvarchar(50) NULL,
  [Funnel_Decimals] int NULL,
  [OfficeIntegration] bit NOT NULL,
  [TemplatePath] nvarchar(200) NULL,
  [TemplateOutputDir] nvarchar(200) NULL,
  [Time_24hr_Flag] bit NOT NULL,
  [Currency_RecID] int NOT NULL,
  [Company_Dropdown] smallint NULL,
  [TE_Approval1_Flag] bit NOT NULL,
  [TE_Approval2_Flag] bit NOT NULL,
  [TE_Billing_Unit_Flag] bit NOT NULL,
  [Time_Entry_Screen] nvarchar(10) NULL,
  [BR_Option] char(1) NULL,
  [GL_Segments] smallint NULL,
  [GL_Interface_ID] nvarchar(10) NULL,
  [Custom_Images] nvarchar(200) NULL,
  [ContactSync_Option_ID] int NULL,
  [Company_Screen_Option] smallint NULL,
  [Company_Activity_Option] smallint NULL,
  [SR_Signoff_Text] nvarchar(4000) NULL,
  [pm_number_flag] bit NULL,
  [import_lead_flag] bit NULL,
  [outlooksync_location] nvarchar(200) NULL,
  [SR_SignoffRates_Flag] bit NULL,
  [SR_SignoffLocked_Flag] bit NULL,
  [SR_SignoffPay_Flag] bit NULL,
  [DefaultNotifyFrom] nvarchar(50) NULL,
  [psa_site_url] nvarchar(100) NULL,
  [customer_portal_url_override] nvarchar(100) NULL,
  [include_portal_link_flag] bit NULL,
  [SR_StartEnd_Flag] bit NULL,
  [Controller] int NULL,
  [COO] int NULL,
  [President] int NULL,
  [Dispatch] int NULL,
  [ServiceManager] int NULL,
  [DutyManager] int NULL,
  [version_level] smallint NULL,
  [doc_link] nvarchar(1024) NULL,
  [DM_Link_Flag] bit NULL,
  [Options] nvarchar(50) NULL,
  [SR_Notify] char(1) NULL,
  [ppc_key] nvarchar(50) NULL,
  [SR_NewTime_Flag] bit NULL,
  [SR_UpdateTime_Flag] bit NULL,
  [SR_TopResolution_Flag] bit NULL,
  [Time_Zone_RecID] int NULL,
  [Fiscal_Start] smallint NULL,
  [SO_ProbLock_Flag] bit NULL,
  [Time_Tab_Option] smallint NULL,
  [Exchange_Server] nvarchar(500) NULL,
  [SR_NewTimeDesc_Flag] bit NOT NULL,
  [SR_UpdateTimeDesc_Flag] bit NOT NULL,
  [network_agreement_accepted] bit NOT NULL,
  [network_agreement_accepted_datetime] datetime2(0) NULL,
  [network_agreement_accepted_member_id] nvarchar(15) NULL,
  [client_agreement_accepted] bit NOT NULL,
  [client_agreement_accepted_datetime] datetime2(0) NULL,
  [client_agreement_accepted_member_id] nvarchar(15) NULL,
  [subcontractor_agreement_accepted] bit NOT NULL,
  [subcontractor_agreement_accepted_datetime] datetime2(0) NULL,
  [subcontractor_agreement_accepted_member_id] nvarchar(15) NULL,
  [IV_Costing_Method_RecID] int NOT NULL,
  [PO_PreSuf_Flag] bit NULL,
  [PO_AutoClose_Flag] bit NULL,
  [PO_AutoCloseLine_Flag] bit NULL,
  [PO_PreSuf] nvarchar(5) NULL,
  [PO_Start_Number] int NOT NULL,
  [PO_AutoApprove_Flag] bit NULL,
  [Reporting_Services_URL] nvarchar(100) NULL,
  [Reporting_Services_Username] nvarchar(50) NULL,
  [Reporting_Services_Password] nvarchar(2000) NULL,
  [Reporting_Services_Domain] nvarchar(50) NULL,
  [Schedule_Span_RecID] int NULL,
  [C_Partner_Token] uniqueidentifier NULL,
  [SR_Header_Color] nvarchar(6) NULL,
  [SR_Member_Color] nvarchar(6) NULL,
  [SR_Contact_Color] nvarchar(6) NULL,
  [SR_Unknown_Color] nvarchar(6) NULL,
  [SR_Delimiter] nvarchar(100) NULL,
  [DM_Public_Flag] bit NOT NULL,
  [TE_NoFutureRecords_Flag] bit NOT NULL,
  [Hide_Delimiter_Flag] bit NOT NULL,
  [User_Language] nvarchar(10) NULL,
  [Add_CC_Flag] bit NOT NULL,
  [Disable_Update_Cost_Flag] bit NOT NULL,
  [Reason_Te_Flag] bit NOT NULL,
  [Reason_Ex_Flag] bit NOT NULL,
  [No_Negative_Inventory_Flag] bit NOT NULL,
  [Company_Id_Auto_Generation_Enabled] bit NOT NULL,
  [Company_Id_Auto_Generation_Exclude_Space] bit NOT NULL,
  [Tax_Purchase_Order_Flag] bit NOT NULL,
  [Tax_Freight_Flag] bit NOT NULL,
  [Vendor_Tax_Default_Flag] bit NOT NULL,
  [Sales_Year_End_Default_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [GL_Cogs] smallint NOT NULL,
  [Add_TO_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Date_Entered_UTC] datetime NULL,
  [Disable_AutoPick_Flag] bit NOT NULL,
  [Sessions_Limit] nvarchar(50) NULL,
  [Mobile_Sessions_Limit] nvarchar(50) NULL,
  [Default_Product_Taxable_Flag] bit NOT NULL,
  [Default_Special_Invoice_Billing_Type_ID] char(1) NULL,
  [EORI_Number] nvarchar(50) NULL,
  [Core_Entity_Level1_ID] uniqueidentifier NULL,
  [Core_Entity_Level2_ID] uniqueidentifier NULL,
  [Core_Entity_Level3_ID] uniqueidentifier NULL,
  [Core_Entity_Level4_ID] uniqueidentifier NULL,
  [Core_Entity_Level5_ID] uniqueidentifier NULL,
  [Core_Entity_Level1_Updated_By] nvarchar(15) NULL,
  [Core_Entity_Level2_Updated_By] nvarchar(15) NULL,
  [Core_Entity_Level3_Updated_By] nvarchar(15) NULL,
  [Core_Entity_Level4_Updated_By] nvarchar(15) NULL,
  [Core_Entity_Level5_Updated_By] nvarchar(15) NULL,
  [Core_Entity_Level1_Last_Update_UTC] datetime2(0) NULL,
  [Core_Entity_Level2_Last_Update_UTC] datetime2(0) NULL,
  [Core_Entity_Level3_Last_Update_UTC] datetime2(0) NULL,
  [Core_Entity_Level4_Last_Update_UTC] datetime2(0) NULL,
  [Core_Entity_Level5_Last_Update_UTC] datetime2(0) NULL,
  [Notification_For_Changes_In_Shipping_Info_Flag] bit NOT NULL,
  [Shipping_Info_Notification_Email] nvarchar(250) NULL
);
GO

-- dbo.Owner_Extended_Property
CREATE TABLE [dbo].[Owner_Extended_Property] (
  [Owner_Extended_Property_RecID] int NOT NULL,
  [Name] nvarchar(100) NOT NULL,
  [Default_Value] nvarchar(100) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Owner_Extended_Property_Value
CREATE TABLE [dbo].[Owner_Extended_Property_Value] (
  [Owner_Extended_Property_Value_RecID] int NOT NULL,
  [Owner_Extended_Property_RecID] int NOT NULL,
  [Value] nvarchar(100) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Owner_Level
CREATE TABLE [dbo].[Owner_Level] (
  [Owner_Level_RecID] int NOT NULL,
  [Owner_Level_ID] smallint NOT NULL,
  [Owner_Level_Name] nvarchar(50) NULL,
  [Description] nvarchar(50) NULL,
  [Member_ID] nvarchar(15) NULL,
  [Notify_Flag] bit NOT NULL,
  [Reports_To_RecID] int NULL,
  [Sales_Territory_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Xref_ID] nvarchar(10) NULL,
  [Location_Flag] bit NULL,
  [SalesRep_ID] nvarchar(50) NULL,
  [OL_Address_Line1] nvarchar(50) NULL,
  [OL_Address_Line2] nvarchar(50) NULL,
  [OL_City] nvarchar(50) NULL,
  [OL_State_ID] nvarchar(50) NULL,
  [OL_Zip] nvarchar(12) NULL,
  [OL_PhoneNbr] nvarchar(15) NULL,
  [OL_Phonenbr_Fax] nvarchar(15) NULL,
  [client_flag] bit NOT NULL,
  [OWA_Link] nvarchar(100) NULL,
  [OL_Country_RecID] int NULL,
  [time_zone_recid] int NULL,
  [Office_Calendar_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Ava_Validated_Flag] bit NOT NULL,
  [Core_Entity_ID] uniqueidentifier NULL,
  [Core_Entity_Updated_By] nvarchar(15) NULL,
  [Core_Entity_Last_Update_UTC] datetime2(0) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Ownership_Type
CREATE TABLE [dbo].[Ownership_Type] (
  [Ownership_Type_RecID] int NOT NULL,
  [Description] nvarchar(200) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Parameter_Days
CREATE TABLE [dbo].[Parameter_Days] (
  [Parameter_Days_RecID] int NOT NULL,
  [Parameter_Days] int NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.Payment_Sources
CREATE TABLE [dbo].[Payment_Sources] (
  [Payment_Source_RecID] tinyint NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Last_Update_UTC] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Percentage_Calculation
CREATE TABLE [dbo].[Percentage_Calculation] (
  [Percentage_Calculation_RecID] int NOT NULL,
  [Percentage_Calculation_ID] nchar(1) NOT NULL,
  [Locale_Key_RecID] int NOT NULL
);
GO

-- dbo.Persona
CREATE TABLE [dbo].[Persona] (
  [Persona_RecID] int NOT NULL,
  [Description] nvarchar(20) NOT NULL,
  [Locale_Text_Key] nvarchar(40) NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Phase_Status
CREATE TABLE [dbo].[Phase_Status] (
  [Phase_Status_RecID] int NOT NULL,
  [Description] nvarchar(30) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Closed_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Created_UTC] datetime2(0) NOT NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Collapsed_Flag] bit NOT NULL,
  [Status_Indicator_RecID] int NULL,
  [Custom_Status_Indicator_Description] nvarchar(30) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Phase_Status_Project_Board
CREATE TABLE [dbo].[Phase_Status_Project_Board] (
  [Phase_Status_Project_Board_RecID] int NOT NULL,
  [Phase_Status_RecID] int NOT NULL,
  [Project_Board_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.PM_Billing_Method
CREATE TABLE [dbo].[PM_Billing_Method] (
  [PM_Billing_Method_RecID] int NOT NULL,
  [PM_Billing_Method_ID] char(1) NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NOT NULL,
  [Override_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.PM_Contact
CREATE TABLE [dbo].[PM_Contact] (
  [PM_Contact_RecID] int NOT NULL,
  [PM_Project_RecID] int NULL,
  [Seq_Nbr] int NULL,
  [Contact_RecID] int NULL,
  [PM_Role_RecID] int NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.PM_Note
CREATE TABLE [dbo].[PM_Note] (
  [PM_Note_RecID] int NOT NULL,
  [PM_Project_RecID] int NULL,
  [Seq_Nbr] int NULL,
  [Note_Type_RecID] int NULL,
  [Notes] nvarchar(max) NULL,
  [Red_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.PM_Phase
CREATE TABLE [dbo].[PM_Phase] (
  [PM_Phase_RecID] int NOT NULL,
  [Parent_Phase_RecID] int NULL,
  [Updated_By] nvarchar(15) NULL,
  [PM_Project_RecID] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Notes] nvarchar(max) NULL,
  [Entered_By_RecID] int NULL,
  [WBS_Code] nvarchar(50) NULL,
  [Milestone_Flag] bit NOT NULL,
  [Add_On_Flag] bit NOT NULL,
  [Date_Deadline] datetime NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [SR_Board_RecID] int NOT NULL,
  [PO_Amount] decimal(18,2) NOT NULL,
  [PO_Number] nvarchar(50) NULL,
  [Est_Revenue] decimal(18,2) NOT NULL,
  [AGR_Header_RecID] int NULL,
  [AGR_Amount] decimal(18,2) NOT NULL,
  [AGR_Month] smallint NULL,
  [AGR_Year] smallint NULL,
  [SR_Billing_Method_ID] char(1) NOT NULL,
  [TimeBillable_Flag] bit NULL,
  [ExpBillable_Flag] bit NULL,
  [ProdBillable_Flag] bit NULL,
  [TimeInvoice_Flag] bit NULL,
  [ExpInvoice_Flag] bit NULL,
  [ProdInvoice_Flag] bit NULL,
  [Billing_Amount] decimal(18,2) NULL,
  [Override_Flag] bit NOT NULL,
  [TopLevel_Phase_RecID] int NULL,
  [Opportunity_RecID] int NULL,
  [Phase_Status_RecID] int NOT NULL,
  [Billing_Start_UTC] datetime NULL,
  [Est_Time_Cost] decimal(18,2) NOT NULL,
  [Est_Product_Cost] decimal(18,2) NOT NULL,
  [Est_Expense_Cost] decimal(18,2) NOT NULL,
  [Est_Product_Revenue] decimal(18,2) NOT NULL,
  [Est_Expense_Revenue] decimal(18,2) NOT NULL,
  [BillComplete_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [BillProjectComplete_Flag] bit NOT NULL,
  [Billing_Company_RecID] int NULL,
  [Billing_Contact_RecID] int NULL,
  [Billing_Address_RecID] int NULL,
  [Billing_Terms_RecID] int NULL,
  [Tax_Code_RecID] int NULL,
  [Shipping_Company_RecID] int NULL,
  [Shipping_Address_RecID] int NULL,
  [Shipping_Contact_RecID] int NULL,
  [Currency_RecID] int NOT NULL,
  [Id] uniqueidentifier NULL,
  [Billing_Log_RecID] int NULL
);
GO

-- dbo.PM_Phase_Fixed_Fee_IW
CREATE TABLE [dbo].[PM_Phase_Fixed_Fee_IW] (
  [PM_Phase_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Company_OL_RecID] int NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [PM_Project_RecID] int NULL,
  [Inv_Amount] decimal(18,6) NOT NULL,
  [Rec_Date] datetime NULL,
  [Tax_RecID] int NULL,
  [Tax_Desc] nvarchar(50) NULL,
  [Billing_Start_Date] datetime NULL,
  [AGR_Amount] decimal(18,6) NOT NULL,
  [Customer_PO] nvarchar(50) NULL,
  [Shipping_Address_RecID] int NULL,
  [Shipping_Company_RecID] int NULL,
  [Iso_Code] nvarchar(3) NULL,
  [Currency_RecID] int NOT NULL
);
GO

-- dbo.PM_Portal_Config
CREATE TABLE [dbo].[PM_Portal_Config] (
  [PM_Portal_Config_RecID] int NOT NULL,
  [Billing_Method_Flag] bit NOT NULL,
  [Project_Type_Flag] bit NOT NULL,
  [Status_Flag] bit NOT NULL,
  [Project_Manager_Flag] bit NOT NULL,
  [Contact_Flag] bit NOT NULL,
  [Estimated_Start_Flag] bit NOT NULL,
  [Estimated_End_Flag] bit NOT NULL,
  [Description_Flag] bit NOT NULL,
  [TM_Budget_Hrs_Flag] bit NOT NULL,
  [TM_Scheduled_Start_Flag] bit NOT NULL,
  [TM_Scheduled_Finish_Flag] bit NOT NULL,
  [TM_Scheduled_Hrs_Flag] bit NOT NULL,
  [TM_Actual_Start_Flag] bit NOT NULL,
  [TM_Actual_Finish_Flag] bit NOT NULL,
  [TM_Actual_Hrs_Flag] bit NOT NULL,
  [TM_Bill_Flag] bit NOT NULL,
  [TM_Status_Flag] bit NOT NULL,
  [TM_Assigned_Flag] bit NOT NULL,
  [FF_Budget_Hrs_Flag] bit NOT NULL,
  [FF_Scheduled_Start_Flag] bit NOT NULL,
  [FF_Scheduled_Finish_Flag] bit NOT NULL,
  [FF_Scheduled_Hrs_Flag] bit NOT NULL,
  [FF_Actual_Start_Flag] bit NOT NULL,
  [FF_Actual_Finish_Flag] bit NOT NULL,
  [FF_Actual_Hrs_Flag] bit NOT NULL,
  [FF_Bill_Flag] bit NOT NULL,
  [FF_Status_Flag] bit NOT NULL,
  [FF_Assigned_Flag] bit NOT NULL,
  [Portal_Option_ID] smallint NOT NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Portal_Config_RecID] int NULL,
  [PI_Budget_Hrs_Flag] bit NOT NULL,
  [PI_Scheduled_Start_Flag] bit NOT NULL,
  [PI_Scheduled_Finish_Flag] bit NOT NULL,
  [PI_Scheduled_Hrs_Flag] bit NOT NULL,
  [PI_Actual_Start_Flag] bit NOT NULL,
  [PI_Actual_Finish_Flag] bit NOT NULL,
  [PI_Actual_Hrs_Flag] bit NOT NULL,
  [PI_Bill_Flag] bit NOT NULL,
  [PI_Status_Flag] bit NOT NULL,
  [PI_Assigned_Flag] bit NOT NULL,
  [Project_Name_Flag] bit NOT NULL,
  [Last_Updated_Flag] bit NOT NULL,
  [PD_Total_Hrs_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.PM_Project
CREATE TABLE [dbo].[PM_Project] (
  [PM_Project_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Project_ID] nvarchar(100) NOT NULL,
  [Member_ID] nvarchar(15) NOT NULL,
  [Notes] nvarchar(max) NULL,
  [Date_Start] date NOT NULL,
  [Date_Req] date NOT NULL,
  [Closed_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [contact_recid] int NULL,
  [company_address_recid] int NULL,
  [Downpayment] decimal(18,2) NOT NULL,
  [Billing_Amount] decimal(18,2) NOT NULL,
  [PM_Billing_Method_ID] char(1) NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [Billable_Flag] bit NOT NULL,
  [Est_Revenue] decimal(18,2) NOT NULL,
  [Billing_Reference] nvarchar(50) NULL,
  [PM_Type_RecID] int NULL,
  [PM_Status_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Opportunity_RecID] int NULL,
  [Est_Hours] decimal(18,2) NULL,
  [Budget_Flag] bit NOT NULL,
  [Time_Approver_ID] nvarchar(15) NULL,
  [Exp_Approver_ID] nvarchar(15) NULL,
  [Billing_Company_RecID] int NULL,
  [Billing_Address_RecID] int NULL,
  [Billing_Contact_RecID] int NULL,
  [Billing_Attention] nvarchar(50) NULL,
  [Exp_Billable_Flag] bit NOT NULL,
  [PO_Amount] decimal(18,2) NULL,
  [restrict_dp_flag] bit NOT NULL,
  [BillComplete_Flag] bit NOT NULL,
  [Invoice_Flag] bit NOT NULL,
  [Exp_Invoice_Flag] bit NOT NULL,
  [Prod_Invoice_Flag] bit NOT NULL,
  [Prod_Billable_Flag] bit NOT NULL,
  [Override_Flag] bit NOT NULL,
  [AGR_Header_RecID] int NULL,
  [AGR_Amount] decimal(18,2) NOT NULL,
  [AGR_Month] smallint NULL,
  [AGR_Year] smallint NULL,
  [BillUnApp_Flag] bit NOT NULL,
  [SR_Board_RecID] int NOT NULL,
  [Order_Header_RecID] int NULL,
  [Notification_History] nvarchar(max) NOT NULL,
  [Portal_Flag] bit NOT NULL,
  [Billing_Start_UTC] datetime2(0) NULL,
  [Est_Time_Cost] decimal(18,2) NOT NULL,
  [Est_Product_Cost] decimal(18,2) NOT NULL,
  [Est_Expense_Cost] decimal(18,2) NOT NULL,
  [Est_Product_Revenue] decimal(18,2) NOT NULL,
  [Est_Expense_Revenue] decimal(18,2) NOT NULL,
  [Billing_Rate_Type] nvarchar(15) NOT NULL,
  [Budget_Analysis_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Date_Closed_UTC] datetime2(0) NULL,
  [Created_By] nvarchar(20) NOT NULL,
  [Show_Dependencies] bit NOT NULL,
  [Show_Estimates] bit NOT NULL,
  [Shipping_Company_RecID] int NULL,
  [Shipping_Address_RecID] int NULL,
  [Shipping_Contact_RecID] int NULL,
  [Billing_Terms_RecID] int NULL,
  [Tax_Code_RecID] int NULL,
  [Currency_RecID] int NOT NULL,
  [Percent_Complete] decimal(5,4) NULL,
  [Override_Percent_Complete] bit NOT NULL,
  [Id] uniqueidentifier NULL,
  [Billing_Log_RecID] int NULL
);
GO

-- dbo.PM_Project_Audit
CREATE TABLE [dbo].[PM_Project_Audit] (
  [PM_Project_Audit_RecID] int NOT NULL,
  [PM_Project_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.PM_Project_Audit_Value
CREATE TABLE [dbo].[PM_Project_Audit_Value] (
  [PM_Project_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(50) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(max) NOT NULL,
  [PM_Project_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.PM_Project_Fixed_Fee_IW
CREATE TABLE [dbo].[PM_Project_Fixed_Fee_IW] (
  [PM_Project_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Company_OL_RecID] int NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [Inv_Amount] decimal(18,6) NOT NULL,
  [Rec_Date] datetime NULL,
  [Tax_RecID] int NULL,
  [Tax_Desc] nvarchar(50) NULL,
  [Billing_Start_Date] datetime NULL,
  [Company_Address_RecID] int NULL,
  [AGR_Amount] decimal(18,6) NOT NULL,
  [Customer_PO] nvarchar(50) NULL,
  [Shipping_Address_RecID] int NULL,
  [Shipping_Company_RecID] int NULL,
  [Iso_Code] nvarchar(3) NULL,
  [Currency_RecID] int NOT NULL
);
GO

-- dbo.PM_Role
CREATE TABLE [dbo].[PM_Role] (
  [PM_Role_RecID] int NOT NULL,
  [PM_Role_ID] nvarchar(30) NULL,
  [Manager_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Default_Contact_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.PM_Role_Security
CREATE TABLE [dbo].[PM_Role_Security] (
  [PM_Role_Security_RecID] int NOT NULL,
  [PM_Role_RecID] int NOT NULL,
  [PM_Add_Level] smallint NULL,
  [PM_Edit_Level] smallint NULL,
  [PM_Delete_Level] smallint NULL,
  [PM_Inquire_Level] smallint NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Module_Function_Recid] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.PM_Status
CREATE TABLE [dbo].[PM_Status] (
  [PM_Status_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Default_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [No_Time_Flag] bit NOT NULL,
  [Closed_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Status_Indicator_RecID] int NULL,
  [Custom_Status_Indicator_Description] nvarchar(30) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.PM_Team
CREATE TABLE [dbo].[PM_Team] (
  [PM_Team_RecID] int NOT NULL,
  [PM_Project_RecID] int NULL,
  [Team_Flag] bit NOT NULL,
  [RecID] int NULL,
  [Description] nvarchar(50) NULL,
  [PM_Role_RecID] int NULL,
  [Seq_Nbr] int NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Member_ID] nvarchar(15) NULL,
  [Activity_Class_RecID] int NULL,
  [Hours_Est] decimal(18,2) NULL,
  [Date_Est_Start] datetime NULL,
  [Date_Est_End] datetime NULL,
  [Hourly_Rate] decimal(18,2) NULL,
  [DB_Timestamp] timestamp NOT NULL,
  [Date_Created_UTC] datetime NULL,
  [Created_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime NOT NULL
);
GO

-- dbo.PM_Tmp_Activity
CREATE TABLE [dbo].[PM_Tmp_Activity] (
  [PM_Tmp_Activity_RecID] int NOT NULL,
  [PM_Tmp_Phase_RecID] int NULL,
  [Line_Number] decimal(18,2) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Description] nvarchar(100) NULL,
  [Notes] nvarchar(max) NULL,
  [Hours_Budget] decimal(18,2) NULL,
  [Duration] int NULL,
  [Activity_Class_RecID] int NULL,
  [WBS_Code] nvarchar(50) NULL,
  [Rec_Type] char(1) NULL,
  [Add_On_Flag] bit NOT NULL,
  [Milestone_Flag] bit NOT NULL,
  [PM_Tmp_Project_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [SR_Urgency_RecID] int NULL,
  [SR_Source_RecID] int NULL,
  [Resolution] nvarchar(max) NULL,
  [Internal_Analysis] nvarchar(max) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.PM_Tmp_Project
CREATE TABLE [dbo].[PM_Tmp_Project] (
  [PM_Tmp_Project_RecID] int NOT NULL,
  [Template_Name] nvarchar(100) NULL,
  [Notes] nvarchar(max) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [PM_Type_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.PM_Tmp_Task
CREATE TABLE [dbo].[PM_Tmp_Task] (
  [PM_Tmp_Task_RecID] int NOT NULL,
  [PM_Tmp_Activity_RecID] int NOT NULL,
  [Priority] int NULL,
  [Description] nvarchar(max) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NULL,
  [SR_Code_RecID] int NULL,
  [Summary] nvarchar(max) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.PM_Type
CREATE TABLE [dbo].[PM_Type] (
  [PM_Type_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Default_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.PM_WBSSequence
CREATE TABLE [dbo].[PM_WBSSequence] (
  [PM_WBSSequence_RecId] int NOT NULL,
  [WBSProjectSequence] int NOT NULL,
  [PM_Project_RecID] int NOT NULL,
  [SR_Service_RecID] int NULL,
  [PM_Phase_RecID] int NULL,
  [WBS_Code] nvarchar(50) NOT NULL
);
GO

-- dbo.Pod
CREATE TABLE [dbo].[Pod] (
  [Pod_RecID] int NOT NULL,
  [PodID] nvarchar(50) NOT NULL,
  [ScreenID] nvarchar(50) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Value_Table_Name] nvarchar(50) NULL,
  [Module_Recid] int NULL,
  [Module_Function_Recid] int NULL,
  [User_Defined_Field_Flag] bit NOT NULL,
  [Client_Module_Identifier_RecID] int NULL,
  [Has_Location_And_Billing_Unit_Flag] bit NOT NULL
);
GO

-- dbo.Pod_Presenter_Identifier
CREATE TABLE [dbo].[Pod_Presenter_Identifier] (
  [Pod_Presenter_Identifier_RecID] int NOT NULL,
  [Pod_RecID] int NOT NULL,
  [Presenter_Identifier_RecID] int NOT NULL,
  [Primary_Flag] bit NOT NULL,
  [Sort_Order] smallint NULL,
  [Show_On_Custom_Fields_Setup_Table] bit NOT NULL,
  [Max_Rows_In_Pod] int NULL,
  [Default_Column] smallint NOT NULL
);
GO

-- dbo.Portal_Config
CREATE TABLE [dbo].[Portal_Config] (
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Background_Color] varchar(7) NULL,
  [Login_Background_Color] varchar(7) NULL,
  [Security_Default_Level] int NULL,
  [Events_Show_Flag] bit NOT NULL,
  [Events_Service_Flag] bit NOT NULL,
  [Events_Project_Flag] bit NOT NULL,
  [Events_Issues_Flag] bit NOT NULL,
  [SR_Type_Flag] bit NULL,
  [SR_Contact_Flag] bit NULL,
  [SR_Entered_Flag] bit NULL,
  [SR_Resources_Flag] bit NULL,
  [SR_Required_Flag] bit NULL,
  [SR_Site_Flag] bit NULL,
  [SR_Board_Flag] bit NULL,
  [SR_Budget_Flag] bit NULL,
  [SR_Actual_Flag] bit NULL,
  [SR_Approved_Flag] bit NULL,
  [SR_Portal_Option_ID] smallint NOT NULL,
  [SR_Update_Flag] bit NULL,
  [SR_Status_Flag] bit NULL,
  [Show_HomePage_Flag] bit NOT NULL,
  [SR_OpenTasks_Flag] bit NULL,
  [SR_ClosedTasks_Flag] bit NULL,
  [SO_Approve_Reopen_Status] int NULL,
  [SO_Approve_Activity_Type_RecID] int NULL,
  [SO_Approve_Activity_Assigned_By] int NULL,
  [SO_Approve_Subject] nvarchar(200) NULL,
  [SO_Approve_Notes] nvarchar(max) NULL,
  [SO_Confirm_Email_Flag] bit NULL,
  [SO_Confirm_Email_Subject] nvarchar(200) NULL,
  [SO_Confirm_Email_Notes] nvarchar(max) NULL,
  [SO_Confirm_From_Email] nvarchar(100) NULL,
  [SO_Email_Use_sender] bit NULL,
  [SO_Confirm_From_First_Name] nvarchar(100) NULL,
  [SO_Confirm_From_Last_Name] nvarchar(100) NULL,
  [VPW_CustomEmail_Flag] bit NULL,
  [VPW_Subject] nvarchar(200) NULL,
  [VPW_Notes] nvarchar(max) NULL,
  [VPW_From_Email_Address] nvarchar(100) NULL,
  [VPW_From_First_Name] nvarchar(100) NULL,
  [VPW_From_Last_Name] nvarchar(100) NULL,
  [IPW_CustomEmail_Flag] bit NULL,
  [IPW_Subject] nvarchar(200) NULL,
  [IPW_Notes] nvarchar(max) NULL,
  [IPW_From_Email_Address] nvarchar(100) NULL,
  [IPW_From_First_Name] nvarchar(100) NULL,
  [IPW_From_Last_Name] nvarchar(100) NULL,
  [FF_SR_Signoff_RecID] int NULL,
  [TM_SR_Signoff_RecID] int NULL,
  [SO_Reject_Create_Activity_Flag] bit NOT NULL,
  [SO_Reject_Reopen_Flag] bit NOT NULL,
  [SO_Reject_Reopen_Status] int NULL,
  [SO_Reject_Activity_Type_RecID] int NULL,
  [SO_Reject_Activity_Assigned_By] int NULL,
  [SO_Reject_Notes] nvarchar(max) NULL,
  [SO_Reject_Subject] nvarchar(200) NULL,
  [SO_Approve_From_Email] nvarchar(100) NULL,
  [SO_Approve_From_First_Name] nvarchar(100) NULL,
  [SO_Approve_From_Last_Name] nvarchar(100) NULL,
  [SO_Reject_From_Email] nvarchar(100) NULL,
  [SO_Reject_From_First_Name] nvarchar(100) NULL,
  [SO_Reject_From_Last_Name] nvarchar(100) NULL,
  [SO_Approve_Send_Email_Flag] bit NOT NULL,
  [SO_Reject_Send_Email_Flag] bit NOT NULL,
  [SO_Approve_Reopen_Flag] bit NOT NULL,
  [SO_Approve_Create_Activity_Flag] bit NOT NULL,
  [Portal_Config_RecID] int NOT NULL,
  [Company_RecID] int NULL,
  [Restrict_View_By_So_Opp_Status_Flag] bit NOT NULL,
  [Restrict_View_By_So_Type_Flag] bit NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Portal_Language_RecID] int NULL,
  [Portal_Name] nvarchar(150) NULL,
  [Portal_Menu_Color] varchar(7) NULL,
  [Portal_Button_Color] varchar(7) NULL,
  [Portal_Header_Color] varchar(7) NULL,
  [URL_Override] nvarchar(1000) NULL,
  [Welcome_Text] nvarchar(max) NULL,
  [Show_Inv_Pmt_Flag] bit NOT NULL,
  [Show_SLA_Info_Flag] bit NOT NULL,
  [Allow_Inv_Pmt_Flag] bit NOT NULL,
  [SR_Sub_Type_Flag] bit NULL,
  [SR_Sub_Type_Item_Flag] bit NULL,
  [Statement_Report_Owner_Level_RecID] int NULL,
  [Statement_Report_Owner_Level_RecID_Set_By_User] bit NOT NULL,
  [Enable_Chat_Assist_Flag] bit NOT NULL,
  [Display_Vendor_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Portal_Config_Billing_Status
CREATE TABLE [dbo].[Portal_Config_Billing_Status] (
  [Portal_Config_Billing_Status_RecID] int NOT NULL,
  [Portal_Config_RecID] int NOT NULL,
  [Billing_Status_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Portal_Config_Owner_Level
CREATE TABLE [dbo].[Portal_Config_Owner_Level] (
  [Portal_Config_Owner_Level_RecID] int NOT NULL,
  [Portal_Config_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Portal_Config_SO_Opp_Status
CREATE TABLE [dbo].[Portal_Config_SO_Opp_Status] (
  [Portal_Config_SO_Opp_Status_RecID] int NOT NULL,
  [Portal_Config_RecID] int NOT NULL,
  [SO_Opp_Status_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Portal_Config_SR_Board
CREATE TABLE [dbo].[Portal_Config_SR_Board] (
  [Portal_Config_SR_Board_RecID] int NOT NULL,
  [Portal_Config_RecID] int NOT NULL,
  [SR_Board_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Portal_Image
CREATE TABLE [dbo].[Portal_Image] (
  [Portal_Image_RecID] int NOT NULL,
  [Id] nvarchar(50) NULL,
  [Url] nvarchar(4000) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Url_Flag] bit NOT NULL,
  [Portal_Config_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Portal_Image_Type
CREATE TABLE [dbo].[Portal_Image_Type] (
  [Portal_Image_Type_RecID] int NOT NULL,
  [ID] nvarchar(50) NOT NULL,
  [Default_Url] nvarchar(255) NULL
);
GO

-- dbo.Portal_Language
CREATE TABLE [dbo].[Portal_Language] (
  [Portal_Language_RecID] int NOT NULL,
  [ID] nvarchar(50) NOT NULL,
  [locale] nvarchar(5) NULL
);
GO

-- dbo.Portal_Option
CREATE TABLE [dbo].[Portal_Option] (
  [Portal_Option_ID] smallint NOT NULL,
  [Portal_Option_Desc] nvarchar(30) NULL
);
GO

-- dbo.Portal_Payment_Processor
CREATE TABLE [dbo].[Portal_Payment_Processor] (
  [Portal_Payment_Processor_RecID] int NOT NULL,
  [Portal_Payment_Processor_ID] nvarchar(100) NOT NULL,
  [URL] nvarchar(max) NULL,
  [Test_URL] nvarchar(max) NULL,
  [System_Flag] bit NOT NULL
);
GO

-- dbo.Portal_Payment_Processor_Detail
CREATE TABLE [dbo].[Portal_Payment_Processor_Detail] (
  [Portal_Payment_Processor_Detail_RecID] int NOT NULL,
  [Portal_Config_RecID] int NOT NULL,
  [Portal_Payment_Processor_RecID] int NOT NULL,
  [Login] nvarchar(150) NULL,
  [Password] nvarchar(2000) NULL,
  [URL_Override] nvarchar(max) NULL,
  [Test_URL_Override] nvarchar(max) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Portal_Report
CREATE TABLE [dbo].[Portal_Report] (
  [Portal_Report_RecID] int NOT NULL,
  [Description] nvarchar(255) NULL,
  [Url] nvarchar(255) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Custom_Flag] bit NULL,
  [Portal_Config_RecID] int NULL,
  [View_Name] nvarchar(50) NULL,
  [Custom_Open_Same_Window_Flag] bit NULL,
  [Visible_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Portal_Security
CREATE TABLE [dbo].[Portal_Security] (
  [Portal_Security_RecID] int NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Function_Id] nvarchar(50) NULL,
  [Function_Description] nvarchar(255) NULL,
  [Level1] bit NULL,
  [Level2] bit NULL,
  [Level3] bit NULL,
  [Level4] bit NULL,
  [Level5] bit NULL,
  [Level6] bit NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Portal_Security_Level
CREATE TABLE [dbo].[Portal_Security_Level] (
  [Portal_Security_Level_RecID] int NOT NULL,
  [Default_Level] int NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Presenter_Identifier
CREATE TABLE [dbo].[Presenter_Identifier] (
  [Presenter_Identifier_RecID] int NOT NULL,
  [Presenter_Identifier] nvarchar(50) NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [System_Screens_Recid] int NOT NULL,
  [CanEmbed] bit NOT NULL,
  [Tab_Identifier_RecID] int NULL,
  [tab_key] nvarchar(50) NULL,
  [security_key] nvarchar(50) NULL,
  [can_hide] bit NOT NULL,
  [Presenter_Identifier_Client_Api_RecID] int NULL,
  [Client_Module_Identifier_RecID] int NULL
);
GO

-- dbo.Presenter_Identifier_Client_Api
CREATE TABLE [dbo].[Presenter_Identifier_Client_Api] (
  [Presenter_Identifier_Client_Api_RecID] int NOT NULL,
  [Client_Api_ID] nvarchar(50) NOT NULL
);
GO

-- dbo.ProcRunner_Mass_Update
CREATE TABLE [dbo].[ProcRunner_Mass_Update] (
  [ProcRunner_Mass_Update_RecID] int NOT NULL,
  [Update_Type] nvarchar(50) NOT NULL,
  [Current_RecID] int NOT NULL,
  [SR_Board_RecID] int NULL,
  [Date_Started] datetime NULL,
  [Member_Started] nvarchar(20) NULL,
  [Response] nvarchar(max) NULL,
  [New_RecID] int NULL,
  [SR_Status_RecID] int NULL,
  [SR_Type_RecID] int NULL,
  [SR_Team_RecID] int NULL,
  [SR_SubType_RecID] int NULL,
  [SR_SubTypeItem_RecID] int NULL,
  [Xref_Field] nvarchar(max) NULL,
  [Decimal_Field] decimal(22,6) NULL,
  [Date_Field] datetime NULL,
  [Job_Header_RecID] int NULL,
  [Sub_Job_Header_RecID] int NULL,
  [Action] nvarchar(max) NULL,
  [Boolean_Field] bit NOT NULL,
  [Locale_RecId] int NULL
);
GO

-- dbo.Project_Team
CREATE TABLE [dbo].[Project_Team] (
  [Project_Team_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [SR_Board_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Updated_UTC] datetime NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Project_Team_Mbr
CREATE TABLE [dbo].[Project_Team_Mbr] (
  [Project_Team_Mbr_RecID] int NOT NULL,
  [Project_Team_ReciD] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [PM_Role_RecID] int NOT NULL,
  [Activity_Class_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_by] nvarchar(15) NULL
);
GO

-- dbo.Purchase_Detail
CREATE TABLE [dbo].[Purchase_Detail] (
  [Purchase_Detail_RecID] int NOT NULL,
  [Purchase_Header_RecID] int NOT NULL,
  [IV_Item_RecID] int NULL,
  [Description] nvarchar(max) NULL,
  [Serial_Number] nvarchar(max) NULL,
  [Received] bit NOT NULL,
  [Received_Qty] decimal(18,2) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NOT NULL,
  [Warehouse_RecID] int NULL,
  [Warehouse_Bin_RecID] int NULL,
  [Line_Number] int NULL,
  [Quantity] decimal(18,2) NULL,
  [IV_UOM_RecID] int NULL,
  [Item_Cost] decimal(18,6) NULL,
  [Orig_Warehouse_RecID] int NULL,
  [Alloc_Freight] decimal(18,2) NULL,
  [Vendor_Order_Number] nvarchar(50) NULL,
  [Ship_Date] datetime NULL,
  [Expected_Ship_Date] datetime NULL,
  [ShipMethod_RecID] int NULL,
  [Tracking_Number] nvarchar(50) NULL,
  [Backorder_Flag] bit NOT NULL,
  [Cancel_Flag] bit NOT NULL,
  [Cancel_By] nvarchar(15) NULL,
  [Date_Cancel] datetime NULL,
  [Cancel_Reason] nvarchar(100) NULL,
  [Closed_Flag] bit NOT NULL,
  [Closed_By] nvarchar(15) NULL,
  [Date_Closed] datetime NULL,
  [Date_Received] datetime NULL,
  [Packing_Slip] nvarchar(50) NULL,
  [Internal_Notes] nvarchar(1000) NULL,
  [Display_Internal_Notes_Flag] bit NOT NULL,
  [Tax_Total] decimal(18,2) NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Expected_Date_Of_Arrival] date NULL,
  [Date_Closed_UTC] datetime NULL,
  [Date_Cancel_UTC] datetime NULL,
  [Date_Received_UTC] datetime NULL,
  [Vendor_SKU] nvarchar(50) NULL,
  [Unbatched_GL_BatchID_RecID] int NULL,
  [Quantity_Changed] int NULL,
  [Change_Order_Flag] bit NOT NULL
);
GO

-- dbo.Purchase_Detail_Tax
CREATE TABLE [dbo].[Purchase_Detail_Tax] (
  [Purchase_Detail_Tax_RecID] int NOT NULL,
  [Purchase_Detail_RecID] int NOT NULL,
  [Tax_Level] tinyint NOT NULL,
  [Tax_Amount] decimal(18,2) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Purchase_Header
CREATE TABLE [dbo].[Purchase_Header] (
  [Purchase_Header_RecID] int NOT NULL,
  [Vendor_Company_RecID] int NOT NULL,
  [Vendor_Contact_RecID] int NULL,
  [Vendor_Address_RecID] int NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Purchase_Date] datetime NULL,
  [Dropship_Flag] bit NULL,
  [Warehouse_RecID] int NULL,
  [Customer_Company_RecID] int NULL,
  [Customer_Contact_RecID] int NULL,
  [Customer_Address_RecID] int NULL,
  [Billing_Terms_RecID] int NULL,
  [ShipmentMethod_RecID] int NULL,
  [Ship_Date] datetime NULL,
  [Tracking_Number] nvarchar(50) NULL,
  [Received] bit NULL,
  [Shipping_Instructions] nvarchar(4000) NULL,
  [Vendor_Invoice_Number] nvarchar(50) NULL,
  [Vendor_Order_Number] nvarchar(50) NULL,
  [Entered_By] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NOT NULL,
  [Total] decimal(18,2) NULL,
  [Closed_Flag] bit NULL,
  [Closed_By] nvarchar(15) NULL,
  [Date_Closed] datetime NULL,
  [Freight_Cost] decimal(18,2) NULL,
  [PO_Number] nvarchar(50) NULL,
  [Save_Guid] uniqueidentifier NULL,
  [Vendor_Invoice_Date] datetime NULL,
  [Customer_Site_Name] nvarchar(50) NULL,
  [Customer_Address_Line1] nvarchar(50) NULL,
  [Customer_Address_Line2] nvarchar(50) NULL,
  [Customer_City] nvarchar(50) NULL,
  [Customer_State] nvarchar(50) NULL,
  [Customer_Zip] nvarchar(12) NULL,
  [Customer_Country_RecID] int NULL,
  [Customer_Contact_Name] nvarchar(62) NULL,
  [Customer_Contact_PhoneNbr] nvarchar(20) NULL,
  [Customer_Contact_Extension] nvarchar(15) NULL,
  [Freight_Packing_Slip] nvarchar(50) NULL,
  [Notification_History] nvarchar(4000) NULL,
  [Internal_Notes] nvarchar(max) NULL,
  [PO_Status_RecID] int NULL,
  [Tax_Code_RecID] int NULL,
  [Tax_Purchase_Order_Flag] bit NOT NULL,
  [Tax_Freight_Flag] bit NOT NULL,
  [Tax_Total] decimal(18,2) NOT NULL,
  [Freight_Tax_Total] decimal(18,2) NOT NULL,
  [Ava_Validated_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Date_Closed_UTC] datetime NULL,
  [Currency_RecID] int NOT NULL,
  [Unbatched_GL_BatchID_RecID] int NULL,
  [Warehouse_Contact_RecID] int NULL
);
GO

-- dbo.Purchase_Header_Audit
CREATE TABLE [dbo].[Purchase_Header_Audit] (
  [Purchase_Header_Audit_RecID] int NOT NULL,
  [Purchase_Header_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Audit_SubType_RecID] smallint NULL,
  [Audit_Data_Type_Format_RecID] int NOT NULL,
  [OldValue_Text] nvarchar(2000) NULL,
  [NewValue_Text] nvarchar(2000) NULL,
  [Affected_Record] nvarchar(100) NULL,
  [DM_Document_RecID] int NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(3) NOT NULL,
  [AffectedRecord_Locale_Key_RecId] int NULL,
  [OldValue_Locale_Key_RecID] int NULL,
  [NewValue_Locale_Key_RecID] int NULL
);
GO

-- dbo.Purchase_Header_Freight_Tax
CREATE TABLE [dbo].[Purchase_Header_Freight_Tax] (
  [Purchase_Header_Freight_Tax_RecID] int NOT NULL,
  [Purchase_Header_RecID] int NOT NULL,
  [Tax_Level] tinyint NOT NULL,
  [Tax_Amount] decimal(18,2) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Purchase_Note
CREATE TABLE [dbo].[Purchase_Note] (
  [Purchase_Header_RecID] int NULL,
  [Purchase_Note_RecID] int NOT NULL,
  [Seq_Nbr] int NULL,
  [Note_Type_RecID] int NULL,
  [Notes] nvarchar(max) NULL,
  [Purchase_Flag] bit NULL,
  [Entered_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Purchase_Number_Gen
CREATE TABLE [dbo].[Purchase_Number_Gen] (
  [Next_PO_Number] int NOT NULL
);
GO

-- dbo.Purchase_Order_Status
CREATE TABLE [dbo].[Purchase_Order_Status] (
  [PO_Status_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NULL,
  [Closed_Flag] bit NULL,
  [Inactive_Flag] bit NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Sort_Order] smallint NULL,
  [Default_Closed_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Rec_Type
CREATE TABLE [dbo].[Rec_Type] (
  [Rec_Type] char(1) NOT NULL,
  [Rec_Type_Desc] nvarchar(100) NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Reminder_Time
CREATE TABLE [dbo].[Reminder_Time] (
  [Reminder_Time_RecID] int NOT NULL,
  [Reminder_Time] int NULL,
  [Description] nvarchar(10) NULL,
  [Default_Flag] bit NULL,
  [last_update] datetime2(0) NOT NULL,
  [updated_by] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Remote_Package
CREATE TABLE [dbo].[Remote_Package] (
  [Remote_Package_ID] char(1) NOT NULL,
  [Package_Name] nvarchar(50) NULL,
  [Assembly_Name] nvarchar(200) NULL,
  [Class_Name] nvarchar(200) NULL
);
GO

-- dbo.Report_Identity_Column
CREATE TABLE [dbo].[Report_Identity_Column] (
  [Report_Identity_Column] varchar(128) NOT NULL,
  [Report_Name] varchar(128) NOT NULL,
  [Localized_Flag] bit NOT NULL
);
GO

-- dbo.Report_Writer
CREATE TABLE [dbo].[Report_Writer] (
  [Name] nvarchar(255) NOT NULL,
  [Xml] nvarchar(max) NULL,
  [CreatedDate] datetime2(0) NOT NULL,
  [ModifiedDate] datetime2(0) NOT NULL,
  [TenantID] nvarchar(255) NULL,
  [IzendaAdHocReportsID] int NULL,
  [Form] nvarchar(max) NULL,
  [ReportSourceID] int NULL,
  [Thumbnail] varbinary(max) NULL,
  [ReportWriterRecId] int NOT NULL,
  [Id] uniqueidentifier NOT NULL,
  [CreatedOnUtc] datetime2(0) NOT NULL,
  [LastUpdatedOnUtc] datetime2(0) NOT NULL
);
GO

-- dbo.Report_Writer_Categories
CREATE TABLE [dbo].[Report_Writer_Categories] (
  [Report_Writer_Categories_RecID] int NOT NULL,
  [Prefix] nvarchar(100) NOT NULL,
  [Category] nvarchar(100) NOT NULL
);
GO

-- dbo.Report_Writer_Category_Map
CREATE TABLE [dbo].[Report_Writer_Category_Map] (
  [Report_Writer_Category_Map_RecID] int NOT NULL,
  [Name] nvarchar(150) NOT NULL,
  [Description] nvarchar(150) NULL,
  [Module_ID] nvarchar(20) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Primary_Flag] bit NOT NULL,
  [Rpt_View_Flag] bit NOT NULL
);
GO

-- dbo.Report_Writer_Hidden_Param
CREATE TABLE [dbo].[Report_Writer_Hidden_Param] (
  [Report_Writer_Hidden_Param_RecID] int NOT NULL,
  [Schema_Name] nvarchar(128) NULL,
  [Procedure_Name] nvarchar(128) NULL
);
GO

-- dbo.Report_Writer_Hidden_Param_Value
CREATE TABLE [dbo].[Report_Writer_Hidden_Param_Value] (
  [Report_Writer_Hidden_Param_Value_RecID] int NOT NULL,
  [Parameter_Name] nvarchar(128) NULL,
  [Parameter_Value] nvarchar(250) NULL,
  [Report_Writer_Hidden_Param_Value_Type_RecID] int NULL,
  [Report_Writer_Hidden_Param_RecID] int NULL
);
GO

-- dbo.Report_Writer_Hidden_Param_Value_Type
CREATE TABLE [dbo].[Report_Writer_Hidden_Param_Value_Type] (
  [Report_Writer_Hidden_Param_Value_Type_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL
);
GO

-- dbo.RM_Skill_Level
CREATE TABLE [dbo].[RM_Skill_Level] (
  [RM_Skill_ID] smallint NOT NULL,
  [Description] nvarchar(20) NULL,
  [Skill_Rating] int NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.RM_Skills_Chooser
CREATE TABLE [dbo].[RM_Skills_Chooser] (
  [RM_Skills_Chooser_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Filter_Name] nvarchar(100) NOT NULL,
  [Find_All] bit NULL,
  [Global_Flag] bit NULL,
  [Last_Updated] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.RM_Skills_Chooser_Item
CREATE TABLE [dbo].[RM_Skills_Chooser_Item] (
  [RM_Skills_Chooser_Item_RecID] int NOT NULL,
  [RM_Skills_Chooser_RecID] int NOT NULL,
  [IsSkill] bit NULL,
  [Skill_RecID] int NULL,
  [Skill_Certified] bit NULL,
  [Skill_Level] int NULL,
  [Skill_Experience] int NULL,
  [Cert_RecID] int NULL,
  [Cert_CompanyRecID] int NULL
);
GO

-- dbo.RMA_Action
CREATE TABLE [dbo].[RMA_Action] (
  [RMA_Action_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NULL,
  [Receiving_Flag] bit NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.RMA_Disposition
CREATE TABLE [dbo].[RMA_Disposition] (
  [RMA_Disposition_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NULL,
  [Updated_By] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.RMA_Status
CREATE TABLE [dbo].[RMA_Status] (
  [RMA_Status_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NULL,
  [Sort_Order] smallint NULL,
  [Closed_Flag] bit NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Schedule
CREATE TABLE [dbo].[Schedule] (
  [Schedule_RecID] int NOT NULL,
  [RecID] int NULL,
  [Schedule_Type_RecID] int NOT NULL,
  [Member_ID] nvarchar(15) NULL,
  [Date_Time_Start] datetime NULL,
  [Date_Time_End] datetime NULL,
  [close_flag] bit NOT NULL,
  [Hours_Estimated] decimal(18,2) NULL,
  [Last_Update] datetime NULL,
  [Updated_By] nvarchar(15) NULL,
  [Syncable] bit NOT NULL,
  [Last_Sync] datetime NULL,
  [Exchange_GUID] varchar(4000) NULL,
  [Reminder_Flag] bit NOT NULL,
  [Reminder_Minutes] int NULL,
  [All_Day_Flag] bit NOT NULL,
  [Duration] int NULL,
  [Entered_By_RecID] int NULL,
  [Xref_Mbr_RecID] int NULL,
  [Percent_Sched] int NULL,
  [Hours_Sched] decimal(18,2) NULL,
  [Schedule_Status_RecID] int NULL,
  [Hours_Per_Day] decimal(18,2) NULL,
  [Ack_Flag] bit NULL,
  [Ack_Member_RecID] int NULL,
  [Ack_Date] datetime NULL,
  [Close_Member_RecID] int NULL,
  [Close_Date] datetime NULL,
  [Billable_Flag] bit NULL,
  [Date_Entered] datetime NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [SR_Location_RecID] int NULL,
  [Schedule_Span_RecID] int NULL,
  [Meeting_Flag] bit NULL,
  [Recurring_Flag] bit NULL,
  [Ack_Date_UTC] datetime NULL,
  [Date_Entered_UTC] datetime NULL,
  [Last_Update_UTC] datetime NULL,
  [Close_Date_UTC] datetime NULL,
  [Entered_By] nvarchar(15) NULL,
  [Acknowledged_By] nvarchar(15) NULL,
  [Closed_By] nvarchar(15) NULL,
  [Date_Time_Start_UTC] smalldatetime NULL,
  [Date_Time_End_UTC] smalldatetime NULL,
  [Schedule_Desc] nvarchar(250) NULL,
  [Private_Flag] bit NOT NULL,
  [NotifyType] nvarchar(2) NULL
);
GO

-- dbo.Schedule_Detail
CREATE TABLE [dbo].[Schedule_Detail] (
  [Schedule_Detail_RecID] int NOT NULL,
  [Schedule_RecID] int NULL,
  [Date_Scheduled] datetime NULL,
  [Hours_Scheduled] decimal(18,2) NULL,
  [Priority] smallint NULL,
  [Start_Time] datetime NULL,
  [End_Time] datetime NULL,
  [Member_RecID] int NULL,
  [Schedule_Type_ID] char(1) NULL,
  [RecID] int NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NOT NULL,
  [time_flag] bit NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Exchange_Href] nvarchar(300) NULL,
  [Revision_ID] int NULL,
  [Appointment_Hash] nvarchar(100) NULL,
  [Date_Time_Start_UTC] smalldatetime NULL,
  [Date_Time_End_UTC] smalldatetime NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Private_Flag] bit NOT NULL,
  [Change_Key] nvarchar(300) NULL,
  [Master_Series_ID] nvarchar(300) NULL,
  [ICal_UID] nvarchar(512) NULL,
  [Teams_Meeting_Flag] bit NOT NULL
);
GO

-- dbo.Schedule_Percents
CREATE TABLE [dbo].[Schedule_Percents] (
  [Schedule_Percents_RecID] int NOT NULL,
  [Start_Percent] int NULL,
  [End_Percent] int NULL,
  [Color] nvarchar(25) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Schedule_Span
CREATE TABLE [dbo].[Schedule_Span] (
  [Schedule_Span_ID] nvarchar(1) NOT NULL,
  [Span_Desc] nvarchar(20) NULL,
  [Schedule_Span_RecID] smallint NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Schedule_Status
CREATE TABLE [dbo].[Schedule_Status] (
  [Schedule_Status_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Soft_Flag] bit NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Color] nvarchar(25) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Schedule_Type
CREATE TABLE [dbo].[Schedule_Type] (
  [Schedule_Type_RecID] int NOT NULL,
  [Table_Reference] nvarchar(50) NULL,
  [Description] nvarchar(50) NULL,
  [Display_Color] nvarchar(30) NULL,
  [Module_ID] char(2) NULL,
  [System_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Display_Flag] bit NOT NULL,
  [Xref_Mbr_Table] nvarchar(50) NULL,
  [Schedule_Type_ID] char(1) NULL,
  [TE_Charge_Code_RecID] int NULL,
  [SR_Location_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Screen_Link
CREATE TABLE [dbo].[Screen_Link] (
  [Screen_Link_RecID] int NOT NULL,
  [Link_Name] nvarchar(50) NOT NULL,
  [Screen_Link_Table_RecID] int NOT NULL,
  [Link_Definition] nvarchar(1000) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Screen_Link_Table
CREATE TABLE [dbo].[Screen_Link_Table] (
  [Screen_Link_Table_RecID] int NOT NULL,
  [Table_Reference] nvarchar(50) NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Screen_Multiline
CREATE TABLE [dbo].[Screen_Multiline] (
  [ScreenID] varchar(50) NOT NULL,
  [Multiline_RecID] int NOT NULL
);
GO

-- dbo.Send_From
CREATE TABLE [dbo].[Send_From] (
  [Send_From_RecID] int NOT NULL,
  [Email_Address] nvarchar(250) NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Send_From_Audit
CREATE TABLE [dbo].[Send_From_Audit] (
  [Send_From_Audit_RecID] int NOT NULL,
  [Send_From_RecID] int NULL,
  [Email_Address] nvarchar(250) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Deleted_By] nvarchar(15) NULL,
  [Date_Deleted_UTC] datetime2(0) NULL
);
GO

-- dbo.Send_From_Notify
CREATE TABLE [dbo].[Send_From_Notify] (
  [Send_From_Notify_RecID] int NOT NULL,
  [Member_RecID] int NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Sessions
CREATE TABLE [dbo].[Sessions] (
  [Session_RecID] int NOT NULL,
  [Context] nvarchar(20) NOT NULL,
  [Session_Key] nvarchar(100) NOT NULL,
  [Value] nvarchar(1000) NULL,
  [Expiration] datetime NOT NULL
);
GO

-- dbo.SF_Entry_Type
CREATE TABLE [dbo].[SF_Entry_Type] (
  [SF_Entry_Type_RecID] int NOT NULL,
  [SF_Entry_Type_ID] char(1) NOT NULL,
  [SF_Entry_Name] nvarchar(20) NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.SF_Field_Type
CREATE TABLE [dbo].[SF_Field_Type] (
  [SF_Field_Type_RecID] int NOT NULL,
  [SF_Field_Type_ID] char(1) NOT NULL,
  [SF_Name] nvarchar(20) NULL,
  [Display_Info] nvarchar(500) NULL,
  [Decimals_Flag] bit NULL,
  [Default_Decimals] smallint NULL,
  [Entry_Type_Flag] bit NULL,
  [Field_Base_Type] nvarchar(12) NOT NULL,
  [Config_Flag] bit NOT NULL,
  [Custom_Field_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Display_Info_Locale_Key_RecID] int NULL
);
GO

-- dbo.ShipmentMethod
CREATE TABLE [dbo].[ShipmentMethod] (
  [ShipmentMethod_RecID] int NOT NULL,
  [ShipMethodDescription] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Default_Flag] bit NOT NULL,
  [Tracking_Url] nvarchar(200) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SIC_Code
CREATE TABLE [dbo].[SIC_Code] (
  [SIC_Code_ID] varchar(10) NOT NULL,
  [SIC_Code_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [SIC_Category] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Signature
CREATE TABLE [dbo].[Signature] (
  [Signature_RecID] int NOT NULL,
  [Signature_DateTime] datetime2(0) NULL,
  [Member_RecID] int NULL,
  [SR_Service_RecID] int NULL,
  [Created_By] nvarchar(15) NULL,
  [Date_Created] datetime2(0) NOT NULL,
  [Mobile_GUID] uniqueidentifier NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Signature_DateTime_UTC] datetime2(0) NULL,
  [Signature_Ink] nvarchar(max) NULL
);
GO

-- dbo.SO_Act_Status
CREATE TABLE [dbo].[SO_Act_Status] (
  [SO_Act_Status_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Default_Flag] bit NOT NULL,
  [Closed_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [spawn_followup_flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SO_Activity
CREATE TABLE [dbo].[SO_Activity] (
  [SO_Activity_Recid] int NOT NULL,
  [Opportunity_Recid] int NULL,
  [Assign_To] nvarchar(15) NOT NULL,
  [Assigned_By] nvarchar(15) NOT NULL,
  [Company_RecID] int NULL,
  [SO_Activity_Type_RecID] int NULL,
  [Subject] nvarchar(100) NULL,
  [SO_Reference_RecID] int NULL,
  [Date_Entered] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Contact_RecID] int NULL,
  [Contact_Name] nvarchar(62) NULL,
  [Close_Flag] bit NOT NULL,
  [Date_Closed] datetime NULL,
  [Closed_By] nvarchar(15) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NOT NULL,
  [Notify_Complete_Flag] bit NOT NULL,
  [Notification_Sent_Flag] bit NOT NULL,
  [SR_Service_RecID] int NULL,
  [AGR_Header_RecID] int NULL,
  [Marketing_Campaign_RecID] int NULL,
  [assignto_recid] int NOT NULL,
  [assignby_recid] int NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [SR_Location_RecID] int NULL,
  [DB_Timestamp] timestamp NOT NULL,
  [Date_Time_Start] datetime NULL,
  [Date_Time_End] datetime NULL,
  [Automated] bit NOT NULL,
  [Date_Time_Start_UTC] smalldatetime NULL,
  [Date_Time_End_UTC] smalldatetime NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Closed_UTC] datetime NULL,
  [so_act_status_recid] int NOT NULL,
  [Currency_RecID] int NOT NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.SO_Activity_Audit
CREATE TABLE [dbo].[SO_Activity_Audit] (
  [SO_Activity_Audit_RecID] int NOT NULL,
  [SO_Activity_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Updated_utc] datetime2(3) NOT NULL
);
GO

-- dbo.SO_Activity_Audit_Value
CREATE TABLE [dbo].[SO_Activity_Audit_Value] (
  [SO_Activity_Audit_Value_RecID] int NOT NULL,
  [Audit_Token] nvarchar(50) NOT NULL,
  [Audit_Value_RecID] int NULL,
  [Audit_Value] nvarchar(4000) NOT NULL,
  [SO_Activity_Audit_RecID] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.SO_Activity_Notes
CREATE TABLE [dbo].[SO_Activity_Notes] (
  [SO_Activity_Notes_RecID] int NOT NULL,
  [SO_Activity_RecID] int NOT NULL,
  [Notes] nvarchar(max) NOT NULL,
  [Internal_Analysis_Flag] bit NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.SO_Activity_Type
CREATE TABLE [dbo].[SO_Activity_Type] (
  [SO_Activity_Type_RecID] int NOT NULL,
  [SO_Activity_Type_ID] nvarchar(15) NULL,
  [Description] nvarchar(50) NULL,
  [History_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [CleanUp_Flag] bit NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Import_Flag] bit NOT NULL,
  [email_flag] bit NOT NULL,
  [Memo_Flag] bit NULL,
  [Points_Value] int NULL,
  [Inactive_Flag] bit NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SO_Activity_User_Defined_Field_Value
CREATE TABLE [dbo].[SO_Activity_User_Defined_Field_Value] (
  [SO_Activity_User_Defined_Field_Value_RecID] bigint NOT NULL,
  [SO_Activity_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [User_Defined_Field_Value] nvarchar(1000) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.SO_Forecast_Dtl
CREATE TABLE [dbo].[SO_Forecast_Dtl] (
  [SO_Forecast_Dtl_RecID] int NOT NULL,
  [Opportunity_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Revenue] decimal(18,2) NULL,
  [Cost] decimal(18,2) NULL,
  [SO_Opp_Status_RecID] int NULL,
  [Include_Flag] bit NOT NULL,
  [QuoteWerks_DocNO] nvarchar(20) NULL,
  [QuoteWerks_DocName] nvarchar(255) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [SO_Forecast_Type_ID] nvarchar(2) NULL,
  [Link_Flag] bit NOT NULL,
  [Recurring_Revenue] decimal(18,2) NULL,
  [Recurring_Cost] decimal(18,2) NULL,
  [Recurring_Date_Start] datetime2(0) NULL,
  [Recurring_Date_End] datetime2(0) NULL,
  [Bill_Cycle_RecID] int NULL,
  [Cycle_Basis_ID] char(1) NULL,
  [Recurring_Flag] bit NOT NULL,
  [Product_Flag] bit NOT NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.SO_Influencers
CREATE TABLE [dbo].[SO_Influencers] (
  [SO_Influencer_RecID] int NOT NULL,
  [Opportunity_RecID] int NULL,
  [Contact_RecID] int NULL,
  [Contact_Name] nvarchar(62) NULL,
  [PhoneNbr] nvarchar(250) NULL,
  [Email_Address] nvarchar(250) NULL,
  [Company_RecID] int NULL,
  [Company_Name] nvarchar(50) NULL,
  [SO_Role_RecID] int NULL,
  [Notes] nvarchar(max) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Referral_Flag] bit NOT NULL
);
GO

-- dbo.SO_Interest
CREATE TABLE [dbo].[SO_Interest] (
  [SO_Interest_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Sort_Order] smallint NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SO_Note
CREATE TABLE [dbo].[SO_Note] (
  [Opportunity_RecID] int NULL,
  [SO_Notes_RecID] int NOT NULL,
  [Seq_Nbr] int NULL,
  [Note_Type_RecID] int NULL,
  [Notes] nvarchar(max) NULL,
  [SO_Flag] bit NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.SO_Opp_Status
CREATE TABLE [dbo].[SO_Opp_Status] (
  [SO_Opp_Status_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Won_Flag] bit NOT NULL,
  [Lost_Flag] bit NOT NULL,
  [Closed_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SO_Opportunity
CREATE TABLE [dbo].[SO_Opportunity] (
  [Opportunity_RecID] int NOT NULL,
  [Opportunity_Name] nvarchar(100) NOT NULL,
  [Company_RecID] int NOT NULL,
  [Contact_RecID] int NULL,
  [SO_Pipeline_RecID] int NOT NULL,
  [Date_Pipeline_Change] datetime NULL,
  [SO_Interest_RecID] int NULL,
  [Estimated_Total] decimal(18,2) NULL,
  [Probability_to_Close] smallint NULL,
  [Source] nvarchar(50) NULL,
  [Date_Became_Lead] datetime NOT NULL,
  [Date_Close_Expected] date NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [Contract_Type_RecID] int NULL,
  [old_Close_Flag] bit NOT NULL,
  [Date_Closed] datetime NULL,
  [Closed_By] nvarchar(15) NULL,
  [Entered_By] nvarchar(15) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Notes] nvarchar(max) NULL,
  [Company_Address_RecID] int NULL,
  [Red_Flag] bit NOT NULL,
  [old_Won_Flag] bit NOT NULL,
  [old_Actual_Total] decimal(18,2) NULL,
  [old_Competitor] varchar(50) NULL,
  [old_Close_Notes] varchar(max) NULL,
  [SO_Opp_Status_RecID] int NOT NULL,
  [PM_Project_RecID] int NULL,
  [Owner_Level_RecID] int NOT NULL,
  [SO_Type_RecID] int NULL,
  [Marketing_Campaign_RecID] int NULL,
  [AGR_Type_RecID] int NULL,
  [SR_Service_RecID] int NULL,
  [SO_Urgency_RecID] int NULL,
  [Approved_By] int NULL,
  [Date_Approved] datetime NULL,
  [Notification_History] nvarchar(max) NOT NULL,
  [Rejected_By] int NULL,
  [Date_Rejected] datetime NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [PO_Number] nvarchar(25) NULL,
  [Date_Became_Lead_UTC] datetime NOT NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Date_Closed_UTC] datetime NULL,
  [Date_Close_Expected_UTC] date NOT NULL,
  [DB_Timestamp] timestamp NOT NULL,
  [Ship_To_Company_RecID] int NULL,
  [Ship_To_Contact_RecID] int NULL,
  [Ship_To_Company_Address_RecID] int NULL,
  [Bill_To_Company_RecID] int NULL,
  [Bill_To_Contact_RecID] int NULL,
  [Bill_To_Company_Address_RecID] int NULL,
  [Billing_Terms_RecID] int NULL,
  [Tax_Code_RecID] int NULL,
  [Tax_Total] decimal(18,2) NOT NULL,
  [Currency_RecID] int NOT NULL,
  [Tech_Contact_RecID] int NULL,
  [Id] uniqueidentifier NULL
);
GO

-- dbo.SO_Opportunity_Audit
CREATE TABLE [dbo].[SO_Opportunity_Audit] (
  [SO_Opportunity_Audit_RecId] int NOT NULL,
  [Opportunity_RecId] int NOT NULL,
  [Locale_Key_RecId] int NOT NULL,
  [Audit_Source_RecId] smallint NOT NULL,
  [Audit_Type_RecId] smallint NOT NULL,
  [Updated_by] nvarchar(15) NOT NULL,
  [last_Updated_utc] datetime2(3) NOT NULL
);
GO

-- dbo.SO_Opportunity_Audit_Value
CREATE TABLE [dbo].[SO_Opportunity_Audit_Value] (
  [SO_Opportunity_Audit_Value_RecId] int NOT NULL,
  [audit_token] nvarchar(50) NOT NULL,
  [audit_value_recid] int NULL,
  [audit_value] nvarchar(max) NOT NULL,
  [SO_Opportunity_audit_recid] int NOT NULL,
  [Locale_Key_RecId] int NULL
);
GO

-- dbo.SO_Opportunity_Member
CREATE TABLE [dbo].[SO_Opportunity_Member] (
  [Opportunity_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [PrimarySales_Flag] bit NOT NULL,
  [SecondarySales_Flag] bit NOT NULL,
  [Individual_Flag] bit NOT NULL,
  [Team_Flag] bit NOT NULL,
  [AllowAccess_Flag] bit NOT NULL
);
GO

-- dbo.SO_Opportunity_Tax
CREATE TABLE [dbo].[SO_Opportunity_Tax] (
  [Opportunity_Tax_RecID] int NOT NULL,
  [Opportunity_RecID] int NOT NULL,
  [Tax_Level] tinyint NOT NULL,
  [Tax_Amount] decimal(18,2) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL
);
GO

-- dbo.SO_Opportunity_User_Defined_Field_Value
CREATE TABLE [dbo].[SO_Opportunity_User_Defined_Field_Value] (
  [Opportunity_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [User_Defined_Field_Value] nvarchar(1000) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.SO_Pipeline
CREATE TABLE [dbo].[SO_Pipeline] (
  [SO_Pipeline_RecID] int NOT NULL,
  [Seq_Nbr] int NULL,
  [Description] nvarchar(50) NULL,
  [Funnel_Color] nvarchar(25) NULL,
  [Survey_RecID] int NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [SO_Probability_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SO_Probability
CREATE TABLE [dbo].[SO_Probability] (
  [SO_Probability_RecID] int NOT NULL,
  [Probability] smallint NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SO_Recurring
CREATE TABLE [dbo].[SO_Recurring] (
  [SO_Recurring_RecID] int NOT NULL,
  [SO_Forecast_Dtl_RecID] int NULL,
  [Revenue] decimal(18,2) NULL,
  [Cost] decimal(18,2) NULL,
  [Period_Start] datetime NOT NULL,
  [Period_End] datetime NOT NULL
);
GO

-- dbo.SO_Role
CREATE TABLE [dbo].[SO_Role] (
  [SO_Role_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SO_Status
CREATE TABLE [dbo].[SO_Status] (
  [SO_Status_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Survey_RecID] int NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.SO_Team
CREATE TABLE [dbo].[SO_Team] (
  [SO_Team_RecID] int NOT NULL,
  [Opportunity_RecID] int NOT NULL,
  [Team_Flag] bit NOT NULL,
  [RecID] int NULL,
  [Description] nvarchar(50) NULL,
  [Owner_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [member_id] nvarchar(15) NULL,
  [Referral_Flag] bit NOT NULL,
  [Secondary_Flag] bit NOT NULL,
  [Percent_Split] smallint NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.SO_Type
CREATE TABLE [dbo].[SO_Type] (
  [SO_Type_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Update_By] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SO_Urgency
CREATE TABLE [dbo].[SO_Urgency] (
  [SO_Urgency_RecID] int NOT NULL,
  [Image_Link] nvarchar(100) NULL,
  [Description] nvarchar(50) NOT NULL,
  [Sort_Order] int NULL,
  [Default_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.SQL_Procedure_Error
CREATE TABLE [dbo].[SQL_Procedure_Error] (
  [SQL_Procedure_Error_RecID] int NOT NULL,
  [Stored_Procedure] nvarchar(255) NULL,
  [Error_Number] int NULL,
  [Error_Severity] int NULL,
  [Error_Line] int NULL,
  [Error_Message] nvarchar(max) NULL,
  [Date_Occurred] datetime2(3) NOT NULL
);
GO

-- dbo.SR_Billing_Method
CREATE TABLE [dbo].[SR_Billing_Method] (
  [SR_Billing_Method_RecID] int NOT NULL,
  [SR_Billing_Method_ID] char(1) NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Override_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.SR_Board
CREATE TABLE [dbo].[SR_Board] (
  [SR_Board_RecID] int NOT NULL,
  [Board_Name] nvarchar(50) NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [Board_Icon] nvarchar(100) NULL,
  [BillComplete_Flag] bit NULL,
  [BillSR_Flag] bit NULL,
  [BillUnapp_Flag] bit NULL,
  [Override_Flag] bit NULL,
  [Dispatch] int NULL,
  [ServiceManager] int NULL,
  [DutyManager] int NULL,
  [Activity_Class_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [TimeBillable_Flag] bit NULL,
  [ExpBillable_Flag] bit NULL,
  [ProdBillable_Flag] bit NULL,
  [TimeInvoice_Flag] bit NULL,
  [ExpInvoice_Flag] bit NULL,
  [ProdInvoice_Flag] bit NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [autoclose_status_recid] int NULL,
  [AutoAssignNew_Flag] bit NULL,
  [AutoAssignEC_Flag] bit NULL,
  [AutoAssignPortal_Flag] bit NULL,
  [SR_Signoff_RecID] int NOT NULL,
  [EC_ReOpen_Status] int NULL,
  [Project_Flag] bit NOT NULL,
  [EmailContact_Flag] bit NULL,
  [EmailResource_Flag] bit NULL,
  [LockDesc_Flag] bit NULL,
  [SR_Problem_Flag] bit NULL,
  [AdditionsLockTime_Flag] bit NULL,
  [Default_Notify_From] nvarchar(50) NULL,
  [Oncall] int NULL,
  [Inactive_Flag] bit NULL,
  [Display_Name] nvarchar(60) NULL,
  [SR_Resolution_Flag] bit NOT NULL,
  [SR_InternalAnalysis_Flag] bit NOT NULL,
  [TE_Problem_Flag] bit NOT NULL,
  [TE_Resolution_Flag] bit NOT NULL,
  [TE_InternalAnalysis_Flag] bit NOT NULL,
  [Problem_Sort] char(1) NOT NULL,
  [Resolution_Sort] char(1) NOT NULL,
  [InternalAnalysis_Sort] char(1) NOT NULL,
  [EmailContact_Template_RecID] int NULL,
  [EmailResource_Template_RecID] int NULL,
  [EC_ReOpen_Resources_Flag] bit NULL,
  [EC_Company_Match_Flag] bit NOT NULL,
  [EC_ReOpen_Days_Flag] bit NOT NULL,
  [EC_ReOpen_Days] int NOT NULL,
  [Member_Display_Name_Flag] bit NOT NULL,
  [EmailCc_Flag] bit NOT NULL,
  [Show_Dependencies] bit NOT NULL,
  [Show_Estimates] bit NOT NULL,
  [AutoAssignTicketOwner_Flag] bit NOT NULL,
  [SR_All_Notes_Flag] bit NOT NULL,
  [All_Sort] char(1) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [EC_Allow_Reopen_Closed_Flag] bit NOT NULL,
  [Percentage_Calculation_RecID] int NULL,
  [EC_ReOpen_Days_Closed] int NOT NULL,
  [Mark_First_Note_Issue_Flag] bit NOT NULL,
  [Restrict_Board_By_Default_Flag] bit NOT NULL,
  [AutoAssignLimit_Flag] bit NOT NULL,
  [AutoAssignLimit_Amount] int NOT NULL,
  [Id] uniqueidentifier NOT NULL,
  [Send_To_Bundled_Flag] bit NOT NULL
);
GO

-- dbo.SR_BoardMbr
CREATE TABLE [dbo].[SR_BoardMbr] (
  [SR_BoardMbr_RecID] int NOT NULL,
  [SR_Board_RecID] int NULL,
  [Member_RecID] int NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_BoardNotify
CREATE TABLE [dbo].[SR_BoardNotify] (
  [SR_BoardNotify_RecID] int NOT NULL,
  [SR_Board_RecID] int NULL,
  [WF_NotifyWho_ID] nvarchar(2) NULL,
  [Specific_Member] int NULL,
  [Specific_Email] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Code
CREATE TABLE [dbo].[SR_Code] (
  [SR_Code_RecID] int NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [SR_Code_Name] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NULL,
  [SR_Board_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Description_Markdown] nvarchar(max) NULL,
  [Description] nvarchar(4000) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Combine
CREATE TABLE [dbo].[SR_Combine] (
  [SR_Service_RecID] int NOT NULL,
  [SR_Service_Child_RecID] int NOT NULL,
  [Merged_Flag] int NOT NULL
);
GO

-- dbo.SR_Config
CREATE TABLE [dbo].[SR_Config] (
  [SR_Config_RecID] int NOT NULL,
  [Config_RecID] int NULL,
  [SR_Service_RecID] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.SR_Dependency
CREATE TABLE [dbo].[SR_Dependency] (
  [SR_Dependency_RecID] int NOT NULL,
  [SR_Service_Successor_RecID] int NOT NULL,
  [SR_Service_Predecessor_RecID] int NULL,
  [PM_Phase_Predecessor_RecID] int NULL,
  [Lag_Days] int NOT NULL,
  [Close_Predecessor_Before_Start] bit NOT NULL,
  [Include_NonWorking_Days] bit NOT NULL
);
GO

-- dbo.SR_Detail
CREATE TABLE [dbo].[SR_Detail] (
  [SR_Detail_RecID] int NOT NULL,
  [SR_Service_RecID] int NOT NULL,
  [Problem_Flag] bit NOT NULL,
  [Resolution_Flag] bit NOT NULL,
  [InternalAnalysis_Flag] bit NOT NULL,
  [Document_Flag] bit NOT NULL,
  [Internal_Member_Flag] bit NOT NULL,
  [External_Source_Flag] bit NOT NULL,
  [Date_Format] int NULL,
  [Date_Created] datetime NOT NULL,
  [Created_By] nvarchar(150) NULL,
  [Last_Update] datetime NOT NULL,
  [Updated_By] nvarchar(150) NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Member_RecID] int NULL,
  [Contact_RecID] int NULL,
  [DB_Timestamp] timestamp NOT NULL,
  [Date_Created_UTC] datetime NULL,
  [Last_Update_UTC] datetime NULL,
  [Merged_Flag] bit NOT NULL,
  [Bundled_Flag] bit NOT NULL,
  [Original_Author] nvarchar(150) NULL,
  [Issue_Flag] bit NOT NULL,
  [SR_Detail_Notes] nvarchar(4000) NULL,
  [SR_Detail_Notes_Markdown] nvarchar(max) NULL,
  [Sentiment_Score] decimal(9,2) NULL,
  [Created_By_Parent_Flag] bit NOT NULL
);
GO

-- dbo.SR_Impact
CREATE TABLE [dbo].[SR_Impact] (
  [SR_Impact_RecID] int NOT NULL,
  [SR_Impact_Name] nvarchar(10) NOT NULL,
  [SR_Impact_Desc] nvarchar(200) NOT NULL,
  [Default_Flag] bit NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Location
CREATE TABLE [dbo].[SR_Location] (
  [SR_Location_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Default_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Location_ID] char(1) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Notify_Type
CREATE TABLE [dbo].[SR_Notify_Type] (
  [SR_Notify_Type_ID] char(1) NOT NULL,
  [Description] nvarchar(50) NULL
);
GO

-- dbo.SR_Service
CREATE TABLE [dbo].[SR_Service] (
  [SR_Service_RecID] int NOT NULL,
  [SR_Type_RecID] int NULL,
  [SR_Location_RecID] int NULL,
  [SR_Status_RecID] int NOT NULL,
  [SR_Source_RecID] int NULL,
  [SR_Urgency_RecID] int NOT NULL,
  [SR_Team_RecID] int NULL,
  [Entered_By] nvarchar(15) NULL,
  [Entered_Notify_Flag] bit NOT NULL,
  [Date_Entered] datetime NULL,
  [Date_Req] date NULL,
  [Company_RecID] int NULL,
  [Contact_RecID] int NULL,
  [Assigned_By_RecID] int NULL,
  [Assigned_Notify_Flag] bit NOT NULL,
  [Billing_Unit_RecID] int NULL,
  [Red_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime NULL,
  [Address_Line1] nvarchar(50) NULL,
  [Address_Line2] nvarchar(50) NULL,
  [City] nvarchar(50) NULL,
  [State_ID] nvarchar(50) NULL,
  [Zip] nvarchar(12) NULL,
  [Contact_Name] nvarchar(62) NULL,
  [PhoneNbr] nvarchar(20) NULL,
  [Extension] nvarchar(15) NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Email_Address] nvarchar(250) NULL,
  [Summary] nvarchar(100) NULL,
  [Publish_Flag] bit NOT NULL,
  [Closed_By] nvarchar(15) NULL,
  [Date_Closed] datetime NULL,
  [DB_Timestamp] timestamp NULL,
  [Hours_Budget] decimal(18,2) NULL,
  [Time_Billable_Flag] bit NULL,
  [TimeBillable_Flag] bit NULL,
  [ExpBillable_Flag] bit NULL,
  [Activity_Class_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [PO_Number] nvarchar(50) NULL,
  [Reference] nvarchar(50) NULL,
  [EstRevenue_removed] decimal(18,2) NULL,
  [BillComplete_Flag] bit NULL,
  [BillUnapp_Flag] bit NULL,
  [Bill_Method] char(1) NULL,
  [BillSR_Flag] bit NULL,
  [Billing_Amount] decimal(18,2) NULL,
  [Company_Address_RecID] int NULL,
  [TimeInvoice_Flag] bit NULL,
  [ExpInvoice_Flag] bit NULL,
  [ProdInvoice_Flag] bit NULL,
  [ProdBillable_Flag] bit NULL,
  [AGR_Header_RecID] int NULL,
  [Override_Flag] bit NULL,
  [SR_Billing_Method_ID] char(1) NULL,
  [AGR_Amount] decimal(18,2) NULL,
  [AGR_Month] smallint NULL,
  [AGR_Year] smallint NULL,
  [SR_Severity_RecID] int NULL,
  [SR_Impact_RecID] int NULL,
  [SR_Board_RecID] int NOT NULL,
  [Billing_Company_RecID] int NULL,
  [Billing_Address_RecID] int NULL,
  [External_Hours_Worked] decimal(18,0) NULL,
  [Opportunity_RecID] int NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [Approved_Flag] bit NOT NULL,
  [External_Xref] nvarchar(100) NULL,
  [Site_Name] nvarchar(50) NULL,
  [Sub_Date_Accepted] datetime NULL,
  [Sub_Company_Name] nvarchar(50) NULL,
  [Sub_Company_RecID] int NULL,
  [Sub_Contact_Name] nvarchar(62) NULL,
  [Sub_Contact_RecID] int NULL,
  [Sub_Email_Address] nvarchar(250) NULL,
  [Sub_PhoneNbr] nvarchar(30) NULL,
  [Sub_Extension] nvarchar(15) NULL,
  [Sub_Billing_Method_ID] char(1) NULL,
  [Sub_Billing_Amount] decimal(18,2) NULL,
  [Sub_Ticket_Nbr] nvarchar(25) NULL,
  [Sub_Override_Flag] bit NULL,
  [Rejected_Flag] bit NOT NULL,
  [Date_Rejected] datetime NULL,
  [Cn_Survey_Completed_Flag] bit NOT NULL,
  [PM_Phase_RecID] int NULL,
  [WBS_Code] varchar(50) NULL,
  [Rec_Type] char(1) NOT NULL,
  [EmailContact_Flag] bit NULL,
  [EmailResource_Flag] bit NULL,
  [EmailCC_Flag] bit NULL,
  [EmailCC] nvarchar(4000) NULL,
  [CustUpdate_Flag] char(1) NULL,
  [Country_RecID] int NULL,
  [KB_Category_RecID] int NULL,
  [KB_SubCategory_RecID] int NULL,
  [KB_Link_RecID] int NULL,
  [KB_Link_Type] char(1) NULL,
  [SR_SLA_RecID] int NULL,
  [Order_Header_RecID] int NULL,
  [Exp_Billable_Flag] bit NULL,
  [SR_SubType_RecID] int NULL,
  [Date_Entered_UTC] datetime NULL,
  [Last_Update_UTC] datetime NULL,
  [Date_Closed_UTC] datetime NULL,
  [Sub_Date_Accepted_UTC] datetime NULL,
  [Date_Rejected_UTC] datetime NULL,
  [SR_SubTypeItem_RecID] int NULL,
  [Restrict_Downpayment_Flag] bit NOT NULL,
  [Est_Start_Date_UTC] date NULL,
  [Ava_Validated_Flag] bit NOT NULL,
  [Ticket_Owner_RecID] int NULL,
  [Billing_Contact_RecID] int NULL,
  [Billing_Terms_RecID] int NULL,
  [Tax_Code_RecID] int NULL,
  [Shipping_Company_RecID] int NULL,
  [Shipping_Address_RecID] int NULL,
  [Shipping_Contact_RecID] int NULL,
  [Est_Time_Revenue] decimal(18,2) NOT NULL,
  [Est_Expense_Revenue] decimal(18,2) NOT NULL,
  [Est_Product_Revenue] decimal(18,2) NOT NULL,
  [Est_Time_Cost] decimal(18,2) NOT NULL,
  [Est_Expense_Cost] decimal(18,2) NOT NULL,
  [Est_Product_Cost] decimal(18,2) NOT NULL,
  [Currency_RecID] int NOT NULL,
  [SR_Service_RecID_Computed] nvarchar(10) NULL,
  [IsClosed_Flag] bit NOT NULL,
  [Parent_RecID] int NULL,
  [Latest_Sentiment_Score] decimal(9,2) NULL,
  [Id] uniqueidentifier NULL,
  [Send_To_Bundled_Flag] bit NULL,
  [Billing_Log_RecID] int NULL
);
GO

-- dbo.SR_Service_Audit
CREATE TABLE [dbo].[SR_Service_Audit] (
  [SR_Service_Audit_RecID] int NOT NULL,
  [SR_Service_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Audit_SubType_RecID] smallint NULL,
  [Audit_Data_Type_Format_RecID] int NOT NULL,
  [OldValue_Text] nvarchar(2000) NULL,
  [NewValue_Text] nvarchar(2000) NULL,
  [Affected_Record] nvarchar(100) NULL,
  [DM_Document_RecID] int NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [RecID] int NULL,
  [OldValue_Locale_Key_RecID] int NULL,
  [NewValue_Locale_Key_RecID] int NULL,
  [AffectedRecord_Locale_Key_RecId] int NULL
);
GO

-- dbo.SR_Service_Calculated
CREATE TABLE [dbo].[SR_Service_Calculated] (
  [SR_Service_Calculated_RecID] int NOT NULL,
  [SR_Service_RecID] int NOT NULL,
  [ResourceList] nvarchar(150) NULL,
  [SR_SLA_RecID] int NULL,
  [Expected_Responded_Expiration_Date_UTC] datetime NULL,
  [Expected_Resplan_Expiration_Date_UTC] datetime NULL,
  [Expected_Resolution_Expiration_Date_UTC] datetime NULL,
  [Min_Expected_Expiration_Date_UTC] datetime NULL,
  [Last_Update] datetime NULL,
  [SLA_Status_Text] nvarchar(15) NULL,
  [Expected_Responded_Expiration_Date] datetime NULL,
  [Expected_Resplan_Expiration_Date] datetime NULL,
  [Expected_Resolution_Expiration_Date] datetime NULL,
  [Min_Expected_Expiration_Date] datetime NULL
);
GO

-- dbo.SR_Service_Fixed_Fee_IW
CREATE TABLE [dbo].[SR_Service_Fixed_Fee_IW] (
  [SR_Service_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Company_OL_RecID] int NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [Inv_Amount] decimal(18,6) NOT NULL,
  [Rec_Date] datetime NULL,
  [Tax_RecID] int NULL,
  [Tax_Desc] nvarchar(50) NULL,
  [Activity_Class_RecID] int NULL,
  [Company_Address_RecID] int NULL,
  [AGR_Amount] decimal(18,6) NOT NULL,
  [Customer_PO] nvarchar(50) NULL,
  [Shipping_Address_RecID] int NULL,
  [Shipping_Company_RecID] int NULL,
  [Iso_Code] nvarchar(3) NULL,
  [Currency_RecID] int NOT NULL
);
GO

-- dbo.SR_Service_Following
CREATE TABLE [dbo].[SR_Service_Following] (
  [Member_RecID] int NOT NULL,
  [SR_Service_RecID] int NOT NULL
);
GO

-- dbo.SR_Service_Integrator_Tag
CREATE TABLE [dbo].[SR_Service_Integrator_Tag] (
  [SR_Service_Integrator_Tag_Recid] int NOT NULL,
  [SR_Service_RecID] int NOT NULL,
  [System_Integrator_Tag_RecID] int NOT NULL,
  [Member_Recid] int NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.SR_Service_SLA_Workflow
CREATE TABLE [dbo].[SR_Service_SLA_Workflow] (
  [SR_Service_SLA_Workflow_RecID] int NOT NULL,
  [SR_Service_RecID] int NOT NULL,
  [Responded_Minutes] int NOT NULL,
  [Responded_By] nvarchar(15) NULL,
  [Date_Responded_UTC] datetime2(0) NULL,
  [Resplan_Minutes] int NOT NULL,
  [Resplan_BY] nvarchar(15) NULL,
  [Date_Resplan_UTC] datetime2(0) NULL,
  [Resolved_Minutes] int NOT NULL,
  [Resolved_By] nvarchar(15) NULL,
  [Date_Resolved_UTC] datetime2(0) NULL,
  [Waiting_Flag] bit NOT NULL,
  [Minutes_Waiting] int NOT NULL,
  [Minutes_Before_Waiting] int NOT NULL,
  [Escalation_Start_Date_UTC] datetime2(0) NULL,
  [Notification_History] nvarchar(4000) NULL,
  [Responded_Skipped_Minutes] int NOT NULL,
  [Resplan_Skipped_Minutes] int NOT NULL,
  [Overall_Start_Date_UTC] datetime2(0) NULL,
  [Previous_SR_Status_RecID] int NULL,
  [Date_Status_Changed_UTC] datetime2(0) NULL
);
GO

-- dbo.SR_Service_Stopwatch
CREATE TABLE [dbo].[SR_Service_Stopwatch] (
  [SR_Service_Stopwatch_RecID] int NOT NULL,
  [SR_Service_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Start_Time_UTC] datetime NULL,
  [Paused_Start_UTC] datetime2(0) NULL,
  [Stop_Time_UTC] datetime NULL,
  [Total_Paused_Time] int NULL,
  [Notes] nvarchar(4000) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Mobile_Guid] uniqueidentifier NULL,
  [SR_Service_Mobile_Guid] uniqueidentifier NULL,
  [SR_Status_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [Billable_Options_RecID] int NULL,
  [Activity_Class_RecID] int NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Agr_Header_RecID] int NULL,
  [Internal_Notes] nvarchar(4000) NULL,
  [Notes_Discussion_Flag] bit NOT NULL,
  [Notes_Internal_Flag] bit NOT NULL,
  [Notes_Resolution_Flag] bit NOT NULL,
  [Email_Contact_Flag] bit NOT NULL,
  [Email_Resources_Flag] bit NOT NULL,
  [Status] nvarchar(7) NOT NULL
);
GO

-- dbo.SR_Service_User_Defined_Field_Value
CREATE TABLE [dbo].[SR_Service_User_Defined_Field_Value] (
  [SR_Service_User_Defined_Field_Value_RecID] bigint NOT NULL,
  [SR_Service_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [User_Defined_Field_Value] nvarchar(1000) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.SR_Severity
CREATE TABLE [dbo].[SR_Severity] (
  [SR_Severity_RecID] int NOT NULL,
  [SR_Severity_Name] nvarchar(10) NULL,
  [SR_Severity_Desc] nvarchar(200) NULL,
  [Default_Flag] bit NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Signoff
CREATE TABLE [dbo].[SR_Signoff] (
  [SR_Signoff_RecID] int NOT NULL,
  [SR_Signoff_Name] nvarchar(50) NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Logo_Visible] bit NOT NULL,
  [Company_Info_Visible] bit NOT NULL,
  [BL_Terms_Visible] bit NOT NULL,
  [SR_Summary_Visible] bit NOT NULL,
  [SR_Detail_Visible] bit NOT NULL,
  [SR_Tasks_Visible] bit NOT NULL,
  [SR_Tasks_Option] char(1) NOT NULL,
  [SR_Configurations_Visible] bit NOT NULL,
  [SR_Internal_Visible] bit NOT NULL,
  [SR_Resolution_Visible] bit NOT NULL,
  [Time_Visible] bit NOT NULL,
  [Time_Member_Visible] bit NOT NULL,
  [Time_Date_Visible] bit NOT NULL,
  [Time_Start_End_Visible] bit NOT NULL,
  [Time_Bill_Visible] bit NOT NULL,
  [Time_Hours_Visible] bit NOT NULL,
  [Time_Rate_Visible] bit NOT NULL,
  [Time_Ext_Amt_Visible] bit NOT NULL,
  [Time_Tax_Visible] bit NOT NULL,
  [Time_Manual_Visible] bit NOT NULL,
  [Time_Manual_Option] smallint NOT NULL,
  [Time_W_Type_Visible] bit NOT NULL,
  [Time_Agr_Visible] bit NOT NULL,
  [Time_Notes_Visible] bit NOT NULL,
  [EX_Visible] bit NOT NULL,
  [EX_Member_Visible] bit NOT NULL,
  [EX_Date_Visible] bit NOT NULL,
  [EX_Type_Visible] bit NOT NULL,
  [EX_Bill_Visible] bit NOT NULL,
  [EX_Amount_Visible] bit NOT NULL,
  [EX_Agr_Visible] bit NOT NULL,
  [EX_Notes_Visible] bit NOT NULL,
  [EX_Manual_Visible] bit NOT NULL,
  [EX_Manual_Option] smallint NOT NULL,
  [IV_Visible] bit NOT NULL,
  [IV_Desc_Visible] bit NOT NULL,
  [IV_Bill_Visible] bit NOT NULL,
  [IV_Qty_Visible] bit NOT NULL,
  [IV_Price_Visible] bit NOT NULL,
  [IV_Ext_Amt_Visible] bit NOT NULL,
  [IV_Agr_Visible] bit NOT NULL,
  [IV_Tax_Visible] bit NOT NULL,
  [IV_Manual_Visible] bit NOT NULL,
  [IV_Manual_Option] smallint NOT NULL,
  [Tech_Signoff_Visible] bit NOT NULL,
  [Signoff_Text_Visible] bit NOT NULL,
  [Signoff_Text] nvarchar(4000) NOT NULL,
  [Cust_Signoff_Visible] bit NOT NULL,
  [BL_Methods_Visible] bit NOT NULL,
  [BL_Methods_Text] nvarchar(2000) NOT NULL,
  [Credit_Card_Visible] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Default_FF_Flag] bit NULL,
  [EX_Tax_Visible] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_SLA
CREATE TABLE [dbo].[SR_SLA] (
  [SR_SLA_RecID] int NOT NULL,
  [SLA_Name] nvarchar(50) NULL,
  [I1_S1_RecID] int NULL,
  [I2_S1_RecID] int NULL,
  [I3_S1_RecID] int NULL,
  [I1_S2_RecID] int NULL,
  [I2_S2_RecID] int NULL,
  [I3_S2_RecID] int NULL,
  [I1_S3_RecID] int NULL,
  [I2_S3_RecID] int NULL,
  [I3_S3_RecID] int NULL,
  [Responded_Hours] decimal(18,2) NULL,
  [ResPlan_Hours] decimal(18,2) NULL,
  [Resolution_Hours] decimal(18,2) NULL,
  [Responded_Pct] int NULL,
  [ResPlan_Pct] int NULL,
  [Resolution_Pct] int NULL,
  [Default_Flag] bit NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Hours_Type_ID] char(1) NULL,
  [Office_Calendar_RecID] int NULL,
  [Application_Order] smallint NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_SLA_Hours_Type
CREATE TABLE [dbo].[SR_SLA_Hours_Type] (
  [Hours_Type_ID] char(1) NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Sort_Order] int NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.SR_SLAPriority
CREATE TABLE [dbo].[SR_SLAPriority] (
  [SR_SLAPriority_RecID] int NOT NULL,
  [SR_SLA_RecID] int NOT NULL,
  [SR_Urgency_RecID] int NOT NULL,
  [Responded_Hours] decimal(18,2) NULL,
  [ResPlan_Hours] decimal(18,2) NULL,
  [Resolution_Hours] decimal(18,2) NULL,
  [Responded_Pct] int NULL,
  [ResPlan_Pct] int NULL,
  [Resolution_Pct] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Source
CREATE TABLE [dbo].[SR_Source] (
  [SR_Source_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Standard_Template_Option
CREATE TABLE [dbo].[SR_Standard_Template_Option] (
  [SR_Standard_Template_Option_RecID] int NOT NULL,
  [Option_Name] nvarchar(30) NOT NULL,
  [Sort_Order] int NOT NULL,
  [Inactive_Flag] bit NOT NULL
);
GO

-- dbo.SR_Status
CREATE TABLE [dbo].[SR_Status] (
  [SR_Status_RecID] int NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NOT NULL,
  [Sort_Order] smallint NULL,
  [Board_Flag] bit NOT NULL,
  [Closed_Flag] bit NOT NULL,
  [No_Time_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [SR_Notify_Type_ID] char(1) NULL,
  [Member_RecID] int NULL,
  [Workflow_Step] int NULL,
  [Resolved_Flag] bit NULL,
  [NoEscalation_Flag] bit NULL,
  [Escalation_Level] smallint NULL,
  [SR_Board_RecID] int NULL,
  [Customer_Portal_Flag] bit NULL,
  [SV_SetupHdr_RecID] int NULL,
  [Inactive_Flag] bit NOT NULL,
  [Long_Description] nvarchar(500) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Status_Indicator_RecID] int NULL,
  [Custom_Status_Indicator_Description] nvarchar(30) NULL,
  [RoundRobinCatchall_Flag] bit NULL,
  [SaveTimeAsNote_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_SubType
CREATE TABLE [dbo].[SR_SubType] (
  [SR_SubType_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [SR_Board_RecID] int NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_SubTypeItem
CREATE TABLE [dbo].[SR_SubTypeItem] (
  [SR_SubTypeItem_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [SR_Board_RecID] int NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Targets
CREATE TABLE [dbo].[SR_Targets] (
  [SR_Targets_RecID] int NOT NULL,
  [Level1] decimal(18,2) NULL,
  [Level2] decimal(18,2) NULL,
  [Level3] decimal(18,2) NULL,
  [Level4] decimal(18,2) NULL,
  [Level5] decimal(18,2) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.SR_Task
CREATE TABLE [dbo].[SR_Task] (
  [SR_Task_RecID] int NOT NULL,
  [SR_Service_RecID] int NOT NULL,
  [Priority] int NULL,
  [SR_Code_RecID] int NULL,
  [Notes] nvarchar(max) NULL,
  [Assign_To_RecID] int NULL,
  [Closed_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Resolution] nvarchar(max) NULL,
  [Child_RecID] int NULL,
  [billing_sr] int NULL,
  [Mobile_Guid] uniqueidentifier NOT NULL,
  [DB_Timestamp] timestamp NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Summary] nvarchar(100) NULL
);
GO

-- dbo.SR_Team
CREATE TABLE [dbo].[SR_Team] (
  [SR_Team_RecID] int NOT NULL,
  [Description] nvarchar(30) NULL,
  [Member_RecID] int NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Default_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [SR_Board_RecID] int NULL,
  [DeleteNotify_Flag] bit NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [RoundRobin_Flag] bit NULL,
  [Default_RoundRobin_Flag] bit NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Team_Mbr
CREATE TABLE [dbo].[SR_Team_Mbr] (
  [SR_Team_Mbr_RecID] int NOT NULL,
  [SR_Team_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.SR_Ticket_Link
CREATE TABLE [dbo].[SR_Ticket_Link] (
  [Sr_Ticket_Link_Recid] int NOT NULL,
  [Name] nvarchar(50) NOT NULL,
  [Regex_Match] nvarchar(50) NOT NULL,
  [Url] nvarchar(4000) NOT NULL,
  [Enabled] bit NOT NULL,
  [Readonly] bit NOT NULL,
  [Updated_By] nvarchar(50) NOT NULL,
  [Last_Update_Utc] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Type
CREATE TABLE [dbo].[SR_Type] (
  [SR_Type_RecID] int NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Description] nvarchar(50) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Default_Flag] bit NULL,
  [ActiveType] char(1) NULL,
  [SR_Board_RecID] int NULL,
  [Inactive_Flag] bit NOT NULL,
  [RFC_Flag] bit NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Type_SubType_SubTypeItem_Template
CREATE TABLE [dbo].[SR_Type_SubType_SubTypeItem_Template] (
  [SR_Type_SubType_SubTypeItem_Template_RecID] int NOT NULL,
  [SR_Type_RecID] int NOT NULL,
  [SR_SubType_RecID] int NOT NULL,
  [SRT_Service_RecID] int NULL,
  [Auto_Apply] bit NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [SR_SubTypeItem_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Type_SubType_SubTypeItem_Template_Option
CREATE TABLE [dbo].[SR_Type_SubType_SubTypeItem_Template_Option] (
  [SR_Type_SubType_SubTypeItem_Template_Option_RecID] int NOT NULL,
  [SR_Type_SubType_SubTypeItem_Template_RecID] int NOT NULL,
  [SR_Standard_Template_Option_RecID] int NOT NULL,
  [Append_Flag] bit NOT NULL,
  [Overwrite_Flag] bit NOT NULL,
  [Ignore_Flag] bit NOT NULL
);
GO

-- dbo.SR_Urgency
CREATE TABLE [dbo].[SR_Urgency] (
  [SR_Urgency_RecID] int NOT NULL,
  [Color] nvarchar(50) NULL,
  [Image_Link] nvarchar(100) NULL,
  [Description] nvarchar(50) NULL,
  [Sort_Order] int NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Response_Hours] decimal(18,2) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Created_By] nvarchar(15) NULL,
  [Locale_Key_RecID] int NULL,
  [Urgency_Level] nvarchar(15) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SR_Workflow
CREATE TABLE [dbo].[SR_Workflow] (
  [SR_Workflow_RecID] int NOT NULL,
  [SR_Status_RecID] int NOT NULL,
  [Workflow_Step] int NULL,
  [SR_Notify_Type_ID] nvarchar(2) NULL,
  [Member_RecID] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Specific_Email] nvarchar(255) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SRT_Recurrence
CREATE TABLE [dbo].[SRT_Recurrence] (
  [SRT_Recurrence_RecID] int NOT NULL,
  [RecurType] nvarchar(2) NULL,
  [RecurInterval] smallint NULL,
  [DaysOfWeek] nvarchar(15) NULL,
  [AbsDayNbr] smallint NULL,
  [AbsMonthNbr] smallint NULL,
  [SelectInterval] smallint NULL
);
GO

-- dbo.SRT_Resource
CREATE TABLE [dbo].[SRT_Resource] (
  [SRT_Resource_RecID] int NOT NULL,
  [SRT_Service_RecID] int NOT NULL,
  [WF_NotifyWho_ID] nvarchar(2) NULL,
  [Specific_Member] int NULL,
  [Date_Time_Start] datetime NULL,
  [Date_Time_End] datetime NULL,
  [Reminder_Flag] bit NOT NULL,
  [Reminder_Minutes] int NULL,
  [Schedule_Status_RecID] int NULL,
  [SRT_Recurrence_RecID] int NULL,
  [Hours_Sched] decimal(18,2) NULL,
  [Duration] int NULL,
  [Last_Update] datetime NULL,
  [Updated_By] nvarchar(15) NULL,
  [SR_Location_RecID] int NULL,
  [Parent_SRT_Resource_RecID] int NULL,
  [Time_Zone_RecID] int NULL,
  [End_After] int NULL
);
GO

-- dbo.SRT_Service
CREATE TABLE [dbo].[SRT_Service] (
  [SRT_Service_RecID] int NOT NULL,
  [SR_Type_RecID] int NULL,
  [SR_Location_RecID] int NULL,
  [SR_Status_RecID] int NOT NULL,
  [SR_Source_RecID] int NULL,
  [SR_Urgency_RecID] int NULL,
  [SR_Team_RecID] int NULL,
  [Company_RecID] int NULL,
  [Contact_RecID] int NULL,
  [Assigned_By_RecID] int NULL,
  [Assigned_Notify_Flag] bit NOT NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Summary] nvarchar(100) NULL,
  [Problem] nvarchar(max) NULL,
  [Hours_Budget] decimal(18,2) NULL,
  [Internal_Analysis] nvarchar(max) NULL,
  [TimeBillable_Flag] bit NOT NULL,
  [ExpBillable_Flag] bit NOT NULL,
  [Activity_Class_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [PO_Number] nvarchar(25) NULL,
  [Reference] nvarchar(50) NULL,
  [BillComplete_Flag] bit NOT NULL,
  [EstRevenue_removed] decimal(18,2) NULL,
  [BillSR_Flag] bit NOT NULL,
  [Billing_Amount] decimal(18,2) NULL,
  [BillUnapp_Flag] bit NOT NULL,
  [Company_Address_RecID] int NULL,
  [Override_Flag] bit NOT NULL,
  [TimeInvoice_Flag] bit NOT NULL,
  [ExpInvoice_Flag] bit NOT NULL,
  [ProdInvoice_Flag] bit NOT NULL,
  [ProdBillable_Flag] bit NOT NULL,
  [AGR_Header_RecID] int NULL,
  [SR_Billing_Method_ID] char(1) NULL,
  [SR_Severity_RecID] int NULL,
  [SR_Impact_RecID] int NULL,
  [SRT_Template_Name] nvarchar(100) NOT NULL,
  [Schedule_Days_Before] int NOT NULL,
  [Service_Days_Before] int NOT NULL,
  [AttachSchedToNew_Flag] bit NOT NULL,
  [SR_Board_RecID] int NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Template_Flag] bit NOT NULL,
  [Template_RecID] int NULL,
  [SR_SubType_RecID] int NULL,
  [EmailContact_Flag] bit NOT NULL,
  [EmailResource_Flag] bit NOT NULL,
  [EmailCC_Flag] bit NOT NULL,
  [EmailCC] nvarchar(1000) NULL,
  [SR_SubTypeItem_RecID] int NULL,
  [Restrict_Downpayment_Flag] bit NOT NULL,
  [Ticket_Owner_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Est_Time_Revenue] decimal(18,2) NOT NULL,
  [Est_Expense_Revenue] decimal(18,2) NOT NULL,
  [Est_Product_Revenue] decimal(18,2) NOT NULL,
  [Est_Time_Cost] decimal(18,2) NOT NULL,
  [Est_Expense_Cost] decimal(18,2) NOT NULL,
  [Est_Product_Cost] decimal(18,2) NOT NULL,
  [Resolution] nvarchar(max) NULL,
  [Ticket_Owner_NotifyWho_RecID] int NULL,
  [Problem_Markdown] nvarchar(max) NULL,
  [Internal_Analysis_Markdown] nvarchar(max) NULL,
  [Resolution_Markdown] nvarchar(max) NULL
);
GO

-- dbo.SRT_Service_Audit
CREATE TABLE [dbo].[SRT_Service_Audit] (
  [SRT_Service_Audit_RecID] int NOT NULL,
  [SRT_Service_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Audit_Source_RecID] smallint NOT NULL,
  [Audit_Type_RecID] smallint NOT NULL,
  [Audit_SubType_RecID] smallint NULL,
  [Audit_Data_Type_Format_RecID] int NOT NULL,
  [OldValue_Text] nvarchar(2000) NULL,
  [NewValue_Text] nvarchar(2000) NULL,
  [Affected_Record] nvarchar(100) NULL,
  [DM_Document_RecID] int NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [AffectedRecord_Locale_Key_RecId] int NULL,
  [OldValue_Locale_Key_RecID] int NULL,
  [NewValue_Locale_Key_RecID] int NULL
);
GO

-- dbo.SRT_Service_Resource_Gen
CREATE TABLE [dbo].[SRT_Service_Resource_Gen] (
  [SRT_Service_Resource_Gen_RecID] int NOT NULL,
  [SRT_Service_RecID] int NOT NULL,
  [Schedule_RecID] int NULL,
  [Date_GenSched_UTC] datetime2(0) NOT NULL,
  [SRT_Resource_RecID] int NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.SRT_Service_Ticket_Gen
CREATE TABLE [dbo].[SRT_Service_Ticket_Gen] (
  [SRT_Service_Ticket_Gen_RecID] int NOT NULL,
  [SRT_Service_RecID] int NOT NULL,
  [SR_Service_RecID] int NULL,
  [Date_GenSR_UTC] datetime2(0) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.SRT_Task
CREATE TABLE [dbo].[SRT_Task] (
  [SRT_Task_RecID] int NOT NULL,
  [SRT_Service_RecID] int NOT NULL,
  [Priority] int NULL,
  [SR_Code_RecID] int NULL,
  [Notes] nvarchar(max) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Parent_SRT_Task_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.States
CREATE TABLE [dbo].[States] (
  [State_ID] nvarchar(50) NOT NULL,
  [State_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Country_RecID] int NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL,
  [Disabled] bit NOT NULL
);
GO

-- dbo.Status_Indicator
CREATE TABLE [dbo].[Status_Indicator] (
  [Status_Indicator_RecID] int NOT NULL,
  [Status_Indicator_ID] nchar(1) NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Color] nvarchar(7) NULL,
  [Icon] nvarchar(250) NULL
);
GO

-- dbo.STS_Client
CREATE TABLE [dbo].[STS_Client] (
  [STS_Client_RecID] int NOT NULL,
  [Name] nvarchar(100) NOT NULL,
  [Description] nvarchar(1000) NULL,
  [Client_Type] char(1) NOT NULL,
  [Client_ID] nvarchar(200) NULL,
  [Client_Secret] nvarchar(4000) NULL,
  [Member_RecID] int NULL,
  [Inactive_Flag] bit NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.sub_shipto
CREATE TABLE [dbo].[sub_shipto] (
  [Sub_ShipTo_RecID] int NOT NULL,
  [Sub_ShipTo_Desc] nvarchar(50) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL
);
GO

-- dbo.Survey
CREATE TABLE [dbo].[Survey] (
  [Survey_RecID] int NOT NULL,
  [Survey_Name] nvarchar(30) NULL,
  [Notes] nvarchar(max) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Survey_Line
CREATE TABLE [dbo].[Survey_Line] (
  [Survey_Line_RecID] int NOT NULL,
  [Survey_RecID] int NULL,
  [Survey_Line_ID] nvarchar(25) NULL,
  [Seq_Nbr] decimal(18,2) NULL,
  [Question] nvarchar(max) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.SV_SetupDtl
CREATE TABLE [dbo].[SV_SetupDtl] (
  [SV_SetupDtl_RecID] int NOT NULL,
  [SV_SetupHdr_RecID] int NOT NULL,
  [Detail_Visible] bit NOT NULL,
  [Seq_Nbr] smallint NULL,
  [Question_Text] nvarchar(1000) NULL,
  [Option1_Visible] bit NOT NULL,
  [Option1_Caption] nvarchar(100) NULL,
  [Option1_Points] smallint NULL,
  [Option2_Visible] bit NOT NULL,
  [Option2_Caption] nvarchar(100) NULL,
  [Option2_Points] smallint NULL,
  [Option3_Visible] bit NOT NULL,
  [Option3_Caption] nvarchar(100) NULL,
  [Option3_Points] smallint NULL,
  [Option4_Visible] bit NOT NULL,
  [Option4_Caption] nvarchar(100) NULL,
  [Option4_Points] smallint NULL,
  [Option5_Visible] bit NOT NULL,
  [Option5_Caption] nvarchar(100) NULL,
  [Option5_Points] smallint NULL,
  [NoAnswer_Points] smallint NULL,
  [Comment] nvarchar(2000) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Option6_Visible] bit NOT NULL,
  [Option6_Caption] nvarchar(100) NULL,
  [Option6_Points] smallint NULL,
  [Option7_Visible] bit NOT NULL,
  [Option7_Caption] nvarchar(100) NULL,
  [Option7_Points] smallint NULL,
  [Option8_Visible] bit NOT NULL,
  [Option8_Caption] nvarchar(100) NULL,
  [Option8_Points] smallint NULL,
  [Option9_Visible] bit NOT NULL,
  [Option9_Caption] nvarchar(100) NULL,
  [Option9_Points] smallint NULL,
  [Option10_Visible] bit NOT NULL,
  [Option10_Caption] nvarchar(100) NULL,
  [Option10_Points] smallint NULL,
  [Is_Open_Ended] bit NOT NULL,
  [Is_Required] bit NOT NULL,
  [Option11_Visible] bit NOT NULL,
  [Option11_Caption] nvarchar(100) NULL,
  [Option11_Points] smallint NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.SV_SetupHdr
CREATE TABLE [dbo].[SV_SetupHdr] (
  [SV_SetupHdr_RecID] int NOT NULL,
  [SV_Name] nvarchar(50) NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Logo_Visible] bit NOT NULL,
  [Header_Text_Visible] bit NOT NULL,
  [Header_Text] nvarchar(4000) NULL,
  [Footer_Text_Visible] bit NOT NULL,
  [Footer_Text] nvarchar(500) NULL,
  [Footer_Contact_Visible] bit NOT NULL,
  [Footer_Contact_Mbr] int NULL,
  [Thanks_Message] nvarchar(4000) NULL,
  [NotifyWho_ID] nvarchar(2) NULL,
  [NotifyWho_Email] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.System_Audit
CREATE TABLE [dbo].[System_Audit] (
  [System_Audit_RecID] int NOT NULL,
  [Rec_Type] char(2) NULL,
  [RecID] int NULL,
  [Mobile_Guid] uniqueidentifier NULL,
  [Member_RecID] int NULL,
  [Date_Deleted] datetime NOT NULL,
  [Sr_Service_RecID] int NULL,
  [Delete_Flag] bit NOT NULL,
  [Date_Deleted_UTC] datetime NOT NULL,
  [Audit_Details] nvarchar(2000) NULL
);
GO

-- dbo.System_Integrator_Tag
CREATE TABLE [dbo].[System_Integrator_Tag] (
  [System_Integrator_Tag_RecID] int NOT NULL,
  [Text] nvarchar(50) NOT NULL,
  [Member_Recid] int NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.System_Menu_Screens
CREATE TABLE [dbo].[System_Menu_Screens] (
  [system_menu_screens_recid] int NOT NULL,
  [system_menus_recid] int NOT NULL,
  [system_screens_recid] int NOT NULL,
  [sort_order] int NOT NULL
);
GO

-- dbo.System_Menus
CREATE TABLE [dbo].[System_Menus] (
  [system_menus_recid] int NOT NULL,
  [menu_id] nvarchar(15) NOT NULL,
  [description] nvarchar(50) NOT NULL,
  [favorites_flag] bit NOT NULL,
  [sort_order] int NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.System_MM_Audit
CREATE TABLE [dbo].[System_MM_Audit] (
  [System_MM_Audit_RecID] int NOT NULL,
  [Audit_Text] nvarchar(2000) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NULL
);
GO

-- dbo.System_MM_Screens
CREATE TABLE [dbo].[System_MM_Screens] (
  [System_MM_Screens_RecID] int NOT NULL,
  [MM_Category] nvarchar(30) NULL,
  [MM_Description] nvarchar(200) NULL,
  [assembly_name] nvarchar(200) NULL,
  [control_filename] nvarchar(200) NULL,
  [screen_id] nvarchar(30) NOT NULL,
  [MM_Category_Locale_Key_RecID] int NULL,
  [MM_Description_Locale_Key_RecID] int NULL
);
GO

-- dbo.system_report_custom_field
CREATE TABLE [dbo].[system_report_custom_field] (
  [System_Report_Custom_Field_Recid] int NOT NULL,
  [Field_Caption_Override] nvarchar(50) NULL,
  [System_Report_Field_Type_Recid] int NOT NULL,
  [Parameter_Name] nvarchar(50) NOT NULL,
  [Parameter_TypeName] nvarchar(50) NOT NULL,
  [System_Report_Custom_Field_Group_Recid] int NOT NULL,
  [Show_Default_Flag] bit NOT NULL
);
GO

-- dbo.system_report_custom_field_group
CREATE TABLE [dbo].[system_report_custom_field_group] (
  [System_Report_Custom_Field_Group_Recid] int NOT NULL,
  [Group_Name] nvarchar(50) NOT NULL
);
GO

-- dbo.system_report_field
CREATE TABLE [dbo].[system_report_field] (
  [System_Report_Field_Recid] int NOT NULL,
  [System_Reports_Recid] int NOT NULL,
  [System_Report_Field_Type_Recid] int NOT NULL,
  [Parameter_Name] nvarchar(50) NOT NULL,
  [Field_Caption_Override] nvarchar(50) NULL,
  [Required_Flag] bit NOT NULL,
  [Set_Default_Flag] bit NOT NULL,
  [Sort_Order] int NULL,
  [Override_Parameter_Name] nvarchar(50) NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.system_report_field_dependency
CREATE TABLE [dbo].[system_report_field_dependency] (
  [System_Report_Field_Dependency_Recid] int NOT NULL,
  [System_Report_Field_Recid] int NOT NULL,
  [Depends_On_Field_Recid] int NOT NULL
);
GO

-- dbo.system_report_field_option
CREATE TABLE [dbo].[system_report_field_option] (
  [System_Report_Field_Option_Recid] int NOT NULL,
  [System_Report_Field_Recid] int NOT NULL,
  [Name] nvarchar(50) NOT NULL,
  [Value] nvarchar(50) NOT NULL,
  [Order_By_Field] int NULL,
  [Locale_Key_RecID] int NOT NULL
);
GO

-- dbo.system_report_field_type
CREATE TABLE [dbo].[system_report_field_type] (
  [System_Report_Field_Type_Recid] int NOT NULL,
  [Type_Name] nvarchar(100) NULL,
  [System_Report_Field_Type_ID] nvarchar(50) NOT NULL
);
GO

-- dbo.system_report_range_parameter
CREATE TABLE [dbo].[system_report_range_parameter] (
  [system_report_range_parameter_recid] int NOT NULL,
  [token] nvarchar(4) NULL,
  [description] nvarchar(max) NULL,
  [display_order] int NULL,
  [last_update] datetime2(0) NULL,
  [updated_by] nvarchar(15) NULL,
  [standard] bit NOT NULL,
  [single] bit NOT NULL,
  [monthly] bit NOT NULL,
  [Locale_Key_RecID] int NOT NULL
);
GO

-- dbo.System_Report_Spec
CREATE TABLE [dbo].[System_Report_Spec] (
  [System_Report_Spec_RecID] int NOT NULL,
  [System_Reports_RecID] int NOT NULL,
  [System_Report_Spec_Type_RecID] int NOT NULL,
  [Spec_Name] nvarchar(50) NOT NULL,
  [Sort_Order] int NOT NULL,
  [Spec_Description] nvarchar(max) NOT NULL,
  [Spec_Screen] nvarchar(100) NULL,
  [Spec_Field] nvarchar(100) NULL,
  [System_Report_Spec_Name_Type_RecID] smallint NOT NULL
);
GO

-- dbo.System_Report_Spec_Name_Type
CREATE TABLE [dbo].[System_Report_Spec_Name_Type] (
  [System_Report_Spec_Name_Type_RecID] smallint NOT NULL,
  [System_Report_Spec_Name_Type_Name] nvarchar(100) NOT NULL
);
GO

-- dbo.System_Report_Spec_Type
CREATE TABLE [dbo].[System_Report_Spec_Type] (
  [System_Report_Spec_Type_RecID] int NOT NULL,
  [Type_Name] nvarchar(50) NOT NULL
);
GO

-- dbo.System_Reports
CREATE TABLE [dbo].[System_Reports] (
  [System_Reports_RecID] int NOT NULL,
  [Report_Name] nvarchar(100) NULL,
  [Report_Link] nvarchar(max) NULL,
  [Module_Function_RecID] int NOT NULL,
  [Description] nvarchar(150) NULL,
  [assembly_name] nvarchar(150) NULL,
  [control_name] varchar(150) NULL,
  [dotnet_flag] bit NULL,
  [Custom_Flag] bit NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Group_Name] nvarchar(50) NULL,
  [Parameter_Prefix] nvarchar(50) NULL,
  [Parameter_Separator] nvarchar(50) NULL,
  [Parameter_Suffix] nvarchar(50) NULL,
  [Generated_Flag] bit NOT NULL,
  [Spec_Description] nvarchar(max) NULL,
  [Spec_Purpose] nvarchar(max) NULL,
  [Reporting_Services_Flag] bit NOT NULL,
  [Reports_Menu_Flag] bit NOT NULL,
  [Report_Updated] bit NOT NULL,
  [Restrict_Flag] bit NOT NULL,
  [Display_Module_Function_RecID] int NULL,
  [Parameter_Name_Value_Separator] nvarchar(50) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Help_Screen_Name] nvarchar(150) NULL,
  [Report_Name_Locale_Key_RecID] int NULL,
  [Report_Description_Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.System_Reports_Label
CREATE TABLE [dbo].[System_Reports_Label] (
  [System_Reports_Label_RecID] int NOT NULL,
  [System_Reports_RecID] int NOT NULL,
  [Report_Control_Name] nvarchar(100) NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Last_Updated] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.System_Screen_Owner_Level
CREATE TABLE [dbo].[System_Screen_Owner_Level] (
  [System_Screen_Owner_Level_RecID] int NOT NULL,
  [System_Screens_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL
);
GO

-- dbo.System_Screens
CREATE TABLE [dbo].[System_Screens] (
  [system_screens_recid] int NOT NULL,
  [screen_id] nvarchar(20) NOT NULL,
  [module_function_recid] int NULL,
  [description] nvarchar(50) NOT NULL,
  [icon] nvarchar(50) NOT NULL,
  [directory] nvarchar(2000) NULL,
  [filename] nvarchar(30) NOT NULL,
  [notes] nvarchar(500) NULL,
  [sort_order] int NULL,
  [External_Flag] bit NOT NULL,
  [assembly_name] nvarchar(200) NULL,
  [control_filename] nvarchar(50) NULL,
  [dotnet_flag] bit NULL,
  [default_favorite] int NOT NULL,
  [No_Security_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NULL,
  [Date_Created_UTC] datetime2(0) NULL,
  [Created_By] nvarchar(15) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Origin] nvarchar(2000) NULL,
  [Enabled_Flag] bit NOT NULL,
  [Client_ID] nvarchar(255) NULL,
  [Id] uniqueidentifier NOT NULL,
  [Asio_Flag] bit NOT NULL
);
GO

-- dbo.System_Setup_Screens
CREATE TABLE [dbo].[System_Setup_Screens] (
  [System_Setup_Screens_RecID] int NOT NULL,
  [Setup_Category] nvarchar(30) NULL,
  [Setup_Table] nvarchar(50) NULL,
  [Setup_Done_Flag] bit NULL,
  [Setup_Done_By] nvarchar(15) NULL,
  [Setup_Done_Date] datetime NULL,
  [Module_ID] char(2) NULL,
  [assembly_name] nvarchar(200) NULL,
  [control_filename] nvarchar(200) NULL,
  [Restrict_Flag] bit NOT NULL,
  [ConnectWise_Labs_RecID] int NULL,
  [Setup_Description_Locale_Key_RecID] int NOT NULL,
  [Setup_Category_Locale_Key_RecID] int NULL,
  [Setup_Table_Locale_Key_RecID] int NULL,
  [Asio_Visible_Flag] bit NOT NULL
);
GO

-- dbo.System_Table
CREATE TABLE [dbo].[System_Table] (
  [Description] nvarchar(50) NOT NULL,
  [Message] nvarchar(max) NULL,
  [Last_Update] datetime2(0) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NULL,
  [System_Table_RecID] int NOT NULL,
  [System_Setup_Screens_RecID] int NULL,
  [Value_Type] nvarchar(50) NOT NULL
);
GO

-- dbo.Tab_Identifier
CREATE TABLE [dbo].[Tab_Identifier] (
  [Tab_Identifier_RecID] int NOT NULL,
  [Tab_Key] nvarchar(50) NOT NULL,
  [System_Screens_RecID] int NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [Can_Embed] bit NOT NULL
);
GO

-- dbo.Tally_Table
CREATE TABLE [dbo].[Tally_Table] (
  [Number] int NOT NULL
);
GO

-- dbo.Tax_Code
CREATE TABLE [dbo].[Tax_Code] (
  [Tax_Code_ID] nvarchar(8) NULL,
  [Tax_Code_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Country_RecID] int NULL,
  [PiggyBack_Flag] bit NULL,
  [Date_Effective] date NULL,
  [DisplayDetail_Flag] bit NULL,
  [CodeCaption] nvarchar(25) NULL,
  [Date_Cancel] date NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Core_Entity_Updated_By] nvarchar(15) NOT NULL,
  [Core_Entity_Last_Update_UTC] datetime2(0) NOT NULL,
  [Core_Entity_ID] uniqueidentifier NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Tax_Code_ExemptIV
CREATE TABLE [dbo].[Tax_Code_ExemptIV] (
  [Tax_Code_ExemptIV_RecID] int NOT NULL,
  [Tax_Code_RecID] int NOT NULL,
  [IV_Type_RecID] int NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Core_Entity_Updated_By] nvarchar(15) NOT NULL,
  [Core_Entity_Last_Update_UTC] datetime2(0) NOT NULL,
  [Core_Entity_ID] uniqueidentifier NULL
);
GO

-- dbo.Tax_Code_Level
CREATE TABLE [dbo].[Tax_Code_Level] (
  [Tax_Code_Level_RecID] int NOT NULL,
  [Tax_Code_RecID] int NOT NULL,
  [Tax_Rate] decimal(18,6) NOT NULL,
  [Tax_Rate_Type] char(1) NOT NULL,
  [Tax_Max] decimal(18,6) NULL,
  [Tax_Xref] nvarchar(50) NULL,
  [Agency_Xref] nvarchar(100) NULL,
  [Level_Caption] nvarchar(25) NULL,
  [Tax_Services] bit NOT NULL,
  [Tax_Expenses] bit NOT NULL,
  [Tax_Products] bit NOT NULL,
  [Single_Unit] int NOT NULL,
  [Single_Unit_Minimum] decimal(18,6) NULL,
  [Single_Unit_Maximum] decimal(18,6) NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Core_Entity_Updated_By] nvarchar(15) NOT NULL,
  [Core_Entity_Last_Update_UTC] datetime2(0) NULL,
  [Core_Entity_ID] uniqueidentifier NULL
);
GO

-- dbo.Tax_Integration
CREATE TABLE [dbo].[Tax_Integration] (
  [Tax_Integration_RecID] int NOT NULL,
  [Tax_Integration_Type] nvarchar(20) NOT NULL
);
GO

-- dbo.TE_Charge_Code
CREATE TABLE [dbo].[TE_Charge_Code] (
  [TE_Charge_Code_RecID] int NOT NULL,
  [Description] nvarchar(50) NULL,
  [Company_RecID] int NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Activity_Class_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [Expense_Flag] bit NOT NULL,
  [Time_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Billable_Flag] bit NOT NULL,
  [EX_Type_Flag] bit NOT NULL,
  [Invoice_Flag] bit NULL,
  [Integration_Xref] nvarchar(50) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.TE_Period
CREATE TABLE [dbo].[TE_Period] (
  [TE_Period_Setup_RecID] int NULL,
  [Period] int NOT NULL,
  [Date_Start] datetime NOT NULL,
  [Date_End] datetime NOT NULL,
  [Date_DeadLine] datetime NOT NULL,
  [TE_Period_RecID] int NOT NULL,
  [Last_Updated_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.TE_Period_Setup
CREATE TABLE [dbo].[TE_Period_Setup] (
  [Owner_Level_RecID] int NULL,
  [TE_Period_Setup_RecID] int NOT NULL,
  [Period_Apply_To] char(1) NOT NULL,
  [Year] smallint NOT NULL,
  [Future_Periods] smallint NULL,
  [TE_Period_Type_RecID] int NOT NULL,
  [Date_First_Period_End] datetime NOT NULL,
  [Semi_Monthly_1_Ends] int NULL,
  [Semi_Monthly_2_Ends] int NULL,
  [Semi_Monthly_Last_Day] bit NULL,
  [Monthly_Ends] int NULL,
  [Monthly_Last_Day] bit NULL,
  [Deadline_Days] int NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.TE_Period_Type
CREATE TABLE [dbo].[TE_Period_Type] (
  [TE_Period_Type_RecID] int NOT NULL,
  [TE_Period_Type_ID] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Periods_Per_Year] int NOT NULL,
  [Sort_Order] int NULL
);
GO

-- dbo.TE_State
CREATE TABLE [dbo].[TE_State] (
  [TE_State_RecID] int NOT NULL,
  [TE_State_Name] nvarchar(30) NULL,
  [TE_Status_ID] smallint NULL,
  [TE_State_ID] smallint NULL
);
GO

-- dbo.TE_Status
CREATE TABLE [dbo].[TE_Status] (
  [TE_Status_RecID] int NOT NULL,
  [TE_Status_ID] smallint NOT NULL,
  [Description] nvarchar(50) NULL,
  [Action] nvarchar(50) NULL,
  [Last_Updated_UTC] datetime2(0) NOT NULL,
  [Locale_Key_RecID] int NULL
);
GO

-- dbo.Team_Role
CREATE TABLE [dbo].[Team_Role] (
  [Team_Role_RecID] int NOT NULL,
  [Role_Desc] nvarchar(20) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Ticket_Vendor
CREATE TABLE [dbo].[Ticket_Vendor] (
  [Ticket_Vendor_RecID] int NOT NULL,
  [Ticket_Vendor_ID] nvarchar(15) NOT NULL,
  [Name] nvarchar(50) NOT NULL,
  [Setup_Panel_Name] nvarchar(1024) NOT NULL,
  [Setup_Panel_Assembly] nvarchar(1024) NOT NULL,
  [Inactive_Flag] bit NOT NULL
);
GO

-- dbo.Time_Audit
CREATE TABLE [dbo].[Time_Audit] (
  [Time_Audit_RecID] int NOT NULL,
  [Time_Sheet_RecID] int NULL,
  [Time_RecID] int NULL,
  [Member_RecID] int NULL,
  [Date_Audit] datetime NULL,
  [TE_Status_ID] smallint NULL,
  [Audit_Type_RecID] smallint NULL,
  [Audit_Source_RecID] smallint NULL,
  [Locale_Key_RecID] int NULL,
  [Old_Value] nvarchar(max) NULL,
  [New_Value] nvarchar(max) NULL,
  [Last_Update_UTC] datetime2(3) NOT NULL,
  [Reason] nvarchar(255) NULL,
  [Old_Value_Locale_Key_RecID] int NULL,
  [New_Value_Locale_Key_RecID] int NULL
);
GO

-- dbo.Time_Entry
CREATE TABLE [dbo].[Time_Entry] (
  [Company_RecID] int NOT NULL,
  [Time_RecID] int NOT NULL,
  [Entered_By] nvarchar(15) NULL,
  [Member_ID] nvarchar(15) NULL,
  [Date_Start] datetime NULL,
  [Time_Start] datetime NULL,
  [Time_End] datetime NULL,
  [Hourly_Rate] smallmoney NULL,
  [Hours_Bill] decimal(18,2) NOT NULL,
  [Invoice_Flag] bit NOT NULL,
  [Last_Update] datetime NULL,
  [Updated_By] nvarchar(15) NULL,
  [PM_Project_RecID] int NULL,
  [Hours_Actual] decimal(18,2) NOT NULL,
  [Billable_Flag] bit NOT NULL,
  [Billing_Log_RecID] int NULL,
  [SR_Service_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [Activity_Class_RecID] int NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [TE_Status_ID] smallint NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Time_Sheet_RecID] int NULL,
  [Member_RecID] int NULL,
  [TE_Charge_Code_RecID] int NULL,
  [Hours_Invoiced] decimal(18,2) NULL,
  [Adjustment] decimal(18,2) NOT NULL,
  [Member_Type_RecID] int NULL,
  [Agr_Amount] decimal(18,2) NOT NULL,
  [Standard_Rate] decimal(18,2) NULL,
  [Agr_Header_RecID] int NULL,
  [Agr_Hours] decimal(18,2) NULL,
  [Agr_Month] smallint NULL,
  [Agr_Year] smallint NULL,
  [Effective_Rate] decimal(18,2) NULL,
  [Agr_Adjustment] decimal(18,2) NULL,
  [Hours_Deduct] decimal(18,2) NULL,
  [Contact_RecID] int NULL,
  [SO_Activity_RecID] int NULL,
  [Mobile_GUID] uniqueidentifier NOT NULL,
  [billing_sr] int NULL,
  [Signature_RecID] int NULL,
  [Signature_Hours] decimal(18,2) NULL,
  [exchange_href] nvarchar(300) NULL,
  [TE_Problem_Flag] bit NOT NULL,
  [TE_Resolution_Flag] bit NOT NULL,
  [TE_InternalAnalysis_Flag] bit NOT NULL,
  [Document_Flag] bit NOT NULL,
  [Date_Format] int NULL,
  [DB_Timestamp] timestamp NOT NULL,
  [Time_Start_UTC] datetime NULL,
  [Time_End_UTC] datetime NULL,
  [Last_Update_UTC] datetime NULL,
  [Date_Entered_UTC] datetime NOT NULL,
  [Overage_Rate] smallmoney NULL,
  [Extended_Invoice_Amount] decimal(31,6) NULL,
  [Extended_Bill_Amount] decimal(31,6) NULL,
  [Notification_History] varchar(4000) NOT NULL,
  [Merged_Flag] bit NOT NULL,
  [Internal_Note] nvarchar(max) NULL,
  [Reference] nvarchar(100) NULL,
  [Original_Author] nvarchar(150) NULL,
  [Cost_Per_Hour] nvarchar(2000) NOT NULL,
  [Override_Flag] bit NOT NULL,
  [Issue_Flag] bit NOT NULL,
  [Notes] nvarchar(4000) NULL,
  [Notes_Markdown] nvarchar(max) NULL,
  [Charge_To_RecID] int NULL,
  [Charge_To_Type] nvarchar(13) NULL
);
GO

-- dbo.Time_Entry_IW
CREATE TABLE [dbo].[Time_Entry_IW] (
  [Time_RecID] int NOT NULL,
  [Company_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Company_OL_RecID] int NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [PM_Project_RecID] int NULL,
  [SR_Service_RecID] int NULL,
  [SR_Service_Group] int NULL,
  [Bill_Type] char(1) NULL,
  [PM_Phase_RecID] int NULL,
  [WIP_Hours] decimal(18,6) NULL,
  [WIP_Amount] decimal(18,6) NOT NULL,
  [Inv_Hours] decimal(18,6) NOT NULL,
  [Inv_Amount] decimal(18,6) NOT NULL,
  [Member_RecID] int NOT NULL,
  [Billable_Text] nvarchar(3) NULL,
  [Hourly_Rate] decimal(18,6) NOT NULL,
  [Rec_Date] datetime NULL,
  [Tax_RecID] int NULL,
  [Agr_Header_RecID] int NULL,
  [PM_Activity_Recid] int NULL,
  [Tax_Desc] nvarchar(50) NULL,
  [Billing_Start_Date] datetime NULL,
  [Fixed_Fee] decimal(18,6) NULL,
  [SR_Status_RecID] int NULL,
  [Activity_Class_RecID] int NULL,
  [Activity_Type_RecID] int NULL,
  [Company_Address_RecID] int NULL,
  [AGR_Amount] decimal(18,6) NOT NULL,
  [Customer_PO] nvarchar(50) NULL,
  [Shipping_Address_RecID] int NULL,
  [Shipping_Company_RecID] int NULL,
  [Iso_Code] nvarchar(3) NULL,
  [Currency_RecID] int NOT NULL,
  [Overage_Rate] decimal(18,6) NULL
);
GO

-- dbo.Time_Sheet
CREATE TABLE [dbo].[Time_Sheet] (
  [Time_Sheet_RecID] int NOT NULL,
  [TE_Period_RecID] int NOT NULL,
  [Member_RecID] int NULL,
  [TE_Status_ID] smallint NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Reversed_Flag] bit NOT NULL
);
GO

-- dbo.Time_Zone
CREATE TABLE [dbo].[Time_Zone] (
  [Time_Zone_RecID] int NOT NULL,
  [Time_Zone_Name] nvarchar(50) NOT NULL,
  [Hours_Offset] decimal(18,2) NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Time_Zone_Name_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.time_zone_name
CREATE TABLE [dbo].[time_zone_name] (
  [Time_Zone_Name_RecID] int NOT NULL,
  [Name] nvarchar(50) NOT NULL,
  [Invalid_Flag] bit NOT NULL
);
GO

-- dbo.Time_Zone_Offsets
CREATE TABLE [dbo].[Time_Zone_Offsets] (
  [Time_Zone_Offset_RecID] int NOT NULL,
  [StartDate] datetime NOT NULL,
  [EndDate] datetime NOT NULL,
  [OffsetFromUtc] decimal(18,2) NOT NULL,
  [Time_Zone_Name_RecID] int NULL,
  [StartDate_Utc] datetime NOT NULL,
  [EndDate_Utc] datetime NOT NULL
);
GO

-- dbo.TimeAccrual_Type
CREATE TABLE [dbo].[TimeAccrual_Type] (
  [TimeAccrual_Type_ID] char(1) NOT NULL,
  [TimeAccrual_Desc] char(20) NULL
);
GO

-- dbo.Today_Category
CREATE TABLE [dbo].[Today_Category] (
  [Category_RecID] int NOT NULL,
  [Name] nvarchar(30) NULL,
  [Sort_Order] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Owner_Level_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Today_Custom
CREATE TABLE [dbo].[Today_Custom] (
  [Today_Custom_RecID] int NOT NULL,
  [Member_RecID] int NOT NULL,
  [Background_Color] nvarchar(15) NULL,
  [Font_Color] nvarchar(15) NULL,
  [Module_Heading_Background_Color] nvarchar(15) NULL,
  [Module_Heading_Font_Color] nvarchar(15) NULL,
  [Columns] int NULL,
  [Line1_Left] int NULL,
  [Line2_Left] int NULL,
  [Client_Height] int NULL,
  [Client_Width] int NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.Today_Custom_Module
CREATE TABLE [dbo].[Today_Custom_Module] (
  [Today_Custom_Module_RecID] int NOT NULL,
  [Today_Custom_RecID] int NOT NULL,
  [Today_Module_RecID] int NOT NULL,
  [Module_Width] int NULL,
  [Module_Height] int NULL,
  [Module_Top] int NULL,
  [Module_Left] int NULL
);
GO

-- dbo.Today_Dashboard
CREATE TABLE [dbo].[Today_Dashboard] (
  [Today_Dashboard_RecID] int NOT NULL,
  [Link] nvarchar(2083) NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.Today_Links
CREATE TABLE [dbo].[Today_Links] (
  [Link_RecID] int NOT NULL,
  [Category_RecID] int NULL,
  [Description] nvarchar(50) NULL,
  [Sort_Order] int NULL,
  [New_Window_Flag] bit NOT NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [link] nvarchar(500) NULL,
  [Owner_Level_RecID] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Date_Created_UTC] datetime2(0) NOT NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Today_Module
CREATE TABLE [dbo].[Today_Module] (
  [Today_Module_RecID] int NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [Module_ID] nvarchar(15) NOT NULL,
  [Module_Width] int NULL,
  [Module_Height] int NULL,
  [Image_Path] nvarchar(255) NOT NULL
);
GO

-- dbo.ttsco_DivXRef
CREATE TABLE [dbo].[ttsco_DivXRef] (
  [Pkey] int NOT NULL,
  [SR_Type_RecID] int NULL,
  [SR_SubType_RecID] int NULL,
  [Division] int NULL,
  [Descr] varchar(255) NULL
);
GO

-- dbo.User_Defined_Field
CREATE TABLE [dbo].[User_Defined_Field] (
  [User_Defined_Field_RecID] int NOT NULL,
  [SF_Field_Type_ID] char(1) NOT NULL,
  [SF_Entry_Type_ID] char(1) NOT NULL,
  [Field_ID] nvarchar(20) NULL,
  [Nbr_Decimals] smallint NULL,
  [Caption] nvarchar(25) NOT NULL,
  [Required_Flag] bit NOT NULL,
  [Pod_RecID] int NOT NULL,
  [ScreenID] nvarchar(50) NOT NULL,
  [Full_View_Sort_Order] smallint NOT NULL,
  [Full_View_Visible_Flag] bit NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Read_Only_Flag] bit NOT NULL,
  [Multiline_Flag] bit NOT NULL,
  [Multiline_Order] smallint NULL,
  [Created_UTC] datetime2(0) NOT NULL,
  [Created_By] nvarchar(15) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Tooltip] nvarchar(1000) NULL,
  [Button_Url] nvarchar(1000) NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.User_Defined_Field_Billing_Unit
CREATE TABLE [dbo].[User_Defined_Field_Billing_Unit] (
  [User_Defined_Field_Billing_Unit_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [Billing_Unit_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.User_Defined_Field_Board
CREATE TABLE [dbo].[User_Defined_Field_Board] (
  [User_Defined_Field_Board_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [SR_Board_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.User_Defined_Field_Option
CREATE TABLE [dbo].[User_Defined_Field_Option] (
  [User_Defined_Field_Option_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [User_Defined_Field_Option] nvarchar(1000) NOT NULL,
  [Sort_Order] smallint NOT NULL,
  [Default_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Inactive_Flag] bit NOT NULL
);
GO

-- dbo.User_Defined_Field_Owner_Level
CREATE TABLE [dbo].[User_Defined_Field_Owner_Level] (
  [User_Defined_Field_Owner_Level_RecID] int NOT NULL,
  [User_Defined_Field_RecID] int NOT NULL,
  [Owner_Level_RecID] int NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL
);
GO

-- dbo.User_Defined_Required_Field
CREATE TABLE [dbo].[User_Defined_Required_Field] (
  [User_Defined_Required_Field_RecID] int NOT NULL,
  [Pod_RecID] int NOT NULL,
  [Field_ID] nvarchar(50) NULL,
  [Required_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Display_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NOT NULL,
  [API_Field_ID] nvarchar(50) NULL
);
GO

-- dbo.Warehouse
CREATE TABLE [dbo].[Warehouse] (
  [Warehouse_RecID] int NOT NULL,
  [Company_RecID] int NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Member_RecID] int NULL,
  [Company_Address_RecID] int NULL,
  [Warehouse_Name] nvarchar(50) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Default_Flag] bit NULL,
  [OverallDefault_Flag] bit NOT NULL,
  [Location_Xref] nvarchar(10) NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Contact_RecID] int NULL,
  [Locked_Flag] bit NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.Warehouse_Bin
CREATE TABLE [dbo].[Warehouse_Bin] (
  [Warehouse_Bin_RecID] int NOT NULL,
  [Warehouse_RecID] int NULL,
  [Description] nvarchar(50) NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [Warehouse_Bin_Length] nvarchar(10) NULL,
  [Warehouse_Bin_Width] nvarchar(10) NULL,
  [Warehouse_Bin_Height] nvarchar(10) NULL,
  [Warehouse_Bin_Weight] int NULL,
  [Min_Quantity] decimal(18,2) NULL,
  [Max_Quantity] decimal(18,2) NULL,
  [Overflow_Bin] int NULL,
  [Member_RecID] int NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Default_Flag] bit NULL,
  [Inactive_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.WF_Attach
CREATE TABLE [dbo].[WF_Attach] (
  [WF_Attach_RecID] int NOT NULL,
  [WF_Attach_Code] char(1) NOT NULL,
  [Description] nvarchar(30) NOT NULL,
  [Restrict_To_Service_Flag] bit NOT NULL,
  [Restrict_To_Invoice_Flag] bit NOT NULL,
  [Restrict_To_PO_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.wf_batchschedule
CREATE TABLE [dbo].[wf_batchschedule] (
  [BatchSchedule_ID] char(1) NOT NULL,
  [BatchSchedule_Desc] nvarchar(50) NULL,
  [SLA_Flag] bit NULL
);
GO

-- dbo.WF_NotifyAction_Emails
CREATE TABLE [dbo].[WF_NotifyAction_Emails] (
  [WF_NotifyAction_Emails_RecID] bigint NOT NULL,
  [WF_NotifyAction_RecID] int NOT NULL,
  [Contact_RecID] int NULL,
  [Bcc_Flag] bit NOT NULL
);
GO

-- dbo.WF_NotifyActions
CREATE TABLE [dbo].[WF_NotifyActions] (
  [WF_NotifyActions_RecID] int NOT NULL,
  [WF_NotifyEvents_RecID] int NOT NULL,
  [WF_NotifyType_ID] nvarchar(2) NOT NULL,
  [WF_NotifyWho_ID] nvarchar(2) NOT NULL,
  [Specific_Member] int NULL,
  [Specific_Email] nvarchar(640) NULL,
  [MemberFrom] nvarchar(15) NULL,
  [EmailFrom] nvarchar(320) NULL,
  [Subject] nvarchar(100) NULL,
  [Notes] nvarchar(max) NULL,
  [SO_Activity_Type_RecID] int NULL,
  [SO_Act_Status_RecID] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [SR_Status_RecID] int NULL,
  [WF_Track_Header_RecID] int NULL,
  [Days_To_Execute] int NOT NULL,
  [SR_Board_RecID] int NULL,
  [WF_Attach_RecID] int NULL,
  [Group_RecID] int NULL,
  [Template_RecID] int NULL,
  [WF_NotifyFrom_ID] nvarchar(2) NULL,
  [Specific_Member_Email_From] int NULL,
  [SR_Type_RecID] int NULL,
  [Invoice_Min_Days] int NOT NULL,
  [Attached_WF_Track_Header_RecID] int NULL,
  [LT_Script_ID] int NULL,
  [LT_Script_Name] nvarchar(100) NULL,
  [SR_Fail_Status_RecID] int NULL,
  [Add_Notes_To_Detail_Flag] bit NOT NULL,
  [Add_Notes_To_IA_Flag] bit NOT NULL,
  [Add_Notes_To_Audit_Flag] bit NOT NULL,
  [SR_Urgency_RecID] int NULL,
  [Update_Owner_Flag] bit NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [SR_Team_RecID] int NULL,
  [Project_Team_RecID] int NULL,
  [SV_SetupHdr_RecID] int NULL,
  [CS_Survey_RecID] int NULL,
  [Attach_Configurations_For] nvarchar(7) NULL,
  [SR_SubType_RecID] int NULL,
  [SR_SubTypeItem_RecID] int NULL,
  [Config_Status_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.WF_NotifyActions_Attach
CREATE TABLE [dbo].[WF_NotifyActions_Attach] (
  [WF_NotifyActions_Attach_RecID] int NOT NULL,
  [WF_NotifyActions_RecID] int NOT NULL,
  [WF_Attach_RecID] int NOT NULL
);
GO

-- dbo.WF_NotifyConditions
CREATE TABLE [dbo].[WF_NotifyConditions] (
  [WF_NotifyConditions_RecID] int NOT NULL,
  [WF_NotifyEvents_RecID] int NOT NULL,
  [WF_NotifyTrigger_RecID] int NOT NULL,
  [Value] nvarchar(2000) NOT NULL,
  [Description] nvarchar(1000) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [User_Defined_Field_RecID] int NULL,
  [Operator] nvarchar(2) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.WF_NotifyCounter
CREATE TABLE [dbo].[WF_NotifyCounter] (
  [WF_NotifyCounter_RecID] int NOT NULL,
  [WF_NotifyEvents_RecID] int NOT NULL,
  [TableRef] nvarchar(50) NOT NULL,
  [TableRef_RecID] int NOT NULL,
  [Execution_Count] int NOT NULL,
  [LastRan] datetime NOT NULL
);
GO

-- dbo.WF_NotifyEvents
CREATE TABLE [dbo].[WF_NotifyEvents] (
  [WF_NotifyEvents_RecID] int NOT NULL,
  [WF_NotifyHeader_RecID] int NOT NULL,
  [ModifiedDescription] nvarchar(max) NULL,
  [SqlCode] nvarchar(max) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Execution_Frequency] int NULL,
  [Execution_FreqUnit] nvarchar(2) NULL,
  [Execution_Max] int NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL,
  [Date_Tested_UTC] datetime2(0) NULL,
  [Test_Records_Matched] int NULL
);
GO

-- dbo.WF_NotifyHeader
CREATE TABLE [dbo].[WF_NotifyHeader] (
  [WF_NotifyHeader_RecID] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Created] datetime2(0) NULL,
  [Created_By] nvarchar(15) NULL,
  [Table_Ref] nvarchar(50) NULL,
  [Owner_Level_RecID] int NULL,
  [Billing_Unit_RecID] int NULL,
  [BatchFlag] bit NULL,
  [BatchLastRan] datetime NULL,
  [BatchInterval] int NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [SR_Board_RecID] int NULL,
  [BatchSchedule_ID] char(1) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.WF_NotifyTableType
CREATE TABLE [dbo].[WF_NotifyTableType] (
  [WF_NotifyTableType_RecID] int NOT NULL,
  [Table_Ref] nvarchar(50) NULL,
  [Description] nvarchar(200) NULL,
  [ScreenID] nvarchar(20) NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.WF_NotifyTrigger
CREATE TABLE [dbo].[WF_NotifyTrigger] (
  [WF_NotifyTrigger_RecID] int NOT NULL,
  [WF_NotifyTrigger_ID] nvarchar(50) NOT NULL,
  [Description] nvarchar(100) NULL,
  [Table_Ref] nvarchar(50) NOT NULL,
  [ConditionSql] nvarchar(2000) NULL,
  [InputType] nvarchar(10) NULL,
  [CursorCondition] nvarchar(2000) NULL,
  [ApplySql] nvarchar(2000) NULL,
  [HasOptions_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.WF_NotifyType
CREATE TABLE [dbo].[WF_NotifyType] (
  [WF_NotifyType_RecID] int NOT NULL,
  [WF_NotifyType_ID] nvarchar(2) NOT NULL,
  [Description] nvarchar(50) NULL,
  [External_Flag] bit NOT NULL,
  [Restrict_To_Service_Flag] bit NOT NULL,
  [Restrict_To_Track] bit NOT NULL,
  [Restrict_To_Project] bit NOT NULL,
  [Restrict_To_Survey] bit NOT NULL,
  [Restrict_To_Order] bit NOT NULL,
  [Restrict_To_Config] bit NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.WF_NotifyWho
CREATE TABLE [dbo].[WF_NotifyWho] (
  [WF_NotifyWho_RecID] int NOT NULL,
  [WF_NotifyWho_ID] nvarchar(2) NOT NULL,
  [Description] nvarchar(50) NOT NULL,
  [External_Flag] bit NOT NULL,
  [Service_Flag] bit NOT NULL,
  [Sales_Flag] bit NOT NULL,
  [Invoicing_Flag] bit NOT NULL,
  [Agreement_Flag] bit NOT NULL,
  [Member_Flag] bit NULL,
  [Config_Flag] bit NULL,
  [MSP_Flag] bit NOT NULL,
  [Track_Flag] bit NULL,
  [Project_Flag] bit NOT NULL,
  [Procurement_Flag] bit NOT NULL,
  [KB_Flag] bit NOT NULL,
  [Locale_Key_RecID] int NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.WF_Track_Attach_Dtl
CREATE TABLE [dbo].[WF_Track_Attach_Dtl] (
  [WF_Track_Attach_Dtl_RecID] int NOT NULL,
  [WF_Track_Attach_Header_RecID] int NULL,
  [WF_NotifyActions_RecID] int NULL,
  [Cancel_Flag] bit NULL,
  [Canceled_By] nvarchar(15) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Date_Execute_UTC] datetime2(0) NULL,
  [Date_Run_UTC] datetime2(0) NULL,
  [Date_Canceled_UTC] datetime2(0) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.WF_Track_Attach_Header
CREATE TABLE [dbo].[WF_Track_Attach_Header] (
  [WF_Track_Attach_Header_RecID] int NOT NULL,
  [WF_Track_Header_RecID] int NULL,
  [Description] nvarchar(100) NULL,
  [Table_Reference] nvarchar(50) NULL,
  [RecID_Field] nvarchar(50) NULL,
  [RecID] int NULL,
  [Attached_By] nvarchar(15) NULL,
  [Updated_By] nvarchar(15) NULL,
  [Opportunity_RecID] int NULL,
  [Total_Actions] int NOT NULL,
  [Processed_Actions] int NOT NULL,
  [Last_WF_Track_Attach_Dtl_RecID] int NULL,
  [Marketing_Campaign_RecID] int NULL,
  [Date_Attached_UTC] datetime2(0) NOT NULL,
  [Date_End_UTC] datetime2(0) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL
);
GO

-- dbo.WF_Track_Header
CREATE TABLE [dbo].[WF_Track_Header] (
  [WF_Track_Header_RecID] int NOT NULL,
  [Description] nvarchar(100) NOT NULL,
  [Inactive_Flag] bit NOT NULL,
  [Updated_By] nvarchar(15) NULL,
  [Last_Update] datetime2(0) NOT NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Entered_By] nvarchar(15) NOT NULL,
  [Date_Entered_UTC] datetime2(0) NOT NULL,
  [Id] uniqueidentifier NOT NULL
);
GO

-- dbo.WisePay_Payments
CREATE TABLE [dbo].[WisePay_Payments] (
  [WisePay_Payment_RecID] int NOT NULL,
  [Billing_Application_RecID] int NOT NULL,
  [Payment_Date_UTC] datetime2(0) NULL,
  [WisePay_Reference] nvarchar(50) NOT NULL,
  [Batch_Payment_Amount] decimal(9,2) NULL,
  [WisePay_Batch_Href] nvarchar(120) NULL,
  [Last_Update_UTC] datetime2(0) NOT NULL,
  [Updated_By] nvarchar(15) NOT NULL,
  [Fee_Invoice_ID] int NULL,
  [Fee_Invoice_Number] nvarchar(30) NULL,
  [Fee_Invoice_Payment_Amount] decimal(9,2) NULL,
  [Fee_Invoice_Href] nvarchar(120) NULL
);
GO

-- dbo.Years
CREATE TABLE [dbo].[Years] (
  [Year] int NOT NULL
);
GO

-- dbo.z_PSA_Staging_Data
CREATE TABLE [dbo].[z_PSA_Staging_Data] (
  [Stage_Release] varchar(10) NOT NULL,
  [Code_Release] varchar(10) NOT NULL,
  [Table] varchar(50) NOT NULL,
  [Column] varchar(50) NOT NULL,
  [Threshold] int NOT NULL,
  [Count_Not_Converted] int NOT NULL,
  [Number_Of_Rows_Nightly] int NOT NULL,
  [Last_Staging_Date] datetime2(0) NOT NULL
);
GO


