CREATE TABLE [dbo].[OrderContacts]
(
[OrderContactID] [int] NOT NULL IDENTITY(1, 1),
[OrderFID] [int] NOT NULL,
[Contact] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Title] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Email] [varchar] (120) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ImportedFlag] [bit] NOT NULL CONSTRAINT [DF_OrderContacts_ImportedFlag] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderContacts] ADD CONSTRAINT [PK_OrderContacts] PRIMARY KEY CLUSTERED ([OrderContactID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [ix_OrderContacts_Order] ON [dbo].[OrderContacts] ([OrderFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderContacts] ADD CONSTRAINT [FK_OrderContacts_Order] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
GRANT SELECT ON [dbo].[OrderContacts] TO [MssExec]
GRANT INSERT ON [dbo].[OrderContacts] TO [MssExec]
GRANT DELETE ON [dbo].[OrderContacts] TO [MssExec]
GRANT UPDATE ON [dbo].[OrderContacts] TO [MssExec]
GO