[dbo].[SafetySystemEquipment]
CREATE TABLE [dbo].[SafetySystemEquipment]
(
[SafetySystemEquipmentID] [int] NOT NULL IDENTITY(1, 1),
[EquipFID] [int] NOT NULL,
[SafetySystemEquipmentConditionTypeFID] [int] NULL,
[LastSanitizedDate] [datetime] NULL,
[NextSanitizedDate] [datetime] NULL,
[LastInspectionDate] [datetime] NULL,
[LastInspectionOdometer] [int] NULL,
[NextInspectionDate] [datetime] NULL,
[LastServiceDate] [datetime] NULL,
[LastServiceOdometer] [int] NULL,
[NextServiceDate] [datetime] NULL,
[LicenseDueDate] [datetime] NULL,
[InterstateCommerceCommissionDueDate] [datetime] NULL,
[AdministrativeHoldFlag] [bit] NOT NULL CONSTRAINT [DF_SafetySystemEquipment_AdministrativeHoldFlag] DEFAULT ((0)),
[LicensePlateNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DotInspectionDate] [datetime] NULL,
[DotExpirationDate] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SafetySystemEquipment] ADD CONSTRAINT [PK_SafetySystemEquipment] PRIMARY KEY NONCLUSTERED ([SafetySystemEquipmentID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SafetySystemEquipment] ADD CONSTRAINT [IX_SafetySystemEquipment_Equip] UNIQUE NONCLUSTERED ([EquipFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SafetySystemEquipment] ADD CONSTRAINT [FK_SafetySystemEquipment_Equip] FOREIGN KEY ([EquipFID]) REFERENCES [dbo].[Equip] ([PriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[SafetySystemEquipment] ADD CONSTRAINT [FK_SafetySystemEquipment_SafetySystemEquipmentConditionType] FOREIGN KEY ([SafetySystemEquipmentConditionTypeFID]) REFERENCES [dbo].[SafetySystemEquipmentConditionType] ([SafetySystemEquipmentConditionTypeID])
GO
GRANT SELECT ON [dbo].[SafetySystemEquipment] TO [MssExec]
GRANT INSERT ON [dbo].[SafetySystemEquipment] TO [MssExec]
GRANT DELETE ON [dbo].[SafetySystemEquipment] TO [MssExec]
GRANT UPDATE ON [dbo].[SafetySystemEquipment] TO [MssExec]
GO