CREATE TABLE [dbo].[ARCActivity]
(
[ARCActivityID] [int] NOT NULL IDENTITY(1, 1),
[LoggedDate] [datetime] NOT NULL CONSTRAINT [DF_ARCActivity_LoggedDate] DEFAULT (getdate()),
[LoggedBySysuserFID] [int] NOT NULL,
[CustomerNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ActivityDate] [datetime] NOT NULL,
[ActivityTypeDescription] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ContactName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Alerts] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OrderNumbers] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Invoices] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Note] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Result] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[ARCActivity] ADD CONSTRAINT [PK_ARCActivity] PRIMARY KEY NONCLUSTERED ([ARCActivityID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [IX_ARCActivity_CustomerNumber] ON [dbo].[ARCActivity] ([CustomerNumber]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ARCActivity_LoggedBySysuserFID] ON [dbo].[ARCActivity] ([LoggedBySysuserFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ARCActivity] ADD CONSTRAINT [FK_ARCActivity_LoggedBySysuser] FOREIGN KEY ([LoggedBySysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[ARCActivity] TO [MssExec]
GRANT INSERT ON [dbo].[ARCActivity] TO [MssExec]
GRANT DELETE ON [dbo].[ARCActivity] TO [MssExec]
GRANT UPDATE ON [dbo].[ARCActivity] TO [MssExec]
GO