CREATE TABLE [dbo].[ARCTask]
(
[ARCTaskID] [int] NOT NULL IDENTITY(1, 1),
[DueDate] [datetime] NOT NULL,
[AssignedToSysuserFID] [int] NOT NULL,
[TaskDescription] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CustomerNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OrderNumbers] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Invoices] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Alerts] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsCompleted] [bit] NOT NULL,
[CompletedDate] [datetime] NULL,
[CompletedBySysuserFID] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[ARCTask] ADD CONSTRAINT [PK_ARCTask] PRIMARY KEY NONCLUSTERED ([ARCTaskID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ARCTask_AssignedToSysuserFID] ON [dbo].[ARCTask] ([AssignedToSysuserFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ARCTask_CompletedBySysuserFID] ON [dbo].[ARCTask] ([CompletedBySysuserFID]) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [IX_ARCTask_CustomerNumber] ON [dbo].[ARCTask] ([CustomerNumber]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ARCTask] ADD CONSTRAINT [FK_ARCTask_AssignedToSysuser] FOREIGN KEY ([AssignedToSysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[ARCTask] ADD CONSTRAINT [FK_ARCTask_CompletedBySysuser] FOREIGN KEY ([CompletedBySysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[ARCTask] TO [MssExec]
GRANT INSERT ON [dbo].[ARCTask] TO [MssExec]
GRANT DELETE ON [dbo].[ARCTask] TO [MssExec]
GRANT UPDATE ON [dbo].[ARCTask] TO [MssExec]
GO