[dbo].[ThirdPartyInvoiceSequence]
CREATE TABLE [dbo].[ThirdPartyInvoiceSequence]
(
[ThirdPartyInvoiceSequenceID] [int] NOT NULL IDENTITY(1, 1),
[OrderFID] [int] NOT NULL,
[Sequence] [bigint] NOT NULL CONSTRAINT [DF_ThirdPartyInvoiceSequence_Sequence] DEFAULT ((1))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ThirdPartyInvoiceSequence] ADD CONSTRAINT [PK_ThirdPartyInvoiceSequence] PRIMARY KEY NONCLUSTERED ([ThirdPartyInvoiceSequenceID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ThirdPartyInvoiceSequence] ADD CONSTRAINT [FK_ThirdPartyInvoiceSequence_Orders] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
GRANT SELECT ON [dbo].[ThirdPartyInvoiceSequence] TO [MssExec]
GRANT INSERT ON [dbo].[ThirdPartyInvoiceSequence] TO [MssExec]
GRANT DELETE ON [dbo].[ThirdPartyInvoiceSequence] TO [MssExec]
GRANT UPDATE ON [dbo].[ThirdPartyInvoiceSequence] TO [MssExec]
GO