Tables [dbo].[Tasks]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)278
Created4:57:08 PM Thursday, September 7, 2006
Last Modified8:48:43 AM Thursday, December 5, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_TASKS: TaskIDTaskIDint4
No
1 - 1
Foreign Keys FK_Tasks_Profiles: [dbo].[Profiles].ProfileIDIndexes IX_Tasks_ProfileID_DocumentTypeFID: ProfileID\DocumentTypeFIDProfileIDint4
No
TaskDescriptionvarchar(60)60
No
Foreign Keys FK_Tasks_CoordinatorType: [dbo].[CoordinatorType].CoordinatorTypeIDIndexes IX_Tasks_CoordinatorTypeID: CoordinatorTypeIDCoordinatorTypeIDint4
Yes
Foreign Keys FK_Tasks_DependencyDate: [dbo].[DependencyDate].DependencyDateIDIndexes IX_Tasks_DependencyDateID: DependencyDateIDDependencyDateIDint4
Yes
DueDaysint4
No
DueTypeint4
No
IsActivesmallint2
Yes
FreeTasksmallint2
No
((0))
FreeTaskDatedatetime8
Yes
Foreign Keys FK_Tasks_SysUser: [dbo].[Sysuser].SysUserFIDIndexes IX_Tasks_SysUserID: SysUserFIDSysUserFIDint4
Yes
Foreign Keys FK_Tasks_TaskPriority: [dbo].[TaskPriority].TaskPriorityFIDTaskPriorityFIDint4
Yes
Foreign Keys FK_Tasks_DependencyTask: [dbo].[Tasks].DependencyTaskFIDDependencyTaskFIDint4
Yes
Foreign Keys FK_Tasks_DocumentType: [dbo].[DocumentType].DocumentTypeFIDIndexes IX_Tasks_ProfileID_DocumentTypeFID: ProfileID\DocumentTypeFIDDocumentTypeFIDint4
Yes
Foreign Keys FK_Tasks_SourceAncestorTask: [dbo].[Tasks].SourceAncestorTaskFIDSourceAncestorTaskFIDint4
Yes
Indexes Indexes
NameColumnsUniqueFilteredFill Factor
Cluster Primary Key PK_TASKS: TaskIDPK_TASKSTaskID
Yes
80
IX_Tasks_ProfileID_DocumentTypeFIDProfileID, DocumentTypeFID
Yes
Yes
IX_Tasks_CoordinatorTypeIDCoordinatorTypeID
IX_Tasks_DependencyDateIDDependencyDateID
IX_Tasks_SysUserIDSysUserFID
Check Constraints Check Constraints
NameConstraint
CK_Tasks_CoordinatorType_SysUser([CoordinatorTypeID] IS NULL AND [SysUserFID] IS NULL OR [CoordinatorTypeID] IS NULL AND [SysUserFID] IS NOT NULL OR [CoordinatorTypeID] IS NOT NULL AND [SysUserFID] IS NULL)
Foreign Keys Foreign Keys
NameColumns
FK_Tasks_CoordinatorTypeCoordinatorTypeID->[dbo].[CoordinatorType].[CoordinatorTypeID]
FK_Tasks_DependencyDateDependencyDateID->[dbo].[DependencyDate].[DependencyDateID]
FK_Tasks_DependencyTaskDependencyTaskFID->[dbo].[Tasks].[TaskID]
FK_Tasks_DocumentTypeDocumentTypeFID->[dbo].[DocumentType].[DocumentTypeID]
FK_Tasks_ProfilesProfileID->[dbo].[Profiles].[ProfileID]
FK_Tasks_SourceAncestorTaskSourceAncestorTaskFID->[dbo].[Tasks].[TaskID]
FK_Tasks_SysUserSysUserFID->[dbo].[Sysuser].[SysUserID]
FK_Tasks_TaskPriorityTaskPriorityFID->[dbo].[TaskPriority].[TaskPriorityID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[Tasks]
(
[TaskID] [int] NOT NULL IDENTITY(1, 1),
[ProfileID] [int] NOT NULL,
[TaskDescription] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CoordinatorTypeID] [int] NULL,
[DependencyDateID] [int] NULL,
[DueDays] [int] NOT NULL,
[DueType] [int] NOT NULL,
[IsActive] [smallint] NULL,
[FreeTask] [smallint] NOT NULL CONSTRAINT [DF_Tasks_FreeTask] DEFAULT ((0)),
[FreeTaskDate] [datetime] NULL,
[SysUserFID] [int] NULL,
[TaskPriorityFID] [int] NULL,
[DependencyTaskFID] [int] NULL,
[DocumentTypeFID] [int] NULL,
[SourceAncestorTaskFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [CK_Tasks_CoordinatorType_SysUser] CHECK (([CoordinatorTypeID] IS NULL AND [SysUserFID] IS NULL OR [CoordinatorTypeID] IS NULL AND [SysUserFID] IS NOT NULL OR [CoordinatorTypeID] IS NOT NULL AND [SysUserFID] IS NULL))
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [PK_TASKS] PRIMARY KEY CLUSTERED  ([TaskID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Tasks_CoordinatorTypeID] ON [dbo].[Tasks] ([CoordinatorTypeID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Tasks_DependencyDateID] ON [dbo].[Tasks] ([DependencyDateID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_Tasks_ProfileID_DocumentTypeFID] ON [dbo].[Tasks] ([ProfileID], [DocumentTypeFID]) WHERE ([DocumentTypeFID] IS NOT NULL) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Tasks_SysUserID] ON [dbo].[Tasks] ([SysUserFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [FK_Tasks_CoordinatorType] FOREIGN KEY ([CoordinatorTypeID]) REFERENCES [dbo].[CoordinatorType] ([CoordinatorTypeID])
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [FK_Tasks_DependencyDate] FOREIGN KEY ([DependencyDateID]) REFERENCES [dbo].[DependencyDate] ([DependencyDateID])
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [FK_Tasks_DependencyTask] FOREIGN KEY ([DependencyTaskFID]) REFERENCES [dbo].[Tasks] ([TaskID])
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [FK_Tasks_DocumentType] FOREIGN KEY ([DocumentTypeFID]) REFERENCES [dbo].[DocumentType] ([DocumentTypeID])
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [FK_Tasks_Profiles] FOREIGN KEY ([ProfileID]) REFERENCES [dbo].[Profiles] ([ProfileID])
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [FK_Tasks_SourceAncestorTask] FOREIGN KEY ([SourceAncestorTaskFID]) REFERENCES [dbo].[Tasks] ([TaskID])
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [FK_Tasks_SysUser] FOREIGN KEY ([SysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[Tasks] ADD CONSTRAINT [FK_Tasks_TaskPriority] FOREIGN KEY ([TaskPriorityFID]) REFERENCES [dbo].[TaskPriority] ([TaskPriorityID])
GO
GRANT SELECT ON  [dbo].[Tasks] TO [MssExec]
GRANT INSERT ON  [dbo].[Tasks] TO [MssExec]
GRANT DELETE ON  [dbo].[Tasks] TO [MssExec]
GRANT UPDATE ON  [dbo].[Tasks] TO [MssExec]
GO
Uses
Used By