CREATE TABLE [dbo].[GuaranteedPrice]
(
[GuaranteedPriceID] [int] NOT NULL IDENTITY(1, 1),
[OrderFID] [int] NOT NULL,
[Charge] [money] NULL,
[Credit] [money] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GuaranteedPrice] ADD CONSTRAINT [PK_GuaranteedPrice] PRIMARY KEY CLUSTERED ([GuaranteedPriceID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GuaranteedPrice] ADD CONSTRAINT [IX_GuaranteedPrice_Order_MaterialItemCodeMap] UNIQUE NONCLUSTERED ([OrderFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_GuaranteedPrice_OrderFID] ON [dbo].[GuaranteedPrice] ([OrderFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GuaranteedPrice] ADD CONSTRAINT [FK_GuaranteedPrice_Orders] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
GRANT SELECT ON [dbo].[GuaranteedPrice] TO [MssExec]
GRANT INSERT ON [dbo].[GuaranteedPrice] TO [MssExec]
GRANT DELETE ON [dbo].[GuaranteedPrice] TO [MssExec]
GRANT UPDATE ON [dbo].[GuaranteedPrice] TO [MssExec]
GO