BATCHNUMBERINGSCHEME

The BATCHNUMBERINGSCHEME table stores the numbering information for automatically generated batch numbers.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
NAME nvarchar(200) Default = ''
USERDEFINEDLABEL nvarchar(50) Default = '' The user defined label portion of the automatically generated batch number.
INCLUDELABEL bit Default = 0 Whether or not to include the user defined label as part of the automatically generated batch number.
LABELPLACECODE tinyint Default = 2 The place where the user defined label will be inserted as part of the automatically generated batch number.
STARTSEQUENCE int Default = 1 The start sequence portion of the automatically generated batch number.
SEQUENCEPLACECODE tinyint Default = 1 The place where the sequence will be inserted as part of the automatically generated batch number.
ACTUALSEQUENCE int Default = 1 The actual sequence portion of the automatically generated batch number.
SEQUENCERESETDATE datetime yes The date the sequence portion of the automatically generated batch number was last reset.
DATEFORMATCODE tinyint Default = 24 The date format portion of the automatically generated batch number.
INCLUDEDATEFORMAT bit Default = 0 Whether or not to include the date format as part of the automatically generated batch number.
DATEFORMATPLACECODE tinyint Default = 3 The place where the date format will be inserted as part of the automatically generated batch number.
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) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
LABELPLACE nvarchar(1) (Computed) yes CASE [LABELPLACECODE] WHEN 1 THEN N'1' WHEN 2 THEN N'2' WHEN 3 THEN N'3' END Provides a translation for the 'LABELPLACECODE' field.
SEQUENCEPLACE nvarchar(1) (Computed) yes CASE [SEQUENCEPLACECODE] WHEN 1 THEN N'1' WHEN 2 THEN N'2' WHEN 3 THEN N'3' END Provides a translation for the 'SEQUENCEPLACECODE' field.
DATEFORMATPLACE nvarchar(1) (Computed) yes CASE [DATEFORMATPLACECODE] WHEN 1 THEN N'1' WHEN 2 THEN N'2' WHEN 3 THEN N'3' END Provides a translation for the 'DATEFORMATPLACECODE' field.
EXCEPTIONBATCHNUMBERCODE tinyint Default = 0 Indicator of how to handle exception batch numbers.
INCLUDEEXCEPTIONPREFIX bit Default = 0 Whether or not to include a prefix.
EXCEPTIONPREFIX nvarchar(8) Default = '' The prefix for the exception batch.
SEQUENCESEPARATORCODE tinyint Default = 0 The character to place between the batch sequence and any subsequent text.
SEQUENCESEPARATOR nvarchar(9) (Computed) yes CASE [SEQUENCESEPARATORCODE] WHEN 0 THEN N'< None >' WHEN 1 THEN N'< Space >' WHEN 2 THEN N'-' WHEN 3 THEN N'/' WHEN 4 THEN N'.' WHEN 5 THEN N',' WHEN 6 THEN N'_' WHEN 7 THEN N'*' WHEN 8 THEN N':' END Provides a translation for the 'SEQUENCESEPARATORCODE' field.
LABELSEPARATORCODE tinyint Default = 0 The character to place between the label and any subsequent text.
LABELSEPARATOR nvarchar(9) (Computed) yes CASE [LABELSEPARATORCODE] WHEN 0 THEN N'< None >' WHEN 1 THEN N'< Space >' WHEN 2 THEN N'-' WHEN 3 THEN N'/' WHEN 4 THEN N'.' WHEN 5 THEN N',' WHEN 6 THEN N'_' WHEN 7 THEN N'*' WHEN 8 THEN N':' END Provides a translation for the 'LABELSEPARATORCODE' field.
DATESEPARATORCODE tinyint Default = 0 The character to place between the date sequence and any subsequent text.
DATESEPARATOR nvarchar(9) (Computed) yes CASE [DATESEPARATORCODE] WHEN 0 THEN N'< None >' WHEN 1 THEN N'< Space >' WHEN 2 THEN N'-' WHEN 3 THEN N'/' WHEN 4 THEN N'.' WHEN 5 THEN N',' WHEN 6 THEN N'_' WHEN 7 THEN N'*' WHEN 8 THEN N':' END Provides a translation for the 'DATESEPARATORCODE' field.
NUMBERFORMATCODE tinyint Default = 0 The format for the batch number segment.
NUMBERFORMAT nvarchar(8) (Computed) yes CASE [NUMBERFORMATCODE] WHEN 0 THEN N'#' WHEN 1 THEN N'0#' WHEN 2 THEN N'00#' WHEN 3 THEN N'000#' WHEN 4 THEN N'0000#' WHEN 5 THEN N'00000#' WHEN 6 THEN N'000000#' WHEN 7 THEN N'0000000#' END Provides a translation for the 'NUMBERFORMATCODE' field.
DATEFORMAT nvarchar(10) (Computed) yes CASE [DATEFORMATCODE] WHEN 1 THEN N'MM-DD-YY' WHEN 2 THEN N'MM-DD-YYYY' WHEN 3 THEN N'MM-YY' WHEN 4 THEN N'MM-YYYY' WHEN 5 THEN N'DD-MM-YY' WHEN 6 THEN N'DD-MM-YYYY' WHEN 7 THEN N'MMDDYY' WHEN 8 THEN N'MMDDYYYY' WHEN 9 THEN N'MMYY' WHEN 10 THEN N'MMYYYY' WHEN 11 THEN N'DDMMYY' WHEN 12 THEN N'DDMMYYYY' WHEN 13 THEN N'MM/DD/YY' WHEN 14 THEN N'MM/DD/YYYY' WHEN 15 THEN N'MM/YY' WHEN 16 THEN N'MM/YYYY' WHEN 17 THEN N'DD/MM/YY' WHEN 18 THEN N'DD/MM/YYYY' WHEN 19 THEN N'YY' WHEN 20 THEN N'YYYY' WHEN 21 THEN N'YYMM' WHEN 22 THEN N'YYYYMM' WHEN 23 THEN N'YYMMDD' WHEN 24 THEN N'YYYYMMDD' WHEN 25 THEN N'YYDDMM' WHEN 26 THEN N'YYYYDDMM' WHEN 27 THEN N'YY-MM' WHEN 28 THEN N'YYYY-MM' WHEN 29 THEN N'YY-MM-DD' WHEN 30 THEN N'YYYY-MM-DD' WHEN 31 THEN N'YY-DD-MM' WHEN 32 THEN N'YYYY-DD-MM' WHEN 33 THEN N'YY/MM' WHEN 34 THEN N'YYYY/MM' WHEN 35 THEN N'YY/MM/DD' WHEN 36 THEN N'YYYY/MM/DD' WHEN 37 THEN N'YY/DD/MM' WHEN 38 THEN N'YYYY/DD/MM' END Provides a translation for the 'DATEFORMATCODE' field.
NUMBERINGSCHEMECODE tinyint Default = 0 Specifies the type of numbering scheme for generating the batch number.
NUMBERINGSCHEME nvarchar(14) (Computed) yes CASE [NUMBERINGSCHEMECODE] WHEN 0 THEN N'Auto-generated' WHEN 1 THEN N'Manual' END Provides a translation for the 'NUMBERINGSCHEMECODE' field.
ISGLOBAL bit Default = 0

Foreign Keys

Foreign Key Field Type Null Notes Description
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_BATCHNUMBERINGSCHEME_DATEADDED DATEADDED yes
IX_BATCHNUMBERINGSCHEME_DATECHANGED DATECHANGED
PK_BATCHNUMBERINGSCHEME ID yes yes
UC_BATCHNUMBERINGSCHEME_NAME NAME yes

Triggers

Trigger Name Description
TR_BATCHNUMBERINGSCHEME_AUDIT_UPDATE
TR_BATCHNUMBERINGSCHEME_AUDIT_DELETE

Referenced by

Referenced by Field
BATCHTEMPLATE BATCHNUMBERINGSCHEMEID
BATCHWORKFLOW BATCHNUMBERINGSCHEMEID