[dbo].[ClaimPaymentDetail]
CREATE TABLE [dbo].[ClaimPaymentDetail]
(
[ClaimPaymentDetailID] [int] NOT NULL IDENTITY(1, 1),
[OrderFID] [int] NOT NULL,
[StatementDetailFID] [int] NOT NULL,
[ClaimFID] [int] NULL,
[TotalApplied] [money] NOT NULL CONSTRAINT [DF_ClaimPaymentDetail_TotalApplied] DEFAULT ((0)),
[IsGenerated] [bit] NOT NULL CONSTRAINT [DF_ClaimPaymentDetail_IsGenerated] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimPaymentDetail] ADD CONSTRAINT [PK_ClaimPaymentDetail] PRIMARY KEY NONCLUSTERED ([ClaimPaymentDetailID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimPaymentDetail] ADD CONSTRAINT [IX_ClaimPaymentDetail_StatementDetail] UNIQUE NONCLUSTERED ([StatementDetailFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimPaymentDetail] ADD CONSTRAINT [FK_ClaimPaymentDetail_Claim] FOREIGN KEY ([ClaimFID]) REFERENCES [dbo].[Claim] ([ClaimID])
GO
ALTER TABLE [dbo].[ClaimPaymentDetail] ADD CONSTRAINT [FK_ClaimPaymentDetail_Orders] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[ClaimPaymentDetail] ADD CONSTRAINT [FK_ClaimPaymentDetail_StatementDetail] FOREIGN KEY ([StatementDetailFID]) REFERENCES [dbo].[StatementDetail] ([SDPriKey])
GO
GRANT SELECT ON [dbo].[ClaimPaymentDetail] TO [MssExec]
GRANT INSERT ON [dbo].[ClaimPaymentDetail] TO [MssExec]
GRANT DELETE ON [dbo].[ClaimPaymentDetail] TO [MssExec]
GRANT UPDATE ON [dbo].[ClaimPaymentDetail] TO [MssExec]
GO