[dbo].[AdvanceTransmissionDetail]
CREATE TABLE [dbo].[AdvanceTransmissionDetail]
(
[AdvanceTransmissionDetailID] [int] NOT NULL IDENTITY(1, 1),
[AdvanceTransmissionFID] [int] NOT NULL,
[AdvanceFID] [int] NOT NULL,
[WasTransmitted] [bit] NOT NULL CONSTRAINT [DF_AdvanceTransmissionDetail_WasTransmitted] DEFAULT ((0)),
[AdvanceBankingServiceProviderTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdvanceTransmissionDetail] ADD CONSTRAINT [PK_AdvanceTransmissionDetail] PRIMARY KEY CLUSTERED ([AdvanceTransmissionDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdvanceTransmissionDetail] ADD CONSTRAINT [IX_AdvanceTransmissionDetail_AdvanceFID] UNIQUE NONCLUSTERED ([AdvanceFID], [AdvanceBankingServiceProviderTypeFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_AdvanceTransmissionDetail_AdvanceFID_AdvanceBankingServiceProviderTypeFID_WasTransmitted] ON [dbo].[AdvanceTransmissionDetail] ([AdvanceFID], [AdvanceBankingServiceProviderTypeFID], [WasTransmitted]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_AdvanceTransmissionDetail_AdvanceTransmissionFID] ON [dbo].[AdvanceTransmissionDetail] ([AdvanceTransmissionFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdvanceTransmissionDetail] ADD CONSTRAINT [FK_AdvanceTransmissionDetail_AdvanceBankingServiceProviderType] FOREIGN KEY ([AdvanceBankingServiceProviderTypeFID]) REFERENCES [dbo].[AdvanceBankingServiceProviderType] ([AdvanceBankingServiceProviderTypeID])
GO
ALTER TABLE [dbo].[AdvanceTransmissionDetail] ADD CONSTRAINT [FK_AdvanceTransmissionDetail_Advance] FOREIGN KEY ([AdvanceFID]) REFERENCES [dbo].[Advance] ([PriKey])
GO
ALTER TABLE [dbo].[AdvanceTransmissionDetail] ADD CONSTRAINT [FK_AdvanceTransmissionDetail_AdvanceTransmission] FOREIGN KEY ([AdvanceTransmissionFID]) REFERENCES [dbo].[AdvanceTransmission] ([AdvanceTransmissionID])
GO
GRANT SELECT ON [dbo].[AdvanceTransmissionDetail] TO [MssExec]
GRANT INSERT ON [dbo].[AdvanceTransmissionDetail] TO [MssExec]
GRANT DELETE ON [dbo].[AdvanceTransmissionDetail] TO [MssExec]
GRANT UPDATE ON [dbo].[AdvanceTransmissionDetail] TO [MssExec]
GO