[dbo].[OrderHistoryField]
CREATE TABLE [dbo].[OrderHistoryField]
(
[OrderHistoryFieldID] [int] NOT NULL IDENTITY(1, 1),
[FieldName] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DisplayName] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OrderHistoryFieldTypeFID] [int] NOT NULL,
[TableType] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderHistoryField] ADD CONSTRAINT [PK_OrderHistoryField] PRIMARY KEY CLUSTERED ([OrderHistoryFieldID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_OrderHistoryField_FieldName_TableType] ON [dbo].[OrderHistoryField] ([FieldName], [TableType]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderHistoryField] ADD CONSTRAINT [FK_OrderHistoryField_OrderHistoryFieldType] FOREIGN KEY ([OrderHistoryFieldTypeFID]) REFERENCES [dbo].[OrderHistoryFieldType] ([OrderHistoryFieldTypeID])
GO
GRANT SELECT ON [dbo].[OrderHistoryField] TO [MssExec]
GRANT INSERT ON [dbo].[OrderHistoryField] TO [MssExec]
GRANT DELETE ON [dbo].[OrderHistoryField] TO [MssExec]
GRANT UPDATE ON [dbo].[OrderHistoryField] TO [MssExec]
GO