CREATE TABLE [dbo].[InvoiceMessages]
(
[InvoiceMessagesID] [int] NOT NULL IDENTITY(1, 1),
[BranchFID] [int] NOT NULL,
[Header1] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Message1] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Header2] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Message2] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Header3] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Message3] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceMessages] ADD CONSTRAINT [PK_InvoiceMessages] PRIMARY KEY NONCLUSTERED ([InvoiceMessagesID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceMessages] ADD CONSTRAINT [IX_InvoiceMessages_BranchFID] UNIQUE NONCLUSTERED ([BranchFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceMessages] ADD CONSTRAINT [FK_InvoiceMessages_Branch] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
GRANT SELECT ON [dbo].[InvoiceMessages] TO [MssExec]
GRANT INSERT ON [dbo].[InvoiceMessages] TO [MssExec]
GRANT DELETE ON [dbo].[InvoiceMessages] TO [MssExec]
GRANT UPDATE ON [dbo].[InvoiceMessages] TO [MssExec]
GO