CREATE TABLE [dbo].[ContractDetail]
(
[CDPriKey] [int] NOT NULL IDENTITY(1, 1),
[CMPriKey] [int] NOT NULL,
[Description] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Discount] [decimal] (18, 0) NULL,
[ICPriKey] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ContractDetail] ADD CONSTRAINT [PK_ContractDetail] PRIMARY KEY CLUSTERED ([CDPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ContractDetail] ADD CONSTRAINT [FK_ContractDetail_ContractMaster] FOREIGN KEY ([CMPriKey]) REFERENCES [dbo].[ContractMaster] ([CMPriKey])
GO
ALTER TABLE [dbo].[ContractDetail] ADD CONSTRAINT [FK_ContractDetail_ItemCode] FOREIGN KEY ([ICPriKey]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
GRANT SELECT ON [dbo].[ContractDetail] TO [MssExec]
GRANT INSERT ON [dbo].[ContractDetail] TO [MssExec]
GRANT DELETE ON [dbo].[ContractDetail] TO [MssExec]
GRANT UPDATE ON [dbo].[ContractDetail] TO [MssExec]
GO