[dbo].[GuaranteedPriceCPU]
CREATE TABLE [dbo].[GuaranteedPriceCPU]
(
[GuaranteedPriceCPUID] [int] NOT NULL IDENTITY(1, 1),
[OrderFID] [int] NOT NULL,
[Rate] [money] NOT NULL,
[MaterialItemCodeMapFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GuaranteedPriceCPU] ADD CONSTRAINT [PK_GuaranteedPriceCPU] PRIMARY KEY CLUSTERED ([GuaranteedPriceCPUID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GuaranteedPriceCPU] ADD CONSTRAINT [IX_GuaranteedPriceCPU_Order_MaterialItemCodeMap] UNIQUE NONCLUSTERED ([OrderFID], [MaterialItemCodeMapFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_GuaranteedPriceCPU_MaterialItemCodeMap] ON [dbo].[GuaranteedPriceCPU] ([MaterialItemCodeMapFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_GuaranteedPriceCPU_OrderFID] ON [dbo].[GuaranteedPriceCPU] ([OrderFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GuaranteedPriceCPU] ADD CONSTRAINT [FK_GuaranteedPriceCPU_MaterialItemCodeMap] FOREIGN KEY ([MaterialItemCodeMapFID]) REFERENCES [dbo].[MaterialItemCodeMap] ([MaterialItemCodeMapID])
GO
ALTER TABLE [dbo].[GuaranteedPriceCPU] ADD CONSTRAINT [FK_GuaranteedPriceCPU_Orders] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
GRANT SELECT ON [dbo].[GuaranteedPriceCPU] TO [MssExec]
GRANT INSERT ON [dbo].[GuaranteedPriceCPU] TO [MssExec]
GRANT DELETE ON [dbo].[GuaranteedPriceCPU] TO [MssExec]
GRANT UPDATE ON [dbo].[GuaranteedPriceCPU] TO [MssExec]
GO