CREATE TABLE [dbo].[CommStmtVendor]
(
[MSID] [int] NOT NULL IDENTITY(1, 1),
[CommStmtHeader] [int] NOT NULL,
[VendorID] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[VendorName] [varchar] (65) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Balance] [money] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CommStmtVendor] ADD CONSTRAINT [PK_CommStmtVendor] PRIMARY KEY NONCLUSTERED ([MSID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CommStmtVendor_CommStmtHeader] ON [dbo].[CommStmtVendor] ([CommStmtHeader]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CommStmtVendor_VendorID] ON [dbo].[CommStmtVendor] ([VendorID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CommStmtVendor] ADD CONSTRAINT [FK_CommStmtVendor_CommStmtHeader] FOREIGN KEY ([CommStmtHeader]) REFERENCES [dbo].[CommStmtHeader] ([MSID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[CommStmtVendor] TO [MssExec]
GRANT INSERT ON [dbo].[CommStmtVendor] TO [MssExec]
GRANT DELETE ON [dbo].[CommStmtVendor] TO [MssExec]
GRANT UPDATE ON [dbo].[CommStmtVendor] TO [MssExec]
GO