[dbo].[PlasticCanceledDeal]
CREATE TABLE [dbo].[PlasticCanceledDeal]
(
[CanceledDealID] [int] NOT NULL IDENTITY(1, 1),
[SalesDealFID] [int] NOT NULL,
[RefundVoidDealFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PlasticCanceledDeal] ADD CONSTRAINT [PK_PlasticCanceledDeal] PRIMARY KEY CLUSTERED ([CanceledDealID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_PlasticCanceledDeal_RefundVoidDealFID] ON [dbo].[PlasticCanceledDeal] ([RefundVoidDealFID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_PlasticCanceledDeal_SalesDealFID_RefundVoidDealFID] ON [dbo].[PlasticCanceledDeal] ([SalesDealFID], [RefundVoidDealFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PlasticCanceledDeal] ADD CONSTRAINT [FK_PlasticCanceledDeal_RefundVoidDealFID] FOREIGN KEY ([RefundVoidDealFID]) REFERENCES [dbo].[PlasticDeal] ([DealID])
GO
ALTER TABLE [dbo].[PlasticCanceledDeal] ADD CONSTRAINT [FK_PlasticCanceledDeal_DealFID] FOREIGN KEY ([SalesDealFID]) REFERENCES [dbo].[PlasticDeal] ([DealID])
GO
GRANT SELECT ON [dbo].[PlasticCanceledDeal] TO [MssExec]
GRANT INSERT ON [dbo].[PlasticCanceledDeal] TO [MssExec]
GRANT DELETE ON [dbo].[PlasticCanceledDeal] TO [MssExec]
GRANT UPDATE ON [dbo].[PlasticCanceledDeal] TO [MssExec]
GO