[dbo].[InvoiceProfileDetail]
CREATE TABLE [dbo].[InvoiceProfileDetail]
(
[IPDPriKey] [int] NOT NULL IDENTITY(1, 1),
[IPPriKey] [int] NOT NULL,
[Invoice] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[InvoiceOrder] [int] NULL,
[ICPriKey] [int] NULL,
[IGPriKey] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceProfileDetail] ADD CONSTRAINT [PK_InvoiceProfileDetail] PRIMARY KEY CLUSTERED ([IPDPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceProfileDetail] ADD CONSTRAINT [FK_InvoiceProfileDetail_ItemCode] FOREIGN KEY ([ICPriKey]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
ALTER TABLE [dbo].[InvoiceProfileDetail] ADD CONSTRAINT [FK_InvoiceProfileDetail_InvoiceGroup] FOREIGN KEY ([IGPriKey]) REFERENCES [dbo].[InvoiceGroup] ([IGPriKey])
GO
ALTER TABLE [dbo].[InvoiceProfileDetail] ADD CONSTRAINT [FK_InvoiceProfileDetail_InvoiceProfile] FOREIGN KEY ([IPPriKey]) REFERENCES [dbo].[InvoiceProfile] ([IPPriKey])
GO
GRANT SELECT ON [dbo].[InvoiceProfileDetail] TO [MssExec]
GRANT INSERT ON [dbo].[InvoiceProfileDetail] TO [MssExec]
GRANT DELETE ON [dbo].[InvoiceProfileDetail] TO [MssExec]
GRANT UPDATE ON [dbo].[InvoiceProfileDetail] TO [MssExec]
GO