Primary Key Field Type
 ID uniqueidentifier

Field Field Type Null Notes Description
 NAME nvarchar(100)   Default = '' Friendly name for the document
 DESCRIPTION nvarchar(255)   Default = ''
 TYPECODE tinyint   Default = 0 Defines the type of document the template defines
 ISACTIVE bit   Default = 1
 DATEADDED datetime   Default = getdate() Indicates the date this record was added.
 DATECHANGED datetime   Default = getdate() Indicates the date this record was last changed.
 TS timestamp   Timestamp.
 TSLONG bigint (Computed) CONVERT(bigint, TS) Numeric representation of the timestamp.
 SEQUENCE int   Default = 0 Priority of document within type - does not apply to tickets
 TYPE nvarchar(26) (Computed) CASE [TYPECODE] WHEN 0 THEN N'Ticket' WHEN 1 THEN N'Itemized Receipt' WHEN 2 THEN N'Credit Card Receipt' WHEN 3 THEN N'Mailing Header' WHEN 4 THEN N'Will Call Header' WHEN 5 THEN N'Refund Itemized Receipt' WHEN 6 THEN N'Refund Credit Card Receipt' END Provides a translation for the 'TYPECODE' field.
 PRINTFORGROUPSALES bit   Default = 0
 PRINTFORZEROBALANCEORDER bit   Default = 0

Foreign Key Field Type Null Notes Description
 REPORTCATALOGID uniqueidentifier   REPORTCATALOG.ID The Report Spec used by this document
 ADDEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 CHANGEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 PRINTERLISTID uniqueidentifier PRINTERLIST.ID The printer list that describes the printers this template is designed for

Index Name Field(s) Unique Primary Clustered
 IX_DOCUMENT_DATEADDED DATEADDED    
 IX_DOCUMENT_DATECHANGED DATECHANGED      
 PK_DOCUMENT ID  
 UC_DOCUMENT_NAME NAME    

Trigger Name Description
 TR_DOCUMENT_AUDIT_UPDATE
 TR_DOCUMENT_AUDIT_DELETE

Referenced by Field
 BATCHTICKETPRINTJOB DOCUMENTID
 DOCUMENTPRINTINGRULE DOCUMENTID
 PROGRAMDOCUMENT DOCUMENTID

Entity-Relationship diagram of this table