[dbo].[MSSDocumentArchiveHistory]
CREATE TABLE [dbo].[MSSDocumentArchiveHistory]
(
[MSSDocumentArchiveHistoryID] [int] NOT NULL IDENTITY(1, 1),
[SysUserFID] [int] NOT NULL,
[Date] [datetime] NOT NULL,
[IfTruePurgedElseArchived] [bit] NOT NULL,
[NumberOfDocumentsAffected] [int] NOT NULL,
[OrderNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OrderStatus] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CreatedDateStart] [date] NULL,
[CreatedDateEnd] [date] NULL,
[LoadDateStart] [date] NULL,
[LoadDateEnd] [date] NULL,
[DeliveryDateStart] [date] NULL,
[DeliveryDateEnd] [date] NULL,
[FromDatabase] [sys].[sysname] NULL,
[ToDatabase] [sys].[sysname] NULL,
[IncludeOnlyArchivedOrders] [bit] NOT NULL CONSTRAINT [DF_MSSDocumentArchiveHistory_IncludeOnlyArchivedOrders] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MSSDocumentArchiveHistory] ADD CONSTRAINT [PK_MSSDocumentArchiveHistory] PRIMARY KEY NONCLUSTERED ([MSSDocumentArchiveHistoryID]) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [IX_MSSDocumentArchiveHistory_Date] ON [dbo].[MSSDocumentArchiveHistory] ([Date] DESC) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MSSDocumentArchiveHistory] ADD CONSTRAINT [FK_MSSDocumentArchiveHistory_SysUser] FOREIGN KEY ([SysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[MSSDocumentArchiveHistory] TO [MssExec]
GRANT INSERT ON [dbo].[MSSDocumentArchiveHistory] TO [MssExec]
GRANT DELETE ON [dbo].[MSSDocumentArchiveHistory] TO [MssExec]
GRANT UPDATE ON [dbo].[MSSDocumentArchiveHistory] TO [MssExec]
GO