[dbo].[XmlInterfaceMobileCrewTimeActivityMap]
CREATE TABLE [dbo].[XmlInterfaceMobileCrewTimeActivityMap]
(
[XmlInterfaceMobileCrewTimeActivityMapID] [int] NOT NULL IDENTITY(1, 1),
[MobileCrewTimeActivityFID] [int] NOT NULL,
[XmlInterfaceFID] [int] NOT NULL,
[ExternalActivityCode] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IsPunchInActivity] [bit] NOT NULL CONSTRAINT [DF_XmlInterfaceMobileCrewTimeActivityMap_IsPunchInActivity] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceMobileCrewTimeActivityMap] ADD CONSTRAINT [PK_XmlInterfaceMobileCrewTimeActivityMap] PRIMARY KEY NONCLUSTERED ([XmlInterfaceMobileCrewTimeActivityMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceMobileCrewTimeActivityMap] ADD CONSTRAINT [IX_XmlInterfaceMobileCrewTimeActivityMap_XMLInterface_MobileCrewTimeActivity_IsPunchInActivity] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [MobileCrewTimeActivityFID], [IsPunchInActivity]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceMobileCrewTimeActivityMap] ADD CONSTRAINT [FK_XmlInterfaceMobileCrewTimeActivityMap_MobileCrewTimeActivity] FOREIGN KEY ([MobileCrewTimeActivityFID]) REFERENCES [dbo].[MobileCrewTimeActivity] ([MobileCrewTimeActivityID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlInterfaceMobileCrewTimeActivityMap] ADD CONSTRAINT [FK_XmlInterfaceMobileCrewTimeActivityMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlInterfaceMobileCrewTimeActivityMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlInterfaceMobileCrewTimeActivityMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlInterfaceMobileCrewTimeActivityMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlInterfaceMobileCrewTimeActivityMap] TO [MssExec]
GO