Solved

Mistakenly ran a SQL script against MASTER database - problem?

Posted on 2009-07-07
1
304 Views
Last Modified: 2012-05-07
I mistakenly ran the attahced SQL script against MASTER database rather than the intended. I have the abiliity to restore from last night' back up. Should I restore?
IF NOT EXISTS(

	SELECT * FROM INFORMATION_SCHEMA.COLUMNS

	WHERE TABLE_NAME='SecurityGroup'

	AND COLUMN_NAME ='GroupID'

	AND CHARACTER_MAXIMUM_LENGTH = 20)

BEGIN

	Alter Table SecurityGroup Drop Constraint PK_SecurityGroup

	Alter Table SecurityGroup Alter Column GroupID nvarchar(20) NOT NULL

	Alter Table SecurityGroup Add Constraint PK_SecurityGroup PRIMARY KEY (FacilityID, GroupID)

END
 

IF NOT EXISTS(

	SELECT * FROM INFORMATION_SCHEMA.COLUMNS

	WHERE TABLE_NAME='SecurityIds'

	AND COLUMN_NAME ='GroupID'

	AND CHARACTER_MAXIMUM_LENGTH = 20)

	Alter Table SecurityIds Alter Column GroupID nvarchar(20) NOT NULL

GO
 

IF NOT EXISTS(

	SELECT * FROM INFORMATION_SCHEMA.COLUMNS

	WHERE TABLE_NAME='SecurityRights'

	AND COLUMN_NAME ='LoginGrpID'

	AND CHARACTER_MAXIMUM_LENGTH = 20)

BEGIN

	Alter Table SecurityRights Drop Constraint PK_SecurityRights

	Alter Table SecurityRights Alter Column LoginGrpID nvarchar(20) NOT NULL

	Alter Table SecurityRights Add Constraint PK_SecurityRights PRIMARY KEY (FacilityID, LoginGrpID, SUID)

END
 

IF NOT EXISTS(

	SELECT * FROM INFORMATION_SCHEMA.COLUMNS

	WHERE TABLE_NAME='Defaults'

	AND COLUMN_NAME ='ReqApprovalAddress')

	Alter Table Defaults Add ReqApprovalAddress nvarchar (50) NULL

GO
 

IF NOT EXISTS(

	SELECT * FROM INFORMATION_SCHEMA.COLUMNS

	WHERE TABLE_NAME='PartMaster'

	AND COLUMN_NAME ='StandardCost')

	Alter Table PartMaster Add StandardCost float NULL

GO
 

IF NOT EXISTS(

	SELECT * FROM INFORMATION_SCHEMA.COLUMNS

	WHERE TABLE_NAME='SecurityIds'

	AND COLUMN_NAME ='LanguageCode')

	Alter Table SecurityIds Add LanguageCode nvarchar (20) NULL

GO
 

IF NOT EXISTS(

	SELECT * FROM INFORMATION_SCHEMA.COLUMNS

	WHERE TABLE_NAME='SecurityGroup'

	AND COLUMN_NAME ='LanguageCode')

	Alter Table SecurityGroup Add LanguageCode nvarchar (20) NULL

GO
 

If exists (Select * From dbo.sysobjects Where id = object_id(N'dbo.FormControls') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

	Drop Table FormControls

GO
 

CREATE TABLE FormControls(

	FacilityID nvarchar(8) NOT NULL DEFAULT ('MAIN'),

	FormName nvarchar(20) NOT NULL,

	ControlName nvarchar(50) NOT NULL,

	FieldName nvarchar(50) NULL,

	CaptionTableName nvarchar(50) NULL,

	CaptionFieldName nvarchar(50) NULL,

	FieldType nvarchar(20) NULL,

	LookupName nvarchar(20) NULL,

	ReadOnly bit NULL,

	Required bit NULL,

	MaxLength int NULL,

	DefaultWidth int NULL,

	CONSTRAINT PK_FormControls PRIMARY KEY 

	(

		FacilityID,

		FormName,

		ControlName

	)

)

GO
 

If not exists (Select * From dbo.sysobjects Where id = object_id(N'dbo.FormTabs') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

	CREATE TABLE FormTabs(

		FacilityID nvarchar(8) NOT NULL,

		SecurityID nvarchar(10) NOT NULL,

		FormName nvarchar(20) NOT NULL,

		TabName nvarchar(20) NOT NULL,

		Caption nvarchar(20) NULL,

		Locked bit NULL,

		Visible bit NULL,

		TabPosition int NULL,

		NumberRows int NULL,

		NumberCols int NULL,

		CONSTRAINT PK_FormTabs PRIMARY KEY

		(

			FacilityID,

			SecurityID,

			FormName,

			TabName

		)

	)

GO
 

If not exists (Select * From dbo.sysobjects Where id = object_id(N'dbo.FormLayouts') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

	CREATE TABLE FormLayouts(

		FacilityID nvarchar(8) DEFAULT ('MAIN'),

		SecurityID nvarchar(10) NOT NULL,

		FormName nvarchar(20) NOT NULL,

		TabName nvarchar(20) NOT NULL,

		Row int NOT NULL,

		Col int NOT NULL,

		ControlName nvarchar(50) NOT NULL,

		Buildable bit NULL,

		ShowDescription bit NULL,

		Width int NULL,

		CONSTRAINT PK_FormLayouts PRIMARY KEY 

		(

			FacilityID ASC,

			SecurityID ASC,

			FormName ASC,

			TabName ASC,

			Row ASC,

			Col ASC

		)

	)

GO
 

If exists (Select * From dbo.sysobjects Where id = object_id(N'dbo.GridColorLayouts') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

	Drop Table GridColorLayouts

GO
 

CREATE TABLE GridColorLayouts(

	FacilityID nvarchar(8) NOT NULL DEFAULT (N'MAIN'),

	FormName nvarchar(20) NOT NULL,

	SecurityID nvarchar(50) NOT NULL,

	LayoutType nvarchar(10) NULL,

	TextValue1 nvarchar(50) NULL,

	TextValue2 nvarchar(50) NULL,

	TextValue3 nvarchar(50) NULL,

	LowStartValue float NULL,

	LowEndValue float NULL,

	MidStartValue float NULL,

	MidEndValue float NULL,

	HighStartValue float NULL,

	HighEndValue float NULL,

	Color1 nvarchar(50) NULL,

	Color2 nvarchar(50) NULL,

	Color3 nvarchar(50) NULL,

	CONSTRAINT PK_GridColorLayouts PRIMARY KEY 

	(

		FacilityID,

		FormName,

		SecurityID

	)

)

GO
 

If not exists (Select * From dbo.sysobjects Where id = object_id(N'dbo.KPILayout') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

	CREATE TABLE KPILayout(

		FacilityID nvarchar (8) DEFAULT 'MAIN' NOT NULL ,

		SecurityID nvarchar(10) NOT NULL ,

		Row int NOT NULL ,

		Col int NOT NULL ,

		KPIReportName nvarchar(50) NULL ,

		DetailReportName nvarchar(50) NULL ,

 		CONSTRAINT PK_KPILayout PRIMARY KEY  

		(

			FacilityID ,

			SecurityID ,

			Row ,

			Col

		)

	)

GO
 

If not exists (Select * From dbo.sysobjects Where id = object_id(N'dbo.LabelCaptions') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

	CREATE TABLE LabelCaptions(

		FacilityID nvarchar(8) NOT NULL,

		TableName nvarchar(50) NOT NULL,

		FieldName nvarchar(50) NOT NULL,

		LanguageCode nvarchar(20) NOT NULL,

		Caption nvarchar(50) NULL,

		CaptionType nvarchar (20) NULL,

		CONSTRAINT PK_LabelCaptions PRIMARY KEY 

		(

			FacilityID,

			TableName,

			FieldName,

			LanguageCode

		)

	) 

GO
 

IF NOT EXISTS(

	SELECT * FROM INFORMATION_SCHEMA.COLUMNS

	WHERE TABLE_NAME='LabelCaptions'

	AND COLUMN_NAME ='CaptionType')

	Alter Table LabelCaptions Add CaptionType nvarchar (20) NULL

GO
 

If not exists (Select * From dbo.sysobjects Where id = object_id(N'dbo.LanguageCodes') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

	CREATE TABLE LanguageCodes(

		FacilityID nvarchar(8) DEFAULT ('MAIN') NOT NULL,

		LanguageCode nvarchar(10) NOT NULL,

		Description nvarchar(50) NULL,

		RecordStatus nchar(1) NULL,

		CONSTRAINT PK_LanguageCodes PRIMARY KEY 

		(

			FacilityID,

			LanguageCode

		)

	)

GO
 

Delete From SecuritySelections Where SUID > 96

GO
 

INSERT INTO SecuritySelections 

   (SUID, ModuleTable, MenuOption, FacilityID) 

   Values( 97, 'Reason Code', 'PopupTable', 'MAIN');

INSERT INTO SecuritySelections 

   (SUID, ModuleTable, MenuOption, FacilityID) 

   Values( 98, 'Requisitions', 'Edit Approved Requisitions', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  99, 'Defect2 Codes', 'PopupTable', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  100, 'Defect3 Codes', 'PopupTable', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  101, 'Defect4 Codes', 'PopupTable', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  102, 'Defect5 Codes', 'PopupTable', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  103, 'Defect6 Codes', 'PopupTable', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  104, 'Asset', 'Reports', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  105, 'Calendar PM', 'Reports', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  106, 'Inventory', 'Reports', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  107, 'Meter PM', 'Reports', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  108, 'Purchase Order', 'Reports', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  109, 'Requisitions', 'Reports', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  110, 'Technician', 'Reports', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  111, 'Work Order', 'Reports', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  112, 'Inventory', 'Central Warehouse Issue', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  113, 'Inventory', 'Transaction Reverse - Central Whse Issue', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  114, 'Requisitions', 'Build Approval Route', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  115, 'Req Approval Group', 'PopupTable', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  116, 'Req Approver', 'PopupTable', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  117, 'System Administration', 'Customize Screens', 'MAIN');

INSERT INTO SecuritySelections 

    (SUID, ModuleTable, MenuOption, FacilityID) 

    VALUES(  119, 'Work Order', 'Print Selected WOs', 'MAIN');
 

INSERT INTO SecuritySelections (SUID, ModuleTable, MenuOption, FacilityID) 

  VALUES(  121, 'WO Status', 'PopupTable', 'MAIN');
 

INSERT INTO SecuritySelections (SUID, ModuleTable, MenuOption, FacilityID) 

  VALUES(  122, 'Ship To ID', 'PopupTable', 'MAIN');
 

INSERT INTO SecuritySelections (SUID, ModuleTable, MenuOption, FacilityID) 

  VALUES(  123, 'Remit To ID', 'PopupTable', 'MAIN');
 

INSERT INTO SecuritySelections (SUID, ModuleTable, MenuOption, FacilityID) 

  VALUES(  124, 'Budgets', 'PopupTable', 'MAIN');

GO
 

--Insert FormControls

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Area', 'Area', 'Area', 'Area', 'Text', '', 1, 1, 20, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Area')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Asset', 'Equipment', 'Asset', 'Asset', 'Text', '', 1, 1, 20, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Asset')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Asset Number', 'AssetNumber', 'Asset', 'Asset Number', 'Text', '', 0, 0, 18, 21

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Asset Number')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Asset RIME', 'PriorityCode', 'EquipmentPriority', 'PriorityCode', 'Text', 'AssetRIME', 0, 0, 18, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Asset RIME')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Charge Dept', 'ChargeDept', 'ChargeDepartment', 'ChargeDept', 'Text', 'ChargeDept', 0, 0, 25, 21

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Charge Dept')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Class', 'Class', 'EquipmentClasses', 'Class', 'Text', 'AssetClass', 0, 0, 6, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Class')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Create Date', 'CreateDate', 'Asset', 'Create Date', 'Date', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Create Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 1', 'Custom1', 'Asset', 'Custom 1', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 10', 'Custom10', 'Asset', 'Custom 10', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 10')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 11', 'Custom11', 'Asset', 'Custom 11', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 11')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 12', 'Custom12', 'Asset', 'Custom 12', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 12')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 13', 'Custom13', 'Asset', 'Custom 13', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 13')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 14', 'Custom14', 'Asset', 'Custom 14', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 14')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 15', 'Custom15', 'Asset', 'Custom 15', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 15')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 16', 'Custom16', 'Asset', 'Custom 16', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 16')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 2', 'Custom2', 'Asset', 'Custom 2', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 3', 'Custom3', 'Asset', 'Custom 3', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 4', 'Custom4', 'Asset', 'Custom 4', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 5', 'Custom5', 'Asset', 'Custom 5', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 6', 'Custom6', 'Asset', 'Custom 6', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 7', 'Custom7', 'Asset', 'Custom 7', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 7')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 8', 'Custom8', 'Asset', 'Custom 8', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 8')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Custom 9', 'Custom9', 'Asset', 'Custom 9', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Custom 9')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Date Data 1', 'DateData1', 'Asset', 'Date Data 1', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Date Data 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Date Data 2', 'DateData2', 'Asset', 'Date Data 2', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Date Data 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Date Data 3', 'DateData3', 'Asset', 'Date Data 3', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Date Data 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Date Data 4', 'DateData4', 'Asset', 'Date Data 4', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Date Data 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Description', 'Description', 'Asset', 'Description', 'Text', '', 1, 0, 50, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Description')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Drawing Number', 'DrawingNumber', 'Asset', 'Drawing Number', 'Text', '', 0, 0, 18, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Drawing Number')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Equipment No', 'EquipmentNumber', 'Asset', 'Equipment No', 'Text', '', 0, 0, 18, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Equipment No')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Facility ID', 'FacilityID', 'FacilityID', 'FacilityID', 'Text', '', 1, 0, 8, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Facility ID')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'In Service Date', 'InServiceDate', 'Asset', 'In Service Date', 'Date', 'Date', 0, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'In Service Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Labor Group', 'LaborGroup', 'LaborGroup', 'Code', 'Text', 'LaborGroup', 0, 0, 9, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Labor Group')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Location', 'Location', 'Location', 'LocationID', 'Text', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Location')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Lockout', 'Lockout', 'Asset', 'Lockout', 'Memo', '', 0, 0, 1000, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Lockout')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Logical Data 1', 'LogicalData1', 'Asset', 'Logical Data 1', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Logical Data 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Logical Data 2', 'LogicalData2', 'Asset', 'Logical Data 2', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Logical Data 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Manufacturer', 'Manufacturer', 'MfgCode', 'MfgCode', 'Text', 'MfgCode', 0, 0, 18, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Manufacturer')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Meter 1 Incremental', 'Meter1Reset', 'Asset', 'Meter 1 Incremental', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Meter 1 Incremental')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Meter 1 Name', 'Meter1', 'Asset', 'Meter 1 Name', 'Text', '', 0, 0, 9, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Meter 1 Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Meter 1 Reading', 'Meter1Reading', 'Asset', 'Meter 1 Reading', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Meter 1 Reading')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Meter 1 Total', 'Meter1Total', 'Asset', 'Meter 1 Total', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Meter 1 Total')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Meter 2 Incremental', 'Meter2Reset', 'Asset', 'Meter 2 Incremental', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Meter 2 Incremental')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Meter 2 Name', 'Meter2', 'Asset', 'Meter 2 Name', 'Text', '', 0, 0, 9, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Meter 2 Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Meter 2 Reading', 'Meter2Reading', 'Asset', 'Meter 2 Reading', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Meter 2 Reading')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Meter 2 Total', 'Meter2Total', 'Asset', 'Meter 2 Total', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Meter 2 Total')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Model Number', 'Model', 'Asset', 'Model Number', 'Text', '', 0, 0, 30, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Model Number')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'MTBR', 'MTBR', 'Asset', 'MTBR', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'MTBR')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'MTTR', 'MTTR', 'Asset', 'MTTR', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'MTTR')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Notes', 'Notes', 'Asset', 'Notes', 'Memo', '', 0, 0, 1000, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Notes')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Numeric Data 1', 'NumericData1', 'Asset', 'Numeric Data 1', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Numeric Data 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Numeric Data 2', 'NumericData2', 'Asset', 'Numeric Data 2', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Numeric Data 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Parent', 'Parent', 'Asset', 'Parent', 'Text', 'Parent', 0, 0, 20, 21

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Parent')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Parts List ID', 'PartsListID', 'DedicatedPartList', 'PartsListID', 'Text', 'PartsList', 0, 0, 40, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Parts List ID')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Priority', 'Priority', 'Asset', 'Priority', 'Text', '', 0, 0, 1, 6

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Priority')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'RCM Group', 'RCMGroup', 'RCMGroup', 'RCMGroupCode', 'Text', 'RCMGroup', 0, 0, 12, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'RCM Group')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Record Type', 'RecordType', 'Asset', 'Record Type', 'Text', '', 1, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Record Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Serial Number', 'SerialNumber', 'Asset', 'Serial Number', 'Text', '', 0, 0, 20, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Serial Number')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Status', 'Status', 'EquipmentStatus', 'Status', 'Text', 'AssetStatus', 0, 1, 15, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Status')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Status Date', 'StatusDate', 'Asset', 'Status Date', 'Date', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Status Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Table Data 1', 'TableData1', 'Asset', 'Table Data 1', 'Text', 'RecordTypeTable1', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Table Data 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Table Data 2', 'TableData2', 'Asset', 'Table Data 2', 'Text', 'RecordTypeTable2', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Table Data 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Table Data 3', 'TableData3', 'Asset', 'Table Data 3', 'Text', 'RecordTypeTable3', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Table Data 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Table Data 4', 'TableData4', 'Asset', 'Table Data 4', 'Text', 'RecordTypeTable4', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Table Data 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Table Data 5', 'TableData5', 'Asset', 'Table Data 5', 'Text', 'RecordTypeTable5', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Table Data 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Table Data 6', 'TableData6', 'Asset', 'Table Data 6', 'Text', 'RecordTypeTable6', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Table Data 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Technician', 'Technician', 'Technician', 'Technician', 'Text', '', 0, 0, 10, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Technician')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Text Data 1', 'TextData1', 'Asset', 'Text Data 1', 'Text', '', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Text Data 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Text Data 2', 'TextData2', 'Asset', 'Text Data 2', 'Text', '', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Text Data 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Text Data 3', 'TextData3', 'Asset', 'Text Data 3', 'Text', '', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Text Data 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Text Data 4', 'TextData4', 'Asset', 'Text Data 4', 'Text', '', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Text Data 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Under Warranty', 'UnderWarranty', 'Asset', 'Under Warranty', 'Logical', '', 1, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Under Warranty')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Warranty Cycle End', 'WarrantyCycleEnd', 'Asset', 'Warranty Cycle End', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Warranty Cycle End')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Warranty Date', 'WarrantyDate', 'Asset', 'Warranty Date', 'Date', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Warranty Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset', 'Zone', 'Zone', 'EquipmentZones', 'Zone', 'Text', 'AssetZone', 0, 0, 6, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset'

        And FormControls.ControlName = 'Zone')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset1', 'Estimated Life', 'EstimatedLife', 'Asset', 'Estimated Life', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset1'

        And FormControls.ControlName = 'Estimated Life')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset1', 'Original Cost', 'OriginalCost', 'Asset', 'Original Cost', 'Decimal', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset1'

        And FormControls.ControlName = 'Original Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Asset1', 'Salvage Value', 'SalvageValue', 'Asset', 'Salvage Value', 'Decimal', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Asset1'

        And FormControls.ControlName = 'Salvage Value')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Account Code', 'AccountCode', 'AccountCodes', 'AccountCode', 'Text', 'AccountCode', 0, 0, 24, 28

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Account Code')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Activate PM', 'ForceRelease', 'Calendar PM', 'Activate PM', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Activate PM')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Completion Days', 'CompletionDays', 'Calendar PM', 'Completion Days', 'Integer', '', 0, 0, 5, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Completion Days')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Contractor', 'ContractorCode', 'Contractor', 'Contractor', 'Text', 'Contractor', 0, 0, 10, 28

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Contractor')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Estimated Job Hours', 'EstHours', 'Calendar PM', 'Estimated Job Hours', 'Decimal', '', 0, 0, 5, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Estimated Job Hours')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Estimated Labor Cost', 'EstimatedCost', 'Calendar PM', 'Estimated Labor Cost', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Estimated Labor Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Initialize Date', 'InitializationDate', 'Calendar PM', 'Initialize Date', 'Date', '', 1, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Initialize Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Interval Type', 'IntervalType', 'Calendar PM', 'Interval Type', 'Text', 'IntervalType', 0, 1, 6, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Interval Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Job Priority', 'Priority', 'JobPriority', 'Code', 'Text', 'JobPriority', 0, 0, 2, 6

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Job Priority')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Job Type', 'JobTypeCode', 'JobType', 'JobType', 'Text', 'JobType', 0, 1, 18, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Job Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'JobType', 'JobTypeCode', 'JobType', 'JobType', 'Text', 'JobType', 0, 1, 18, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'JobType')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Labor Group', 'LaborGroup', 'LaborGroup', 'Code', 'Text', 'LaborGroup', 0, 0, 9, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Labor Group')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Last Completed Date', 'LastCompletedDate', 'Calendar PM', 'Last Completed Date', 'Date', '', 1, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Last Completed Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Last Release Date', 'LastReleaseDate', 'Calendar PM', 'Last Release Date', 'Date', '', 1, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Last Release Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Manual Dates', 'Manual Dates', 'Calendar PM', 'Manual Dates', 'Control', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Manual Dates')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Min Days', 'MinimumDays', 'Calendar PM', 'Min Days', 'Integer', '', 0, 0, 5, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Min Days')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Next Schedule Date', 'NextDate', 'Calendar PM', 'Next Schedule Date', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Next Schedule Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Number Techs', 'NumberTechs', 'Calendar PM', 'Number Techs', 'Integer', '', 0, 0, 5, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Number Techs')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Overdue Days', 'CompletionDays', 'Calendar PM', 'Overdue Days', 'Text', '', 0, 1, 18, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Overdue Days')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Planning Button', '', 'System', 'Planning Button', 'Button', '', 1, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Planning Button')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Print Dedicated Parts', 'PrintDedicatedPart', 'Calendar PM', 'Print Dedicated Parts', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Print Dedicated Parts')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Schedule Type', 'ScheduleType', 'Calendar PM', 'Schedule Type', 'Text', 'ScheduleType', 0, 1, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Schedule Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Shift', 'Shift', 'Calendar PM', 'Shift', 'Text', '', 0, 0, 1, 6

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Shift')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Skip Set 1', 'SkipSet1', 'Calendar PM', 'Skip Set 1', 'Text', 'SkipDate', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Skip Set 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Skip Set 2', 'SkipSet2', 'Calendar PM', 'Skip Set 2', 'Text', 'SkipDate', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Skip Set 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Skip Set 3', 'SkipSet3', 'Calendar PM', 'Skip Set 3', 'Text', 'SkipDate', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Skip Set 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Skip Set 4', 'SkipSet4', 'Calendar PM', 'Skip Set 4', 'Text', 'SkipDate', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Skip Set 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Skip Set 5', 'SkipSet5', 'Calendar PM', 'Skip Set 5', 'Text', 'SkipDate', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Skip Set 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Skip Set 6', 'SkipSet6', 'Calendar PM', 'Skip Set 6', 'Text', 'SkipDate', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Skip Set 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Task Code', 'TaskCode', 'TaskInstructions', 'Task Code', 'Text', 'TaskCode', 0, 1, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Task Code')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Technician', 'Technician', 'TechnicianList', 'Technician', 'Text', 'Technician', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Technician')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'Time Interval', 'TimeInterval', 'Calendar PM', 'Time Interval', 'Integer', '', 0, 1, 5, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'Time Interval')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Calendar PM', 'WO Status', 'WOStatus', 'StatusType', 'Status', 'Text', 'StatusType', 0, 0, 2, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Calendar PM'

        And FormControls.ControlName = 'WO Status')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'ABC Class', 'ABCClass', 'Inventory', 'ABC Class', 'Text', '', 1, 0, 1, 6

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'ABC Class')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Add To Dedicated Parts', 'AutoAdd', 'Inventory', 'Add To Dedicated Parts', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Add To Dedicated Parts')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Charge Dept', 'ChargeDept', 'ChargeDepartment', 'ChargeDept', 'Text', 'ChargeDept', 0, 0, 25, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Charge Dept')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Class Code', 'ClassCode', 'ClassCode', 'Class Code', 'Text', 'ClassCode', 0, 0, 6, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Class Code')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Commodity', 'CommodityCode', 'CommodityCode', 'Code', 'Text', 'Commodity', 0, 0, 8, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Commodity')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Conversion', 'Conversion', 'Inventory', 'Conversion', 'Decimal', '', 1, 0, 10, 6

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Conversion')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Create Date', 'CreatedDate', 'Inventory', 'Create Date', 'Date', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Create Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Cross 1', 'Cross1', 'Inventory', 'Cross 1', 'Text', '', 0, 0, 16, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Cross 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Cross 2', 'Cross2', 'Inventory', 'Cross 2', 'Text', '', 0, 0, 16, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Cross 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Cross 3', 'Cross3', 'Inventory', 'Cross 3', 'Text', '', 0, 0, 16, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Cross 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 1', 'Custom1', 'Inventory', 'Custom 1', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 10', 'Custom10', 'Inventory', 'Custom 10', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 10')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 11', 'Custom11', 'Inventory', 'Custom 11', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 11')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 12', 'Custom12', 'Inventory', 'Custom 12', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 12')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 13', 'Custom13', 'Inventory', 'Custom 13', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 13')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 14', 'Custom14', 'Inventory', 'Custom 14', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 14')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 15', 'Custom15', 'Inventory', 'Custom 15', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 15')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 16', 'Custom16', 'Inventory', 'Custom 16', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 16')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 2', 'Custom2', 'Inventory', 'Custom 2', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 3', 'Custom3', 'Inventory', 'Custom 3', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 4', 'Custom4', 'Inventory', 'Custom 4', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 5', 'Custom5', 'Inventory', 'Custom 5', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 6', 'Custom6', 'Inventory', 'Custom 6', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 7', 'Custom7', 'Inventory', 'Custom 7', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 7')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 8', 'Custom8', 'Inventory', 'Custom 8', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 8')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Custom 9', 'Custom9', 'Inventory', 'Custom 9', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Custom 9')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'In Account', 'InAccount', 'Inventory', 'In Account', 'Text', 'AccountCode', 0, 0, 24, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'In Account')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Inventory Type', 'InventoryType', 'Inventory', 'Inventory Type', 'Text', 'InventoryType', 0, 0, 1, 6

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Inventory Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Lead Time', 'LeadTime', 'Inventory', 'Lead Time', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Lead Time')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Lot Size', 'LotSize', 'Inventory', 'Lot Size', 'Decimal', '', 0, 0, 10, 6

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Lot Size')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Manufacturers', 'MfgCode', 'MfgCode', 'MfgCode', 'Text', 'Manufacturer', 0, 0, 18, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Manufacturers')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Max Level', 'MaxLevel', 'Inventory', 'Max Level', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Max Level')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Mfg Part Number', 'MfgPartNumber', 'Inventory', 'Mfg Part Number', 'Text', '', 0, 0, 32, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Mfg Part Number')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Min Level', 'MinLevel', 'Inventory', 'Min Level', 'Decimal', '', 0, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Min Level')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Notes', 'Notes', 'Inventory', 'Notes', 'Memo', '', 0, 0, 1000, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Notes')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'On Order', 'OnOrder', 'Inventory', 'On Order', 'Decimal', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'On Order')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Order Cost', 'OrderCost', 'Inventory', 'Order Cost', 'Decimal', '', 0, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Order Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Order Measure', 'OrderMeasure', 'Inventory', 'Order Measure', 'Text', 'OrderMeasure', 0, 1, 6, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Order Measure')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Out Account', 'Out Account', 'Inventory', 'Out Account', 'Text', 'AccountCode', 0, 0, 24, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Out Account')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Part Type', 'Type', 'Inventory', 'Part Type', 'Text', 'PartType', 0, 0, 1, 6

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Part Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'PO Notes', 'PONotes', 'Inventory', 'PO Notes', 'Memo', '', 0, 0, 1000, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'PO Notes')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Priority', 'Priority', 'PartPriority', 'Code', 'Text', 'PartPriority', 0, 0, 1, 6

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Priority')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Soft Reserve', 'SoftReserve', 'Inventory', 'Soft Reserve', 'Decimal', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Soft Reserve')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Stock Cost', 'StockCost', 'Inventory', 'Stock Cost', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Stock Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Stock Measure', 'StockMeasure', 'StockMeasures', 'Stock Measure', 'Text', 'StockMeasRec', 0, 1, 6, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Stock Measure')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Supplier', 'Supplier', 'Inventory', 'Supplier', 'Text', 'Supplier', 0, 1, 10, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Supplier')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Inventory', 'Taxable', 'Taxable', 'Inventory', 'Taxable', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Inventory'

        And FormControls.ControlName = 'Taxable')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Account Code', 'AccountCode', 'AccountCodes', 'AccountCode', 'Text', 'AccountCode', 0, 0, 24, 28

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Account Code')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Area', 'Area', 'Area', 'Area', 'Text', '', 1, 1, 20, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Area')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Asset', 'Equipment', 'Asset', 'Asset', 'Text', '', 1, 1, 20, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Asset')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Asset Group', 'AssetGroup', 'Meter PM', 'Asset Group', 'Text', '', 1, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Asset Group')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Completion Days A', 'CompletionDays1', 'Meter PM', 'Completion Days A', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Completion Days A')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Completion Days B', 'CompletionDays2', 'Meter PM', 'Completion Days B', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Completion Days B')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Completion Days C', 'CompletionDays3', 'Meter PM', 'Completion Days C', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Completion Days C')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Completion Days D', 'CompletionDays4', 'Meter PM', 'Completion Days D', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Completion Days D')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Completion Days E', 'CompletionDays5', 'Meter PM', 'Completion Days E', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Completion Days E')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Component', 'SubLevel', 'SubLevel', 'SubLevel', 'Text', '', 1, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Component')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Contractor', 'ContractorCode', 'Contractor', 'Contractor', 'Text', 'Contractor', 0, 0, 10, 28

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Contractor')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Cycle Start Reading', 'CycleStartReading', 'Meter PM', 'Cycle Start Reading', 'Decimal', '', 0, 0, 10, 7

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Cycle Start Reading')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Early Release', 'EarlyRelease', 'Meter PM', 'Early Release', 'Decimal', '', 0, 0, 10, 7

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Early Release')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Estimated Labor Cost', 'EstimatedCost', 'Meter PM', 'Estimated Labor Cost', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Estimated Labor Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Facility ID', 'FacilityID', 'FacilityID', 'FacilityID', 'Text', '', 1, 0, 8, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Facility ID')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Hours A', 'Hours1', 'Meter PM', 'Hours A', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Hours A')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Hours B', 'Hours2', 'Meter PM', 'Hours B', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Hours B')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Hours C', 'Hours3', 'Meter PM', 'Hours C', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Hours C')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Hours D', 'Hours4', 'Meter PM', 'Hours D', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Hours D')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Hours E', 'Hours5', 'Meter PM', 'Hours E', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Hours E')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Job Type', 'JobTypeCode', 'JobType', 'JobType', 'Text', 'JobType', 0, 1, 18, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Job Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Labor Group', 'LaborGroup', 'LaborGroup', 'Code', 'Text', 'LaborGroup', 0, 0, 9, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Labor Group')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Last Completed Date', 'LastDate', 'Meter PM', 'Last Completed Date', 'Date', '', 1, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Last Completed Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Last Completed Meter', 'LastMeter', 'Meter PM', 'Last Completed Meter', 'Decimal', '', 1, 0, 10, 7

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Last Completed Meter')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Last Release Date', 'LastReleaseDate', 'Meter PM', 'Last Release Date', 'Date', '', 1, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Last Release Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Location', 'LocationID', 'Location', 'LocationID', 'Text', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Location')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Max Days', 'TimeUnit', 'Meter PM', 'Max Days', 'Decimal', '', 0, 0, 10, 7

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Max Days')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Meter Interval', 'MeterUnit', 'Meter PM', 'Meter Interval', 'Decimal', '', 0, 1, 10, 7

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Meter Interval')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Meter Name', 'MeterName', 'Meter PM', 'Meter Name', 'Text', 'Meter', 0, 1, 9, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Meter Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Multiple B', 'Multiple1', 'Meter PM', 'Multiple B', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Multiple B')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Multiple C', 'Multiple2', 'Meter PM', 'Multiple C', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Multiple C')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Multiple D', 'Multiple3', 'Meter PM', 'Multiple D', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Multiple D')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Multiple E', 'Multiple4', 'Meter PM', 'Multiple E', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Multiple E')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Number Tech A', 'NumberTech1', 'Meter PM', 'Number Tech A', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Number Tech A')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Number Tech B', 'NumberTech2', 'Meter PM', 'Number Tech B', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Number Tech B')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Number Tech C', 'NumberTech3', 'Meter PM', 'Number Tech C', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Number Tech C')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Number Tech D', 'NumberTech4', 'Meter PM', 'Number Tech D', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Number Tech D')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Number Tech E', 'NumberTech5', 'Meter PM', 'Number Tech E', 'Integer', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Number Tech E')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Planning Button', 'Planning Button', 'System', 'Planning Button', 'Button', '', 1, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Planning Button')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Print Dedicated Parts', 'PrintDedicatedPart', 'Meter PM', 'Print Dedicated Parts', 'Logical', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Print Dedicated Parts')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Priority A', 'Priority1', 'Meter PM', 'Priority A', 'Text', '', 0, 0, 2, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Priority A')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Priority B', 'Priority2', 'Meter PM', 'Priority B', 'Text', '', 0, 0, 2, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Priority B')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Priority C', 'Priority3', 'Meter PM', 'Priority C', 'Text', '', 0, 0, 2, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Priority C')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Priority D', 'Priority4', 'Meter PM', 'Priority D', 'Text', '', 0, 0, 2, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Priority D')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Priority E', 'Priority5', 'Meter PM', 'Priority E', 'Text', '', 0, 0, 2, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Priority E')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Schedule Number', 'ScheduleNumber', 'Meter PM', 'Schedule Number', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Schedule Number')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Shift A', 'Shift1', 'Meter PM', 'Shift A', 'Text', '', 0, 0, 1, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Shift A')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Shift B', 'Shift2', 'Meter PM', 'Shift B', 'Text', '', 0, 0, 1, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Shift B')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Shift C', 'Shift3', 'Meter PM', 'Shift C', 'Text', '', 0, 0, 1, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Shift C')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Shift D', 'Shift4', 'Meter PM', 'Shift D', 'Text', '', 0, 0, 1, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Shift D')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Shift E', 'Shift5', 'Meter PM', 'Shift E', 'Text', '', 0, 0, 1, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Shift E')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Task Code A', 'TaskCode1', 'Meter PM', 'Task Code A', 'Text', '', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Task Code A')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Task Code B', 'TaskCode2', 'Meter PM', 'Task Code B', 'Text', '', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Task Code B')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Task Code C', 'TaskCode3', 'Meter PM', 'Task Code C', 'Text', '', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Task Code C')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Task Code D', 'TaskCode4', 'Meter PM', 'Task Code D', 'Text', '', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Task Code D')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Task Code E', 'TaskCode5', 'Meter PM', 'Task Code E', 'Text', '', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Task Code E')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Technician', 'Technician', 'Technician', 'Technician', 'Text', 'Technician', 0, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Technician')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Util Since Last', 'UtilSinceLast', 'Meter PM', 'Util Since Last', 'Decimal', '', 1, 0, 10, 7

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Util Since Last')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'Warranty Cycle End', 'WarrantyCycleEnd', 'Meter PM', 'Warranty Cycle End', 'Decimal', '', 1, 0, 10, 7

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'Warranty Cycle End')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Meter PM', 'WO Status', 'WOStatus', 'StatusType', 'Status', 'Text', 'StatusType', 0, 0, 2, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Meter PM'

        And FormControls.ControlName = 'WO Status')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Acknowledge', 'Acknowledge', 'Purchase Order', 'Acknowledge', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Acknowledge')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Buyer', 'Buyer', 'Purchase Order', 'Buyer', 'Text', 'Technician', 0, 0, 36, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Buyer')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Confirming', 'Confirming', 'Purchase Order', 'Confirming', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Confirming')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 1', 'Custom1', 'Purchase Order', 'Custom 1', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 10', 'Custom10', 'Purchase Order', 'Custom 10', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 10')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 11', 'Custom11', 'Purchase Order', 'Custom 11', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 11')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 12', 'Custom12', 'Purchase Order', 'Custom 12', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 12')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 13', 'Custom13', 'Purchase Order', 'Custom 13', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 13')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 14', 'Custom14', 'Purchase Order', 'Custom 14', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 14')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 15', 'Custom15', 'Purchase Order', 'Custom 15', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 15')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 16', 'Custom16', 'Purchase Order', 'Custom 16', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 16')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 2', 'Custom2', 'Purchase Order', 'Custom 2', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 3', 'Custom3', 'Purchase Order', 'Custom 3', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 4', 'Custom4', 'Purchase Order', 'Custom 4', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 5', 'Custom5', 'Purchase Order', 'Custom 5', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 6', 'Custom6', 'Purchase Order', 'Custom 6', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 7', 'Custom7', 'Purchase Order', 'Custom 7', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 7')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 8', 'Custom8', 'Purchase Order', 'Custom 8', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 8')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Custom 9', 'Custom9', 'Purchase Order', 'Custom 9', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Custom 9')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'FOB', 'FOB', 'Purchase Order', 'FOB', 'Text', 'FOB', 0, 0, 15, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'FOB')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Notes', 'Notes', 'Purchase Order', 'Notes', 'Memo', '', 0, 0, 1000, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Notes')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Payment Terms', 'PaymentTerms', 'Purchase Order', 'Payment Terms', 'Text', '', 0, 0, 15, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Payment Terms')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Ship City State', 'ShipCity', 'Purchase Order', 'Ship City State', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Ship City State')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Ship To Address 1', 'ShipAddress1', 'Purchase Order', 'Ship To Address 1', 'Text', '', 0, 0, 40, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Ship To Address 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Ship To Address 2', 'ShipAddress2', 'Purchase Order', 'Ship To Address 2', 'Text', '', 0, 0, 40, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Ship To Address 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Ship To Name', 'ShipName', 'Purchase Order', 'Ship To Name', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Ship To Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Ship Via', 'ShipVia', 'Purchase Order', 'Ship Via', 'Text', 'ShipVia', 0, 0, 15, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Ship Via')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Supplier', 'SupplierID', 'Supplier', 'Supplier', 'Text', 'Supplier', 0, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Supplier')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Supplier Address 1', 'SupplierAddress1', 'Purchase Order', 'Supplier Address 1', 'Text', '', 1, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Supplier Address 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Supplier Address 2', 'SupplierAddress2', 'Purchase Order', 'Supplier Address 2', 'Text', '', 1, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Supplier Address 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Supplier City State', 'SupplierCityState', 'Purchase Order', 'Supplier City State', 'Text', '', 1, 0, 20, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Supplier City State')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Supplier Name', 'SupplierName', 'Purchase Order', 'Supplier Name', 'Text', '', 0, 0, 40, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Supplier Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Purchase Order', 'Total Cost', 'TotalCost', 'Requisition', 'Total Cost', 'Decimal', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Purchase Order'

        And FormControls.ControlName = 'Total Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Account Code', 'AccountCode', 'AccountCodes', 'AccountCode', 'Text', 'AccountCode', 0, 0, 24, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Account Code')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Address', 'Address', 'Request Manager', 'Address', 'Text', '', 0, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Address')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Area', 'Area', 'Area', 'Area', 'Text', 'AreaRec', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Area')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Asset', 'Equipment', 'Asset', 'Asset', 'Text', 'AssetRec', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Asset')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Charge Department', 'ChargeDept', 'ChargeDepartment', 'ChargeDept', 'Text', 'ChargeDept', 0, 0, 25, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Charge Department')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'City', 'City', 'Request Manager', 'City', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'City')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Component', 'Component', 'SubLevel', 'SubLevel', 'Text', 'ComponentRec', 0, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Component')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 1', 'Custom1', 'Work Order', 'Custom 1', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 10', 'Custom10', 'Work Order', 'Custom 10', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 10')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 11', 'Custom11', 'Work Order', 'Custom 11', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 11')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 12', 'Custom12', 'Work Order', 'Custom 12', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 12')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 13', 'Custom13', 'Work Order', 'Custom 13', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 13')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 14', 'Custom14', 'Work Order', 'Custom 14', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 14')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 15', 'Custom15', 'Work Order', 'Custom 15', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 15')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 16', 'Custom16', 'Work Order', 'Custom 16', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 16')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 2', 'Custom2', 'Work Order', 'Custom 2', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 3', 'Custom3', 'Work Order', 'Custom 3', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 4', 'Custom4', 'Work Order', 'Custom 4', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 5', 'Custom5', 'Work Order', 'Custom 5', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 6', 'Custom6', 'Work Order', 'Custom 6', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 7', 'Custom7', 'Work Order', 'Custom 7', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 7')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 8', 'Custom8', 'Work Order', 'Custom 8', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 8')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Custom 9', 'Custom9', 'Work Order', 'Custom 9', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Custom 9')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Department', 'Department', 'Request Manager', 'Department', 'Text', '', 0, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Department')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Description', 'Description', 'Request Manager', 'Description', 'Memo', '', 0, 1, 1000, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Description')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Labor Group', 'LaborGroup', 'LaborGroup', 'Code', 'Text', 'LaborGroup', 0, 0, 9, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Labor Group')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Location', 'LocationID', 'Location', 'LocationID', 'Text', 'Location', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Location')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Phone', 'Telephone', 'Request Manager', 'Phone', 'Text', '', 0, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Phone')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Priority', 'Priority', 'JobPriority', 'Code', 'Text', 'JobPriority', 0, 0, 2, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Priority')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Requestor', 'RequestorID', 'Requestor', 'RequestorID', 'Text', 'Requestor', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Requestor')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Requestor Name', 'RequestorName', 'Requestor', 'RequestorName', 'Text', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Requestor Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'State', 'State', 'Request Manager', 'State', 'Text', '', 0, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'State')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Request Manager', 'Zip Code', 'Zip', 'Request Manager', 'Zip Code', 'Text', '', 0, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Request Manager'

        And FormControls.ControlName = 'Zip Code')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Acknowledge', 'Acknowledge', 'Requisition', 'Acknowledge', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Acknowledge')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Buyer', 'Buyer', 'Requisition', 'Buyer', 'Text', 'Technician', 0, 0, 36, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Buyer')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Confirming', 'Confirming', 'Requisition', 'Confirming', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Confirming')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 1', 'Custom1', 'Requisition', 'Custom 1', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 10', 'Custom10', 'Requisition', 'Custom 10', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 10')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 11', 'Custom11', 'Requisition', 'Custom 11', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 11')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 12', 'Custom12', 'Requisition', 'Custom 12', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 12')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 13', 'Custom13', 'Requisition', 'Custom 13', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 13')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 14', 'Custom14', 'Requisition', 'Custom 14', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 14')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 15', 'Custom15', 'Requisition', 'Custom 15', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 15')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 16', 'Custom16', 'Requisition', 'Custom 16', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 16')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 2', 'Custom2', 'Requisition', 'Custom 2', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 3', 'Custom3', 'Requisition', 'Custom 3', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 4', 'Custom4', 'Requisition', 'Custom 4', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 5', 'Custom5', 'Requisition', 'Custom 5', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 6', 'Custom6', 'Requisition', 'Custom 6', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 7', 'Custom7', 'Requisition', 'Custom 7', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 7')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 8', 'Custom8', 'Requisition', 'Custom 8', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 8')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Custom 9', 'Custom9', 'Requisition', 'Custom 9', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Custom 9')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'FOB', 'FOB', 'Requisition', 'FOB', 'Text', 'FOB', 0, 0, 15, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'FOB')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Notes', 'Notes', 'Requisition', 'Notes', 'Memo', '', 0, 0, 1000, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Notes')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Payment Terms', 'PaymentTerms', 'Requisition', 'Payment Terms', 'Text', '', 0, 0, 15, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Payment Terms')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Ship City State', 'ShipCity', 'Requisition', 'Ship City State', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Ship City State')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Ship To Address 1', 'ShipAddress1', 'Requisition', 'Ship To Address 1', 'Text', '', 0, 0, 40, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Ship To Address 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Ship To Address 2', 'ShipAddress2', 'Requisition', 'Ship To Address 2', 'Text', '', 0, 0, 40, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Ship To Address 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Ship To Name', 'ShipName', 'Requisition', 'Ship To Name', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Ship To Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Ship Via', 'ShipVia', 'Requisition', 'Ship Via', 'Text', 'ShipVia', 0, 0, 15, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Ship Via')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Supplier', 'SupplierID', 'Supplier', 'Supplier', 'Text', 'Supplier', 0, 0, 10, 12

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Supplier')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Supplier Address 1', 'SupplierAddress1', 'Requisition', 'Supplier Address 1', 'Text', '', 1, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Supplier Address 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Supplier Address 2', 'SupplierAddress2', 'Requisition', 'Supplier Address 2', 'Text', '', 1, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Supplier Address 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Supplier City State', 'SupplierCityState', 'Requisition', 'Supplier City State', 'Text', '', 1, 0, 20, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Supplier City State')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Supplier Name', 'SupplierName', 'Requisition', 'Supplier Name', 'Text', '', 0, 0, 40, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Supplier Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Supplier Type', '', '', '', 'Text', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Supplier Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Requisition', 'Total Cost', 'TotalCost', 'Requisition', 'Total Cost', 'Decimal', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Requisition'

        And FormControls.ControlName = 'Total Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Address 1', 'Address1', 'Technician', 'Address 1', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Address 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Address 2', 'Address2', 'Technician', 'Address 2', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Address 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'City', 'City', 'Technician', 'City', 'Text', '', 0, 0, 24, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'City')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 1', 'Custom1', 'Technician', 'Custom 1', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 10', 'Custom10', 'Technician', 'Custom 10', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 10')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 11', 'Custom11', 'Technician', 'Custom 11', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 11')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 12', 'Custom12', 'Technician', 'Custom 12', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 12')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 13', 'Custom13', 'Technician', 'Custom 13', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 13')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 14', 'Custom14', 'Technician', 'Custom 14', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 14')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 15', 'Custom15', 'Technician', 'Custom 15', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 15')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 16', 'Custom16', 'Technician', 'Custom 16', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 16')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 2', 'Custom2', 'Technician', 'Custom 2', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 3', 'Custom3', 'Technician', 'Custom 3', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 4', 'Custom4', 'Technician', 'Custom 4', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 5', 'Custom5', 'Technician', 'Custom 5', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 6', 'Custom6', 'Technician', 'Custom 6', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 7', 'Custom7', 'Technician', 'Custom 7', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 7')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 8', 'Custom8', 'Technician', 'Custom 8', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 8')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Custom 9', 'Custom9', 'Technician', 'Custom 9', 'Text', '', 0, 0, 50, 25

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Custom 9')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Department Date', 'DeptDate', 'Technician', 'Dept Date', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Department Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Email', 'Email', 'Technician', 'Email', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Email')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Emergency Name', 'EmergencyName', 'Technician', 'Emergency Name', 'Text', '', 0, 0, 36, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Emergency Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Emergency Phone', 'EmergencyPhone', 'Technician', 'Emergency Phone', 'Text', '', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Emergency Phone')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Facility ID', 'FacilityID', 'FacilityID', 'Facility ID', 'Text', '', 1, 0, 8, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Facility ID')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Hire Date', 'HireDate', 'Technician', 'Hire Date', 'Date', 'Date', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Hire Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Labor Group', 'LaborGroup', 'LaborGroup', 'Code', 'Text', 'LaborGroup', 0, 0, 9, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Labor Group')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Name', 'Name', 'Technician', 'Name', 'Text', '', 1, 0, 50, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Name')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Notes', 'Notes', 'Technician', 'Notes', 'Memo', '', 0, 0, 1000, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Notes')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Pager Number', 'PagerNumber', 'Technician', 'Pager Number', 'Text', '', 0, 0, 20, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Pager Number')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Phone', 'Phone', 'Technician', 'Phone', 'Text', '', 0, 0, 24, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Phone')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Shift', 'ShiftID', 'Technician', 'ShiftID', 'Text', '', 0, 0, 6, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Shift')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'SSN', 'SSN', 'Technician', 'SSN', 'Text', '', 0, 0, 11, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'SSN')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'State', 'State', 'Technician', 'State', 'Text', '', 0, 0, 16, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'State')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Technician', 'Technician', 'Technician', 'Technician', 'Text', '', 0, 0, 10, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Technician')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Technician Type', 'TechType', 'TechType', 'TechType', 'Text', 'TechType', 0, 0, 9, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Technician Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Technician', 'Zip Code', 'Zip', 'Technician', 'Zip', 'Text', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Technician'

        And FormControls.ControlName = 'Zip Code')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Account Code', 'AccountCode', 'AccountCodes', 'AccountCode', 'Text', 'AccountCode', 0, 0, 24, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Account Code')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Action', 'Defect6', 'Defects6', 'Code', 'Text', 'Action', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Action')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Actual Hours', 'ActualManhours', 'Work Order', 'Actual Hours', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Actual Hours')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Area', 'Area', 'Area', 'Area', 'Text', '', 1, 1, 20, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Area')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Asset', 'Equipment', 'Asset', 'Asset', 'Text', '', 1, 1, 20, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Asset')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Asset Under Warranty', 'AssetUnderWarranty', 'Work Order', 'Asset Under Warranty', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Asset Under Warranty')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Auto Save Labor', 'AutoSaveLabor', 'Work Order', 'Auto Save Labor', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Auto Save Labor')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Category', 'Category', 'ProjectCategory', 'Category', 'Text', 'Category', 0, 0, 16, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Category')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Cause', 'Defect5', 'Defects5', 'Code', 'Text', 'Cause', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Cause')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Charge Department', 'ChargeDept', 'ChargeDepartment', 'ChargeDept', 'Text', 'ChargeDept', 0, 0, 25, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Charge Department')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Component', 'SubLevel', 'SubLevel', 'SubLevel', 'Text', '', 1, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Component')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 1', 'Condition1', 'Work Order', 'Condition 1', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 10', 'Condition10', 'Work Order', 'Condition 10', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 10')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 11', 'Condition11', 'Work Order', 'Condition 11', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 11')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 12', 'Condition12', 'Work Order', 'Condition 12', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 12')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 13', 'Condition13', 'Work Order', 'Condition 13', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 13')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 14', 'Condition14', 'Work Order', 'Condition 14', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 14')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 15', 'Condition15', 'Work Order', 'Condition 15', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 15')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 16', 'Condition16', 'Work Order', 'Condition 16', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 16')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 2', 'Condition2', 'Work Order', 'Condition 2', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 3', 'Condition3', 'Work Order', 'Condition 3', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 4', 'Condition4', 'Work Order', 'Condition 4', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 5', 'Condition5', 'Work Order', 'Condition 5', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 6', 'Condition6', 'Work Order', 'Condition 6', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 7', 'Condition7', 'Work Order', 'Condition 7', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 7')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 8', 'Condition8', 'Work Order', 'Condition 8', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 8')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Condition 9', 'Condition9', 'Work Order', 'Condition 9', 'Decimal', '', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Condition 9')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Contractor', 'ContractorCode', 'Contractor', 'Contractor', 'Text', 'Contractor', 0, 0, 10, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Contractor')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Contractor Labor Cost', 'LaborCost', 'Work Order', 'Contractor Labor Cost', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Contractor Labor Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Contractor Material Cost', 'MaterialCost', 'Work Order', 'Contractor Material Cost', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Contractor Material Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Contractor Total Cost', 'JobCost', 'Work Order', 'Contractor Total Cost', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Contractor Total Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Created By', 'CreatedBy', 'Work Order', 'Created By', 'Text', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Created By')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 1', 'Custom1', 'Work Order', 'Custom 1', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 1')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 10', 'Custom10', 'Work Order', 'Custom 10', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 10')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 11', 'Custom11', 'Work Order', 'Custom 11', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 11')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 12', 'Custom12', 'Work Order', 'Custom 12', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 12')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 13', 'Custom13', 'Work Order', 'Custom 13', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 13')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 14', 'Custom14', 'Work Order', 'Custom 14', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 14')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 15', 'Custom15', 'Work Order', 'Custom 15', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 15')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 16', 'Custom16', 'Work Order', 'Custom 16', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 16')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 2', 'Custom2', 'Work Order', 'Custom 2', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 3', 'Custom3', 'Work Order', 'Custom 3', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 4', 'Custom4', 'Work Order', 'Custom 4', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 5', 'Custom5', 'Work Order', 'Custom 5', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 5')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 6', 'Custom6', 'Work Order', 'Custom 6', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 6')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 7', 'Custom7', 'Work Order', 'Custom 7', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 7')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 8', 'Custom8', 'Work Order', 'Custom 8', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 8')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Custom 9', 'Custom9', 'Work Order', 'Custom 9', 'Text', '', 0, 0, 40, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Custom 9')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Defect 2', 'Defect2', 'Defects2', 'Code', 'Text', 'Defect2', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Defect 2')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Defect 3', 'Defect3', 'Defects3', 'Code', 'Text', 'Defect3', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Defect 3')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Defect 4', 'Defect4', 'Defects4', 'Code', 'Text', 'Defect4', 0, 0, 12, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Defect 4')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Details', 'Details', 'Work Order', 'Details', 'Memo', '', 0, 0, 1000, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Details')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Downtime Start', 'DowntimeStartDate', 'Work Order', 'Downtime Start', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Downtime Start')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Downtime Stop', 'DowntimeStopDate', 'Work Order', 'Downtime Stop', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Downtime Stop')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Est Non Production Hours', 'EstNonProductionHours', 'Work Order', 'Est Non Production Hours', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Est Non Production Hours')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Est Production Hours', 'EstProductionHours', 'Work Order', 'Est Production Hours', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Est Production Hours')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Estimated Finish Date', 'EstimatedFinishDate', 'Work Order', 'Estimated Finish Date', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Estimated Finish Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Estimated Issue Date', 'ProjectedIssueDate', 'Work Order', 'Estimated Issue Date', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Estimated Issue Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Estimated Labor Cost', 'EstimatedLaborCost', 'Work Order', 'Estimated Labor Cost', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Estimated Labor Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Estimated Parts Cost', 'EstimatedPartsCost', 'Work Order', 'Estimated Parts Cost', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Estimated Parts Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Estimated Total Cost', 'EstimatedCost', 'Work Order', 'Estimated Total Cost', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Estimated Total Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Estimated Total Hours', 'EstimatedManhours', 'Work Order', 'Estimated Total Hours', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Estimated Total Hours')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Facility ID', 'FacilityID', 'FacilityID', 'Facility ID', 'Text', '', 1, 0, 8, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Facility ID')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Follow Up Needed', 'FollowUp', 'Work Order', 'Follow Up Needed', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Follow Up Needed')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Follow Up WO', 'RefWO', 'Work Order', 'Follow Up WO', 'Integer', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Follow Up WO')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Hours Remaining', 'HoursRemaining', 'Work Order', 'Hours Remaining', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Hours Remaining')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Inside Labor Cost', 'CalcLaborCost', 'Work Order', 'Inside Labor Cost', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Inside Labor Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Inside Parts Cost', 'PartsCost', 'Work Order', 'Inside Parts Cost', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Inside Parts Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Instructions', 'Instructions', 'Work Order', 'Instructions', 'Memo', '', 0, 0, 1000, 20

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Instructions')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Job Finish Date', 'JobCloseDate', 'Work Order', 'Job Finish Date', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Job Finish Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Job Start Date', 'JobOpenDate', 'Work Order', 'Job Start Date', 'Date', 'Date', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Job Start Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Job Type', 'JobTypeCode', 'JobType', 'JobType', 'Text', 'JobType', 0, 1, 18, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Job Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Labor Group', 'LaborGroup', 'LaborGroup', 'Code', 'Text', 'LaborGroup', 0, 0, 9, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Labor Group')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Line Downtime', 'LineDowntimeNumber', 'Work Order', 'Line Downtime', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Line Downtime')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Line Number', 'LineNumber', 'Work Order', 'Line Number', 'Decimal', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Line Number')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Location', 'LocationID', 'Location', 'LocationID', 'Text', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Location')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'LTD WO Cost', 'TotalCost', 'Work Order', 'LTD WO Cost', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'LTD WO Cost')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Machine Downtime', 'MachineDowntime', 'Work Order', 'Machine Downtime', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Machine Downtime')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Occurences', 'Occurences', 'Work Order', 'Occurences', 'Integer', '', 0, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Occurences')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Originating WO', 'OriginatingWO', 'Work Order', 'Originating WO', 'Integer', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Originating WO')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'PDA Work Order', 'PDAWorkOrder', 'Work Order', 'PDA Work Order', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'PDA Work Order')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Phase', 'Phase', 'ProjectPhase', 'Phase', 'Text', 'Phase', 0, 0, 16, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Phase')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Planning Button', '', 'System', 'Planning Button', 'Button', '', 1, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Planning Button')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Print Dedicated Part', 'PrintDedicatedPart', 'Work Order', 'Print Dedicated Part', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Print Dedicated Part')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Priority', 'Priority', 'JobPriority', 'Code', 'Text', 'JobPriority', 0, 0, 2, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Priority')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Problem', 'Defect1', 'Defects1', 'Code', 'Text', 'Defect1', 0, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Problem')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Product', 'Model', 'Models', 'Model', 'Text', 'Product', 0, 0, 30, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Product')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Project', 'ProjectCode', 'Projects', 'Project', 'Text', 'Project', 0, 0, 15, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Project')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Project Type', '', 'ProjectType', 'Type', 'Text', 'ProjectType', 0, 0, 16, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Project Type')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Requestor', 'RequestNumber', 'Requestor', 'RequestorID', 'Text', '', 1, 0, 20, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Requestor')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'RIME Priority', 'RimePriority', 'Work Order', 'RIME Priority', 'Decimal', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'RIME Priority')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Schedule Number', 'ScheduleNumber', 'Work Order', 'Schedule Number', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Schedule Number')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Shift', 'Shift', 'Work Order', 'Shift', 'Text', '', 0, 0, 1, 5

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Shift')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Status', 'Status', 'StatusType', 'Status', 'Text', 'WOStatus', 0, 1, 8, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Status')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Status Date', 'StatusDate', 'Work Order', 'Status Date', 'Date', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Status Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Task Code', 'TaskCode', 'TaskInstructions', 'TaskCode', 'Text', 'TaskCode', 0, 0, 12, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Task Code')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Technician', 'Technician', 'Technician', 'Technician', 'Text', 'TechnicianRec', 0, 0, 10, 15

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Technician')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Update Job Finish', '', 'Work Order', 'Update Job Finish', 'Logical', '', 0, 0, 1, 1

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Update Job Finish')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'WO Create Date', 'ActualIssueDate', 'Work Order', 'WO Create Date', 'Date', '', 1, 0, 10, 8

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'WO Create Date')
 

INSERT INTO FormControls

    (FacilityID, FormName, ControlName, FieldName, CaptionTableName, CaptionFieldName,

     FieldType, LookupName, ReadOnly, Required, MaxLength, DefaultWidth)

    Select FacilityID, 'Work Order', 'Work Order Number', 'JobNumber', 'Work Order', 'Work Order Number', 'Integer', '', 1, 0, 10, 10

       From FacilityID Where Not Exists

       (Select * From FormControls Where FormControls.FacilityID = FacilityID.FacilityID

        And FormControls.FormName = 'Work Order'

        And FormControls.ControlName = 'Work Order Number')
 
 

Delete From FormTabs

	Where SecurityID = '_EPACCMMS_'

GO
 

--Insert FormTabs

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Attachments', 'Attachments', 1, 1, 9, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom Fields', 0, 1, 7, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Details', 'Details', 1, 1, 1, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Financial', 'Financial', 1, 1, 5, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Hierarchy', 'Hierarchy', 1, 1, 3, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Lockout', 'Lockout', 0, 1, 4, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Main', 0, 1, 0, 10, 4)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'Meters', 0, 1, 2, 10, 4)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Parts', 'Parts', 1, 1, 6, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'WOs', 'WOs', 1, 1, 8, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Attachments', 'Attachments', 1, 1, 5, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Calendar', 'Calendar', 1, 1, 1, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Main', 0, 1, 0, 10, 4)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Miscellaneous', 'Misc', 0, 1, 2, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Open Wos', 'Open WOs', 1, 1, 4, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Skip Dates', 'Skip Dates', 0, 1, 3, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Attachments', 'Attachments', 1, 1, 9, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom Fields', 0, 1, 8, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Location', 'Location', 1, 1, 1, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Main', 0, 1, 0, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Notes', 'Notes', 0, 1, 2, 4, 1)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'On Order', 'On Order', 1, 1, 5, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Purchasing', 'Purchasing', 1, 1, 3, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Received', 'Received', 1, 1, 4, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Reserve', 'Reserve', 1, 1, 7, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Used', 'Used', 1, 1, 6, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Attachments', 'Attachments', 1, 1, 5, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Levels', 1, 1, 1, 10, 7)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Main', 0, 1, 0, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Miscellaneous', 'Miscellaneous', 0, 1, 3, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Open Wos', 'Open WOs', 1, 1, 4, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'View', 'View', 1, 1, 2, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom Fields', 0, 1, 3, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Line Items', 'Line Items', 1, 1, 1, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Main', 0, 1, 0, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Notes', 'Notes', 0, 1, 2, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Main', 0, 1, 0, 15, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom Fields', 0, 1, 3, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Line Items', 'Line Items', 1, 1, 1, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Main', 0, 1, 0, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Notes', 'Notes', 0, 1, 2, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Attachments', 'Attachments', 1, 1, 4, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom Fields', 0, 1, 3, 10, 4)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'History', 'History', 1, 1, 2, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Main', 'Main', 0, 1, 0, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'Personal', 0, 1, 1, 10, 2)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Actual Labor', 'Actual Labor', 1, 1, 3, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Actual Parts', 'Actual Parts', 1, 1, 2, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Attachments', 'Attachments', 1, 1, 9, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Conditions', 0, 1, 6, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom Fields', 0, 1, 7, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Details', 0, 1, 5, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Financial', 'Financial', 1, 1, 8, 0, 0)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Job Costing', 0, 1, 4, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Work Plan', 0, 1, 0, 10, 3)
 

INSERT INTO FormTabs

    (FacilityID, SecurityID, FormName, TabName, Caption, Locked, Visible, TabPosition, NumberRows, NumberCols)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Work Close', 0, 1, 1, 10, 3)
 
 
 

Delete From FormLayouts

	Where SecurityID = '_EPACCMMS_'

GO
 

--Insert FormLayouts records

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 1', 0, 0, 0, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 10', 0, 0, 1, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 11', 0, 0, 2, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 12', 0, 0, 3, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 13', 0, 0, 4, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 14', 0, 0, 5, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 15', 0, 0, 6, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 16', 0, 0, 7, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 2', 0, 0, 1, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 3', 0, 0, 2, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 4', 0, 0, 3, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 5', 0, 0, 4, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 6', 0, 0, 5, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 7', 0, 0, 6, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 8', 0, 0, 7, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Custom Fields', 'Custom 9', 0, 0, 0, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Lockout', 'Lockout', 0, 0, 0, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Asset Number', 0, 0, 2, 0, 21)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Asset RIME', 1, 0, 7, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Charge Dept', 1, 0, 3, 0, 21)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Class', 1, 0, 6, 3, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Create Date', 0, 0, 8, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Drawing Number', 0, 0, 5, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Equipment No', 0, 0, 1, 3, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'In Service Date', 0, 0, 3, 3, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Manufacturer', 1, 0, 4, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Model Number', 0, 0, 4, 3, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Parent', 0, 0, 0, 0, 21)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Parts List ID', 0, 0, 0, 3, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Priority', 0, 0, 2, 3, 6)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'RCM Group', 1, 0, 7, 3, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Serial Number', 0, 0, 6, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Status', 0, 0, 1, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Status Date', 0, 0, 8, 1, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Warranty Cycle End', 0, 0, 8, 3, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Warranty Date', 0, 0, 8, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Main', 'Zone', 1, 0, 5, 3, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'Meter 1 Incremental', 0, 0, 0, 1, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'Meter 1 Name', 0, 0, 0, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'Meter 1 Reading', 0, 0, 1, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'Meter 1 Total', 0, 0, 2, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'Meter 2 Incremental', 0, 0, 0, 3, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'Meter 2 Name', 0, 0, 0, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'Meter 2 Reading', 0, 0, 1, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'Meter 2 Total', 0, 0, 2, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'MTBR', 0, 0, 5, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Asset', 'Meters', 'MTTR', 0, 0, 6, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Activate PM', 0, 0, 6, 1, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Estimated Job Hours', 0, 0, 5, 1, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Initialize Date', 0, 0, 7, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Interval Type', 0, 0, 1, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Job Priority', 1, 0, 2, 2, 6)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Job Type', 1, 0, 2, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Labor Group', 1, 0, 4, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Last Completed Date', 0, 0, 7, 2, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Last Release Date', 0, 0, 7, 1, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Manual Dates', 0, 0, 8, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Min Days', 0, 0, 3, 2, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Next Schedule Date', 0, 0, 3, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Number Techs', 0, 0, 5, 0, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Overdue Days', 0, 0, 6, 0, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Planning Button', 0, 0, 6, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Schedule Type', 0, 0, 0, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Shift', 0, 0, 5, 2, 6)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Task Code', 1, 0, 0, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Technician', 0, 0, 4, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Main', 'Time Interval', 0, 0, 1, 2, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Miscellaneous', 'Account Code', 1, 0, 1, 0, 28)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Miscellaneous', 'Contractor', 1, 0, 0, 0, 28)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Miscellaneous', 'Estimated Labor Cost', 0, 0, 2, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Miscellaneous', 'Print Dedicated Parts', 0, 0, 3, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Skip Dates', 'Skip Set 1', 1, 0, 0, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Skip Dates', 'Skip Set 2', 1, 0, 1, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Skip Dates', 'Skip Set 3', 1, 0, 2, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Skip Dates', 'Skip Set 4', 1, 0, 3, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Skip Dates', 'Skip Set 5', 1, 0, 4, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Calendar PM', 'Skip Dates', 'Skip Set 6', 1, 0, 5, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 1', 0, 0, 0, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 10', 0, 0, 1, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 11', 0, 0, 2, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 12', 0, 0, 3, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 13', 0, 0, 4, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 15', 0, 0, 6, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 16', 0, 0, 7, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 2', 0, 0, 1, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 3', 0, 0, 2, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 4', 0, 0, 3, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 5', 0, 0, 4, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 6', 0, 0, 5, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 7', 0, 0, 6, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 8', 0, 0, 7, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom 9', 0, 0, 0, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Custom Fields', 'Custom14', 0, 0, 5, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'ABC Class', 0, 0, 7, 0, 6)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Add To Dedicated Parts', 0, 0, 0, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Charge Dept', 1, 0, 3, 1, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Class Code', 1, 0, 3, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Commodity', 1, 0, 3, 2, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Conversion', 0, 0, 4, 2, 6)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Create Date', 0, 0, 7, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Inventory Type', 0, 0, 1, 2, 6)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Lot Size', 0, 0, 5, 2, 6)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Manufacturers', 1, 0, 1, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Max Level', 0, 0, 6, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Mfg Part Number', 0, 0, 0, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Min Level', 0, 0, 6, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Order Cost', 0, 0, 5, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Order Measure', 1, 0, 4, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Priority', 1, 0, 2, 2, 6)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Stock Cost', 0, 0, 5, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Stock Measure', 1, 0, 4, 1, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Supplier', 1, 0, 2, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Main', 'Taxable', 0, 0, 6, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Notes', 'Notes', 0, 0, 0, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Inventory', 'Notes', 'PO Notes', 0, 0, 3, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Completion Days A', 0, 0, 0, 3, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Completion Days B', 0, 0, 1, 3, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Completion Days C', 0, 0, 2, 3, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Completion Days D', 0, 0, 3, 3, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Completion Days E', 0, 0, 4, 3, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Hours A', 0, 0, 0, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Hours B', 0, 0, 1, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Hours C', 0, 0, 2, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Hours D', 0, 0, 3, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Hours E', 0, 0, 4, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Multiple B', 0, 0, 1, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Multiple C', 0, 0, 2, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Multiple D', 0, 0, 3, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Multiple E', 0, 0, 4, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Number Tech A', 0, 0, 0, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Number Tech B', 0, 0, 1, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Number Tech C', 0, 0, 2, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Number Tech D', 0, 0, 3, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Number Tech E', 0, 0, 4, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Priority A', 0, 0, 0, 4, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Priority B', 0, 0, 1, 4, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Priority C', 0, 0, 2, 4, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Priority D', 0, 0, 3, 4, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Priority E', 0, 0, 4, 4, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Shift A', 0, 0, 0, 5, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Shift B', 0, 0, 1, 5, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Shift C', 0, 0, 2, 5, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Shift D', 0, 0, 3, 5, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Shift E', 0, 0, 4, 5, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Task Code A', 0, 0, 0, 6, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Task Code B', 0, 0, 1, 6, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Task Code C', 0, 0, 2, 6, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Task Code D', 0, 0, 3, 6, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Levels', 'Task Code E', 0, 0, 4, 6, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Cycle Start Reading', 0, 0, 6, 0, 7)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Early Release', 0, 0, 0, 2, 7)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Job Type', 1, 0, 3, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Labor Group', 1, 0, 1, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Last Completed Date', 0, 0, 4, 2, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Last Completed Meter', 0, 0, 2, 2, 7)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Last Release Date', 0, 0, 5, 2, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Max Days', 0, 0, 4, 0, 7)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Meter Interval', 0, 0, 5, 0, 7)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Meter Name', 0, 0, 0, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Planning Button', 0, 0, 6, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Technician', 0, 0, 2, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Util Since Last', 0, 0, 1, 2, 7)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Main', 'Warranty Cycle End', 0, 0, 3, 2, 7)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Miscellaneous', 'Account Code', 1, 0, 1, 0, 28)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Miscellaneous', 'Contractor', 1, 0, 0, 0, 28)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Miscellaneous', 'Estimated Labor Cost', 0, 0, 2, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Meter PM', 'Miscellaneous', 'Print Dedicated Parts', 0, 0, 3, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 1', 0, 0, 0, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 10', 0, 0, 1, 1, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 11', 0, 0, 2, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 12', 0, 0, 3, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 13', 0, 0, 4, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 14', 0, 0, 5, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 15', 0, 0, 6, 1, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 16', 0, 0, 7, 1, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 2', 0, 0, 1, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 3', 0, 0, 2, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 4', 0, 0, 3, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 5', 0, 0, 4, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 6', 0, 0, 5, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 7', 0, 0, 6, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 8', 0, 0, 7, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Custom Fields', 'Custom 9', 0, 0, 0, 1, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Acknowledge', 0, 0, 6, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Buyer', 0, 0, 8, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Confirming', 0, 0, 7, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'FOB', 1, 0, 8, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Payment Terms', 0, 0, 9, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Ship City State', 0, 0, 5, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Ship To Address 1', 0, 0, 3, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Ship To Address 2', 0, 0, 4, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Ship To Name', 0, 0, 2, 2, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Ship Via', 1, 0, 8, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Supplier', 1, 0, 1, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Supplier Address 1', 0, 0, 3, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Supplier Address 2', 0, 0, 4, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Supplier City State', 0, 0, 5, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Supplier Name', 0, 0, 2, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Main', 'Total Cost', 0, 0, 9, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Purchase Order', 'Notes', 'Notes', 0, 0, 0, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Account Code', 0, 0, 13, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Address', 0, 0, 10, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Area', 0, 0, 1, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Asset', 0, 0, 2, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Charge Department', 0, 0, 13, 1, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'City', 0, 0, 11, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Component', 0, 0, 3, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Custom 10', 0, 0, 9, 1, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Department', 0, 0, 11, 1, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Description', 0, 0, 4, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Labor Group', 0, 0, 7, 1, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Location', 0, 0, 0, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Phone', 0, 0, 10, 1, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Priority', 0, 0, 7, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Requestor', 0, 0, 8, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Requestor Name', 0, 0, 9, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'State', 0, 0, 12, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Request Manager', 'Main', 'Zip Code', 0, 0, 12, 1, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 1', 0, 0, 0, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 10', 0, 0, 1, 1, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 11', 0, 0, 2, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 12', 0, 0, 3, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 13', 0, 0, 4, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 14', 0, 0, 5, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 15', 0, 0, 6, 1, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 16', 0, 0, 7, 1, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 2', 0, 0, 1, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 3', 0, 0, 2, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 4', 0, 0, 3, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 5', 0, 0, 4, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 6', 0, 0, 5, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 7', 0, 0, 6, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 8', 0, 0, 7, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Custom Fields', 'Custom 9', 0, 0, 0, 1, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Acknowledge', 0, 0, 6, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Buyer', 0, 0, 8, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Confirming', 0, 0, 7, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'FOB', 1, 0, 8, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Payment Terms', 0, 0, 9, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Ship City State', 0, 0, 5, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Ship To Address 1', 0, 0, 3, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Ship To Address 2', 0, 0, 4, 2, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Ship To Name', 0, 0, 2, 2, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Ship Via', 1, 0, 8, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Supplier', 1, 0, 1, 0, 12)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Supplier Address 1', 0, 0, 3, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Supplier Address 2', 0, 0, 4, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Supplier City State', 0, 0, 5, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Supplier Name', 0, 0, 2, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Main', 'Total Cost', 0, 0, 9, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Requisition', 'Notes', 'Notes', 0, 0, 0, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 1', 0, 0, 0, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 10', 0, 0, 1, 1, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 11', 0, 0, 2, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 12', 0, 0, 3, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 13', 0, 0, 4, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 14', 0, 0, 5, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 15', 0, 0, 6, 1, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 16', 0, 0, 7, 1, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 2', 0, 0, 1, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 3', 0, 0, 2, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 4', 0, 0, 3, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 5', 0, 0, 4, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 6', 0, 0, 5, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 7', 0, 0, 6, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 8', 0, 0, 7, 0, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Custom Fields', 'Custom 9', 0, 0, 0, 1, 25)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Main', 'Department Date', 0, 0, 0, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Main', 'Hire Date', 0, 0, 0, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Main', 'Labor Group', 0, 0, 1, 0, 15)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Main', 'Notes', 0, 0, 2, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Main', 'Shift', 0, 0, 1, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Main', 'Technician Type', 0, 0, 1, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'Address 1', 0, 0, 0, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'Address 2', 0, 0, 1, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'City', 0, 0, 2, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'Email', 0, 0, 4, 1, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'Emergency Name', 0, 0, 0, 1, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'Emergency Phone', 0, 0, 1, 1, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'Pager Number', 0, 0, 3, 1, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'Phone', 0, 0, 5, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'SSN', 0, 0, 2, 1, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'State', 0, 0, 3, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Technician', 'Personal', 'Zip Code', 0, 0, 4, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 1', 0, 0, 0, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 10', 0, 0, 1, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 11', 0, 0, 2, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 12', 0, 0, 3, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 13', 0, 0, 4, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 14', 0, 0, 5, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 15', 0, 0, 6, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 16', 0, 0, 7, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 2', 0, 0, 1, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 3', 0, 0, 2, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 4', 0, 0, 3, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 5', 0, 0, 4, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 6', 0, 0, 5, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 7', 0, 0, 6, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 8', 0, 0, 7, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Conditions', 'Condition 9', 0, 0, 0, 2, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 1', 0, 0, 0, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 10', 0, 0, 1, 2, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 11', 0, 0, 2, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 12', 0, 0, 3, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 13', 0, 0, 4, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 14', 0, 0, 5, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 15', 0, 0, 6, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 16', 0, 0, 7, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 2', 0, 0, 1, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 3', 0, 0, 2, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 4', 0, 0, 3, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 5', 0, 0, 4, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 6', 0, 0, 5, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 7', 0, 0, 6, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 8', 0, 0, 7, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Custom Fields', 'Custom 9', 0, 0, 0, 2, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Created By', 0, 0, 3, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Defect 2', 1, 0, 4, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Defect 3', 1, 0, 5, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Defect 4', 1, 0, 6, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Est Non Production Hours', 0, 0, 1, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Est Production Hours', 0, 0, 0, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Line Number', 0, 0, 2, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Product', 1, 0, 7, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'Status Date', 0, 0, 9, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Details', 'WO Create Date', 0, 0, 8, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Account Code', 1, 0, 2, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Category', 0, 0, 3, 2, 15)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Charge Department', 1, 0, 1, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Contractor', 1, 0, 3, 0, 15)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Contractor Labor Cost', 0, 0, 4, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Contractor Material Cost', 0, 0, 5, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Contractor Total Cost', 0, 0, 6, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Estimated Labor Cost', 0, 0, 4, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Estimated Parts Cost', 0, 0, 5, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Estimated Total Cost', 0, 0, 6, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Inside Labor Cost', 0, 0, 4, 1, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Inside Parts Cost', 0, 0, 5, 1, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'LTD WO Cost', 0, 0, 6, 1, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Phase', 0, 0, 2, 2, 15)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Project', 1, 0, 1, 2, 15)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Project Type', 1, 0, 0, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Job Costing', 'Status', 1, 0, 0, 0, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Asset Under Warranty', 1, 0, 10, 3, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Estimated Finish Date', 0, 0, 1, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Estimated Issue Date', 0, 0, 0, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Estimated Total Hours', 0, 0, 4, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Follow Up WO', 0, 0, 9, 1, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Instructions', 0, 0, 6, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Job Type', 1, 0, 1, 0, 15)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Labor Group', 1, 0, 2, 0, 15)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Originating WO', 0, 0, 9, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Planning Button', 0, 0, 5, 2, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Print Dedicated Part', 0, 0, 9, 3, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Priority', 1, 0, 2, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Problem', 1, 0, 5, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'RIME Priority', 0, 0, 9, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Shift', 0, 0, 3, 2, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Status', 1, 0, 0, 0, 5)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Task Code', 1, 0, 4, 0, 15)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Main', 'Technician', 0, 0, 3, 0, 15)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Action', 1, 0, 2, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Actual Hours', 0, 0, 5, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Auto Save Labor', 0, 0, 4, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Cause', 1, 0, 1, 0, 10)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Details', 0, 0, 7, 0, 20)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Downtime Start', 0, 0, 2, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Downtime Stop', 0, 0, 3, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Follow Up Needed', 0, 0, 3, 0, 1)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Hours Remaining', 0, 0, 6, 0, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Job Finish Date', 0, 0, 1, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Job Start Date', 0, 0, 0, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Line Downtime', 0, 0, 5, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Machine Downtime', 0, 0, 4, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Occurences', 0, 0, 6, 2, 8)
 

INSERT INTO FormLayouts

    (FacilityID, SecurityID, FormName, TabName, ControlName, Buildable, ShowDescription, Row, Col, Width)

    Values ('MAIN', '_EPACCMMS_', 'Work Order', 'Work Close', 'Status', 1, 0, 0, 0, 5)
 
 
 
 
 

Delete From LabelCaptions

	Where LanguageCode = 'Default'

GO
 

--Insert LabelCaptions records

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'AccountCodes', 'AccountCode', 'Default', 'Account Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'AccountCodes'

        And LabelCaptions.FieldName = 'AccountCode'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'AccountCodes', 'AccountTax', 'Default', 'Account Tax', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'AccountCodes'

        And LabelCaptions.FieldName = 'AccountTax'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'AccountCodes', 'AccountType', 'Default', 'Account Type', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'AccountCodes'

        And LabelCaptions.FieldName = 'AccountType'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'AccountCodes', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'AccountCodes'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'AccountCodes', 'EndDate', 'Default', 'End Date', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'AccountCodes'

        And LabelCaptions.FieldName = 'EndDate'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'AccountCodes', 'StartDate', 'Default', 'Start Date', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'AccountCodes'

        And LabelCaptions.FieldName = 'StartDate'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'AccountType', 'AccountType', 'Default', 'AccountType', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'AccountType'

        And LabelCaptions.FieldName = 'AccountType'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'AccountType', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'AccountType'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Area', 'Area', 'Default', 'Area', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Area'

        And LabelCaptions.FieldName = 'Area'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Area', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Area'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Asset', 'Default', 'Asset', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Asset'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Asset Number', 'Default', 'Asset Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Asset Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Attachments Tab', 'Default', 'Attachments', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Attachments Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Child', 'Default', 'Child', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Child'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Component', 'Default', 'Component', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Component'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Component Description', 'Default', 'Description', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Component Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Component Notes', 'Default', 'Notes', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Component Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Create Date', 'Default', 'Create Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Create Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 1', 'Default', 'Custom 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 10', 'Default', 'Custom 10', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 10'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 11', 'Default', 'Custom 11', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 11'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 12', 'Default', 'Custom 12', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 12'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 13', 'Default', 'Custom 13', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 13'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 14', 'Default', 'Custom 14', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 14'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 15', 'Default', 'Custom 15', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 15'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 16', 'Default', 'Custom 16', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 16'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 2', 'Default', 'Custom 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 3', 'Default', 'Custom 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 4', 'Default', 'Custom 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 5', 'Default', 'Custom 5', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 5'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 6', 'Default', 'Custom 6', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 6'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 7', 'Default', 'Custom 7', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 7'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 8', 'Default', 'Custom 8', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 8'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom 9', 'Default', 'Custom 9', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom 9'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Custom Fields Tab', 'Default', 'Custom Fields', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Custom Fields Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Date Data 1', 'Default', 'Date 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Date Data 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Date Data 2', 'Default', 'Date 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Date Data 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Date Data 3', 'Default', 'Date 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Date Data 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Date Data 4', 'Default', 'Date 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Date Data 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Depreciated Value', 'Default', 'Present Month Depreciated Value', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Depreciated Value'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Description', 'Default', 'Description', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Details Tab', 'Default', 'Details', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Details Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Drawing Number', 'Default', 'Drawing Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Drawing Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Equipment No', 'Default', 'Equipment No.', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Equipment No'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Estimated Life', 'Default', 'Estimated Life', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Estimated Life'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Financial Tab', 'Default', 'Financial', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Financial Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Hierarchy Tab', 'Default', 'Hierarchy', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Hierarchy Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'In Service Date', 'Default', 'In Service Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'In Service Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Lockout', 'Default', 'Lockout', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Lockout'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Lockout Tab', 'Default', 'Lockout', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Lockout Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Logical Data 1', 'Default', 'Logical 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Logical Data 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Logical Data 2', 'Default', 'Logical 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Logical Data 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Main Tab', 'Default', 'Main', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Main Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Meter 1 Incremental', 'Default', 'Incremental', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Meter 1 Incremental'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Meter 1 Name', 'Default', 'Meter 1 Name', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Meter 1 Name'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Meter 1 Reading', 'Default', 'Current Reading', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Meter 1 Reading'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Meter 1 Total', 'Default', 'Asset Total', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Meter 1 Total'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Meter 2 Incremental', 'Default', 'Incremental', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Meter 2 Incremental'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Meter 2 Name', 'Default', 'Meter 2 Name', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Meter 2 Name'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Meter 2 Reading', 'Default', 'Current Reading', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Meter 2 Reading'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Meter 2 Total', 'Default', 'Asset Total', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Meter 2 Total'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Meters Tab', 'Default', 'Meters', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Meters Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Model Number', 'Default', 'Model Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Model Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Monthly Depreciation', 'Default', 'Monthly Depreciation', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Monthly Depreciation'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'MTBR', 'Default', 'MTBR', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'MTBR'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'MTTR', 'Default', 'MTTR', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'MTTR'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Notes', 'Default', 'Notes', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Numeric Data 1', 'Default', 'Numeric 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Numeric Data 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Numeric Data 2', 'Default', 'Numeric 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Numeric Data 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Original Cost', 'Default', 'Original Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Original Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Parent', 'Default', 'Parent', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Parent'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Parts Tab', 'Default', 'Parts', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Parts Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Priority', 'Default', 'Priority', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Priority'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Record Type', 'Default', 'Record Type', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Record Type'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Salvage Value', 'Default', 'Salvage Value', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Salvage Value'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Serial Number', 'Default', 'Serial Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Serial Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Status Date', 'Default', 'Status Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Status Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Table Data 1', 'Default', 'Table 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Table Data 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Table Data 2', 'Default', 'Table 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Table Data 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Table Data 3', 'Default', 'Table 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Table Data 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Table Data 4', 'Default', 'Table 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Table Data 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Table Data 5', 'Default', 'Table 5', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Table Data 5'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Table Data 6', 'Default', 'Table 6', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Table Data 6'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Text Data 1', 'Default', 'Text 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Text Data 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Text Data 2', 'Default', 'Text 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Text Data 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Text Data 3', 'Default', 'Text 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Text Data 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Text Data 4', 'Default', 'Text 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Text Data 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Under Warranty', 'Default', 'Under Warranty', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Under Warranty'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Warranty Cycle End', 'Default', 'Warranty Cycle End', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Warranty Cycle End'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'Warranty Date', 'Default', 'Warranty Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'Warranty Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Asset', 'WOs Tab', 'Default', 'WOs', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Asset'

        And LabelCaptions.FieldName = 'WOs Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Activate PM', 'Default', 'Activate PM', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Activate PM'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Attachments Tab', 'Default', 'Attachments', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Attachments Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Calendar Tab', 'Default', 'Calendar', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Calendar Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Completion Days', 'Default', 'Completion Days', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Completion Days'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Estimated Job Hours', 'Default', 'Estimated Job Hours', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Estimated Job Hours'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Estimated Labor Cost', 'Default', 'Estimated Labor Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Estimated Labor Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Initialize Date', 'Default', 'Initialize Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Initialize Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Interval Type', 'Default', 'Interval Type', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Interval Type'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Last Completed Date', 'Default', 'Last Completed Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Last Completed Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Last Release Date', 'Default', 'Last Release Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Last Release Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Main Tab', 'Default', 'Main', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Main Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Manual Dates', 'Default', 'Manual Dates', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Manual Dates'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Min Days', 'Default', 'Min Days', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Min Days'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Miscellaneous Tab', 'Default', 'Misc', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Miscellaneous Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Next Schedule Date', 'Default', 'Next Schedule Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Next Schedule Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Number Techs', 'Default', 'Number Techs', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Number Techs'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Open Wos Tab', 'Default', 'Open WOs', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Open Wos Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Print Dedicated Parts', 'Default', 'Print Dedicated Parts', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Print Dedicated Parts'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Schedule Type', 'Default', 'Schedule Type', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Schedule Type'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Shift', 'Default', 'Shift', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Shift'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Skip Dates Tab', 'Default', 'Skip Dates', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Skip Dates Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Skip Set 1', 'Default', 'Skip Set 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Skip Set 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Skip Set 2', 'Default', 'Skip Set 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Skip Set 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Skip Set 3', 'Default', 'Skip Set 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Skip Set 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Skip Set 4', 'Default', 'Skip Set 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Skip Set 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Skip Set 5', 'Default', 'Skip Set 5', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Skip Set 5'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Skip Set 6', 'Default', 'Skip Set 6', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Skip Set 6'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Calendar PM', 'Time Interval', 'Default', 'Time Interval', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Calendar PM'

        And LabelCaptions.FieldName = 'Time Interval'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ChargeDepartment', 'BudgetAmount', 'Default', 'Budget Amount', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ChargeDepartment'

        And LabelCaptions.FieldName = 'BudgetAmount'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ChargeDepartment', 'ChargeDept', 'Default', 'Charge Dept', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ChargeDepartment'

        And LabelCaptions.FieldName = 'ChargeDept'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ChargeDepartment', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ChargeDepartment'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ChargeDepartment', 'EndDate', 'Default', 'End Date', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ChargeDepartment'

        And LabelCaptions.FieldName = 'EndDate'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ChargeDepartment', 'StartDate', 'Default', 'Start Date', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ChargeDepartment'

        And LabelCaptions.FieldName = 'StartDate'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ClassCode', 'ClassCode', 'Default', 'Class Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ClassCode'

        And LabelCaptions.FieldName = 'ClassCode'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ClassCode', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ClassCode'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'CommodityCode', 'Code', 'Default', 'Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'CommodityCode'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'CommodityCode', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'CommodityCode'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Address1', 'Default', 'Address 1', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Address1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Address2', 'Default', 'Address 2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Address2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'City', 'Default', 'City', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'City'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Contact1Phone', 'Default', 'Contact 1 Phone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Contact1Phone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Contact2Phone', 'Default', 'Contact 2 Phone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Contact2Phone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Contractor', 'Default', 'Contractor', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Contractor'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'ContractorTypes', 'Default', 'Contractor Types', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'ContractorTypes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'EMailAddress', 'Default', 'EMail Address', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'EMailAddress'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'EmergencyPhone1', 'Default', 'Emergency Phone 1', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'EmergencyPhone1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'EmergencyPhone2', 'Default', 'Emergency Phone 2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'EmergencyPhone2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Fax', 'Default', 'Fax', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Fax'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'MobilePhone', 'Default', 'Mobile Phone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'MobilePhone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Name', 'Default', 'Name', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Name'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Notes', 'Default', 'Notes', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Phone', 'Default', 'Phone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Phone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'PrimaryContact', 'Default', 'Primary Contact', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'PrimaryContact'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'SecondaryContact', 'Default', 'Secondary Contact', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'SecondaryContact'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'ServicesProvided', 'Default', 'Services Provided', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'ServicesProvided'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'State', 'Default', 'State', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'State'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Contractor', 'Zip', 'Default', 'Zip', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Contractor'

        And LabelCaptions.FieldName = 'Zip'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ContractorTypes', 'Code', 'Default', 'Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ContractorTypes'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ContractorTypes', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ContractorTypes'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'DedicatedPartList', 'PartsListID', 'Default', 'Parts List ID', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'DedicatedPartList'

        And LabelCaptions.FieldName = 'PartsListID'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'DedicatedPartList', 'Quantity', 'Default', 'Quantity', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'DedicatedPartList'

        And LabelCaptions.FieldName = 'Quantity'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects1', 'Code', 'Default', 'Problem', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects1'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects1', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects1'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects2', 'Code', 'Default', 'Defect 2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects2'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects2', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects2'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects3', 'Code', 'Default', 'Defect 3', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects3'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects3', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects3'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects4', 'Code', 'Default', 'Defect 4', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects4'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects4', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects4'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects5', 'Code', 'Default', 'Cause', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects5'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects5', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects5'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects6', 'Code', 'Default', 'Action', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects6'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Defects6', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Defects6'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'EquipmentClasses', 'Class', 'Default', 'Asset Class', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'EquipmentClasses'

        And LabelCaptions.FieldName = 'Class'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'EquipmentClasses', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'EquipmentClasses'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'EquipmentPriority', 'PriorityCode', 'Default', 'Asset RIME', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'EquipmentPriority'

        And LabelCaptions.FieldName = 'PriorityCode'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'EquipmentStatus', 'Status', 'Default', 'Status', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'EquipmentStatus'

        And LabelCaptions.FieldName = 'Status'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'EquipmentZones', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'EquipmentZones'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'EquipmentZones', 'Zone', 'Default', 'Zone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'EquipmentZones'

        And LabelCaptions.FieldName = 'Zone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'FacilityID', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'FacilityID'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'FacilityID', 'FacilityID', 'Default', 'Facility ID', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'FacilityID'

        And LabelCaptions.FieldName = 'FacilityID'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'FOB', 'Code', 'Default', 'Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'FOB'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'FOB', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'FOB'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'ABC Class', 'Default', 'ABC Class', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'ABC Class'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Add To Dedicated Parts', 'Default', 'Add To Dedicated Parts', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Add To Dedicated Parts'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Attachments Tab', 'Default', 'Attachments', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Attachments Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'CommodityCode', 'Default', 'Commodity Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'CommodityCode'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Conversion', 'Default', 'Conversion', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Conversion'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Create Date', 'Default', 'Create Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Create Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Cross 1', 'Default', 'Cross 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Cross 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Cross 2', 'Default', 'Cross 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Cross 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Cross 3', 'Default', 'Cross 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Cross 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 1', 'Default', 'Custom 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 10', 'Default', 'Custom 10', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 10'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 11', 'Default', 'Custom 11', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 11'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 12', 'Default', 'Custom 12', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 12'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 13', 'Default', 'Custom 13', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 13'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 14', 'Default', 'Custom 14', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 14'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 15', 'Default', 'Custom 15', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 15'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 16', 'Default', 'Custom 16', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 16'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 2', 'Default', 'Custom 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 3', 'Default', 'Custom 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 4', 'Default', 'Custom 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 5', 'Default', 'Custom 5', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 5'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 6', 'Default', 'Custom 6', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 6'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 7', 'Default', 'Custom 7', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 7'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 8', 'Default', 'Custom 8', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 8'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom 9', 'Default', 'Custom 9', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom 9'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Custom Fields Tab', 'Default', 'Custom Fields', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Custom Fields Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Description', 'Default', 'Description', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'In Account', 'Default', 'In Account', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'In Account'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Inventory Type', 'Default', 'Inventory Type', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Inventory Type'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Lead Time', 'Default', 'Lead Time', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Lead Time'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Location Tab', 'Default', 'Location', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Location Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Lot Size', 'Default', 'Lot Size', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Lot Size'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Main Tab', 'Default', 'Main', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Main Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Max Level', 'Default', 'Max Level', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Max Level'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Mfg Part Number', 'Default', 'Mfg Part Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Mfg Part Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Min Level', 'Default', 'Min Level', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Min Level'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Notes', 'Default', 'Notes', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Notes Tab', 'Default', 'Notes', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Notes Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'On Order', 'Default', 'On Order', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'On Order'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'On Order Tab', 'Default', 'On Order', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'On Order Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Order Cost', 'Default', 'Order Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Order Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Order Measure', 'Default', 'Order Measure', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Order Measure'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Out Account', 'Default', 'Out Account', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Out Account'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Part Number', 'Default', 'Part Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Part Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Part Type', 'Default', 'Part Type', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Part Type'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'PO Notes', 'Default', 'PO Notes', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'PO Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Purchasing Tab', 'Default', 'Purchasing', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Purchasing Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Received Tab', 'Default', 'Received', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Received Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Reserve Tab', 'Default', 'Reserve', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Reserve Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Soft Reserve', 'Default', 'Soft Reserve', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Soft Reserve'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Stock Cost', 'Default', 'Stock Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Stock Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Supplier', 'Default', 'Supplier', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Supplier'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Taxable', 'Default', 'Taxable', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Taxable'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Total Available', 'Default', 'Total Available', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Total Available'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Total On Hand', 'Default', 'Total On Hand', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Total On Hand'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Inventory', 'Used Tab', 'Default', 'Used', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Inventory'

        And LabelCaptions.FieldName = 'Used Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'JobPriority', 'Code', 'Default', 'Job Priority', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'JobPriority'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'JobPriority', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'JobPriority'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'JobType', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'JobType'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'JobType', 'JobType', 'Default', 'Job Type', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'JobType'

        And LabelCaptions.FieldName = 'JobType'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'JobType', 'RimeValue', 'Default', 'Rime Value', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'JobType'

        And LabelCaptions.FieldName = 'RimeValue'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'LaborGroup', 'Code', 'Default', 'Labor Group', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'LaborGroup'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'LaborGroup', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'LaborGroup'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'LaborGroup', 'Notes', 'Default', 'Notes', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'LaborGroup'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'Address1', 'Default', 'Address 1', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'Address1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'Address2', 'Default', 'Address 2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'Address2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'City', 'Default', 'City', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'City'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'Fax', 'Default', 'Fax', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'Fax'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'LocationID', 'Default', 'Location', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'LocationID'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'Notes', 'Default', 'Notes', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'PrimaryContact', 'Default', 'Primary Contact', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'PrimaryContact'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'PrimaryExt', 'Default', 'Primary Ext', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'PrimaryExt'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'PrimaryTelephone', 'Default', 'Primary Telephone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'PrimaryTelephone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'SecondaryExt', 'Default', 'Secondary Ext', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'SecondaryExt'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'SecondaryTelephone', 'Default', 'Secondary Telephone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'SecondaryTelephone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'State', 'Default', 'State', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'State'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Location', 'Zip', 'Default', 'Zip', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Location'

        And LabelCaptions.FieldName = 'Zip'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'MaintRecordTypes', 'Code', 'Default', 'Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'MaintRecordTypes'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'MaintRecordTypes', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'MaintRecordTypes'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Attachments Tab', 'Default', 'Attachments', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Attachments Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Completion Days A', 'Default', 'Completion Days A', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Completion Days A'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Completion Days B', 'Default', 'Completion Days B', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Completion Days B'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Completion Days C', 'Default', 'Completion Days C', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Completion Days C'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Completion Days D', 'Default', 'Completion Days D', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Completion Days D'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Completion Days E', 'Default', 'Completion Days E', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Completion Days E'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Cycle Start Reading', 'Default', 'Cycle Start Reading', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Cycle Start Reading'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Early Release', 'Default', 'Early Release', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Early Release'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Estimated Labor Cost', 'Default', 'Estimated Labor Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Estimated Labor Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Hours A', 'Default', 'Hours A', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Hours A'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Hours B', 'Default', 'Hours B', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Hours B'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Hours C', 'Default', 'Hours C', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Hours C'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Hours D', 'Default', 'Hours D', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Hours D'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Hours E', 'Default', 'Hours E', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Hours E'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Last Completed Date', 'Default', 'Last Completed Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Last Completed Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Last Completed Meter', 'Default', 'Last Completed Meter', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Last Completed Meter'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Last Release Date', 'Default', 'Last Release Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Last Release Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Levels Tab', 'Default', 'Levels', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Levels Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Main Tab', 'Default', 'Main', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Main Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Max Days', 'Default', 'Max Days', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Max Days'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Meter Interval', 'Default', 'Meter Interval', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Meter Interval'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Meter Name', 'Default', 'Meter Name', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Meter Name'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Miscellaneous Tab', 'Default', 'Miscellaneous', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Miscellaneous Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Multiple B', 'Default', 'Multiple B', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Multiple B'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Multiple C', 'Default', 'Multiple C', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Multiple C'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Multiple D', 'Default', 'Multiple D', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Multiple D'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Multiple E', 'Default', 'Multiple E', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Multiple E'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Number Tech A', 'Default', 'Number Tech A', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Number Tech A'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Number Tech B', 'Default', 'Number Tech B', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Number Tech B'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Number Tech C', 'Default', 'Number Tech C', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Number Tech C'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Number Tech D', 'Default', 'Number Tech D', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Number Tech D'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Number Tech E', 'Default', 'Number Tech E', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Number Tech E'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Open Wos Tab', 'Default', 'Open WOs', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Open Wos Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Print Dedicated Parts', 'Default', 'Print Dedicated Parts', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Print Dedicated Parts'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Priority A', 'Default', 'Priority A', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Priority A'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Priority B', 'Default', 'Priority B', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Priority B'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Priority C', 'Default', 'Priority C', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Priority C'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Priority D', 'Default', 'Priority D', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Priority D'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Priority E', 'Default', 'Priority E', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Priority E'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Schedule Number', 'Default', 'Schedule Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Schedule Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Shift A', 'Default', 'Shift A', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Shift A'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Shift B', 'Default', 'Shift B', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Shift B'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Shift C', 'Default', 'Shift C', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Shift C'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Shift D', 'Default', 'Shift D', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Shift D'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Shift E', 'Default', 'Shift E', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Shift E'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Task Code A', 'Default', 'Task Code A', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Task Code A'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Task Code B', 'Default', 'Task Code B', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Task Code B'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Task Code C', 'Default', 'Task Code C', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Task Code C'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Task Code D', 'Default', 'Task Code D', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Task Code D'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Task Code E', 'Default', 'Task Code E', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Task Code E'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Util Since Last', 'Default', 'Util Since Last', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Util Since Last'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'View Tab', 'Default', 'View', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'View Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'Warranty Cycle End', 'Default', 'Warranty Cycle End', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'Warranty Cycle End'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Meter PM', 'WO Status', 'Default', 'WO Status', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Meter PM'

        And LabelCaptions.FieldName = 'WO Status'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'MfgCode', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'MfgCode'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'MfgCode', 'MfgCode', 'Default', 'Manufacturer', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'MfgCode'

        And LabelCaptions.FieldName = 'MfgCode'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Models', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Models'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Models', 'Model', 'Default', 'Product', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Models'

        And LabelCaptions.FieldName = 'Model'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'OrderMeasures', 'OrderDescription', 'Default', 'Order Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'OrderMeasures'

        And LabelCaptions.FieldName = 'OrderDescription'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'OrderMeasures', 'OrderMeasure', 'Default', 'Order Measure', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'OrderMeasures'

        And LabelCaptions.FieldName = 'OrderMeasure'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'PartPriority', 'Code', 'Default', 'Priority', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'PartPriority'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'PartPriority', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'PartPriority'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ProjectCategory', 'Category', 'Default', 'Category', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ProjectCategory'

        And LabelCaptions.FieldName = 'Category'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ProjectCategory', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ProjectCategory'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ProjectPhase', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ProjectPhase'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ProjectPhase', 'Phase', 'Default', 'Phase', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ProjectPhase'

        And LabelCaptions.FieldName = 'Phase'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Projects', 'Account', 'Default', 'Account', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Projects'

        And LabelCaptions.FieldName = 'Account'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Projects', 'BudgetAmount', 'Default', 'Budget Amount', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Projects'

        And LabelCaptions.FieldName = 'BudgetAmount'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Projects', 'FinishDate', 'Default', 'Finish Date', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Projects'

        And LabelCaptions.FieldName = 'FinishDate'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Projects', 'Notes', 'Default', 'Notes', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Projects'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Projects', 'Project', 'Default', 'Project', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Projects'

        And LabelCaptions.FieldName = 'Project'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Projects', 'StartDate', 'Default', 'Start Date', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Projects'

        And LabelCaptions.FieldName = 'StartDate'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Projects', 'Status', 'Default', 'Status', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Projects'

        And LabelCaptions.FieldName = 'Status'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Projects', 'Title', 'Default', 'Title', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Projects'

        And LabelCaptions.FieldName = 'Title'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Projects', 'Type', 'Default', 'Type', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Projects'

        And LabelCaptions.FieldName = 'Type'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ProjectType', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ProjectType'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ProjectType', 'Type', 'Default', 'Project Type', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ProjectType'

        And LabelCaptions.FieldName = 'Type'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Purchase Order', 'Custom Fields Tab', 'Default', 'Custom Fields', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Purchase Order'

        And LabelCaptions.FieldName = 'Custom Fields Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Purchase Order', 'Line Items Tab', 'Default', 'Line Items', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Purchase Order'

        And LabelCaptions.FieldName = 'Line Items Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Purchase Order', 'Main Tab', 'Default', 'Main', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Purchase Order'

        And LabelCaptions.FieldName = 'Main Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Purchase Order', 'Notes Tab', 'Default', 'Notes', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Purchase Order'

        And LabelCaptions.FieldName = 'Notes Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'RCMGroup', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'RCMGroup'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'RCMGroup', 'RCMGroupCode', 'Default', 'RCM Group', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'RCMGroup'

        And LabelCaptions.FieldName = 'RCMGroupCode'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ReasonCode', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ReasonCode'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ReasonCode', 'ReasonCode', 'Default', 'ReasonCode', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ReasonCode'

        And LabelCaptions.FieldName = 'ReasonCode'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'RecordType', 'Code', 'Default', 'Record Type', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'RecordType'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Request Manager', 'Description', 'Default', 'Description of Problem', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Request Manager'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Request Manager', 'Main Tab', 'Default', 'Main', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Request Manager'

        And LabelCaptions.FieldName = 'Main Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'Address1', 'Default', 'Address 1', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'Address1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'Address2', 'Default', 'Address 2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'Address2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'City', 'Default', 'City', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'City'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'Department', 'Default', 'Department', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'Department'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'Email', 'Default', 'Email', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'Email'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'Fax', 'Default', 'Fax', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'Fax'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'LocationDescription', 'Default', 'Location Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'LocationDescription'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'LocationID', 'Default', 'Location ID', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'LocationID'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'Notes', 'Default', 'Notes', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'Password', 'Default', 'Password', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'Password'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'RequestorID', 'Default', 'Requestor', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'RequestorID'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'RequestorName', 'Default', 'Requestor Name', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'RequestorName'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'State', 'Default', 'State', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'State'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'Telephone', 'Default', 'Telephone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'Telephone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'TelephoneExt', 'Default', 'Telephone Ext', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'TelephoneExt'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requestor', 'Zip', 'Default', 'Zip', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requestor'

        And LabelCaptions.FieldName = 'Zip'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Acknowledge', 'Default', 'Acknowledge', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Acknowledge'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Buyer', 'Default', 'Buyer', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Buyer'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Confirming', 'Default', 'Confirming', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Confirming'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 1', 'Default', 'Custom 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 10', 'Default', 'Custom 10', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 10'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 11', 'Default', 'Custom 11', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 11'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 12', 'Default', 'Custom 12', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 12'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 13', 'Default', 'Custom 13', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 13'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 14', 'Default', 'Custom 14', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 14'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 15', 'Default', 'Custom 15', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 15'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 16', 'Default', 'Custom 16', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 16'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 2', 'Default', 'Custom 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 3', 'Default', 'Custom 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 4', 'Default', 'Custom 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 5', 'Default', 'Custom 5', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 5'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 6', 'Default', 'Custom 6', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 6'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 7', 'Default', 'Custom 7', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 7'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 8', 'Default', 'Custom 8', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 8'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom 9', 'Default', 'Custom 9', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom 9'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Custom Fields Tab', 'Default', 'Custom Fields', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Custom Fields Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'FOB', 'Default', 'FOB', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'FOB'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Line Items Tab', 'Default', 'Line Items', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Line Items Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Main Tab', 'Default', 'Main', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Main Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Notes', 'Default', 'Notes', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Notes Tab', 'Default', 'Notes', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Notes Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Payment Terms', 'Default', 'Payment Terms', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Payment Terms'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Ship City State', 'Default', 'City, State, Zip', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Ship City State'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Ship To Address 1', 'Default', 'Address Line 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Ship To Address 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Ship To Address 2', 'Default', 'Address Line 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Ship To Address 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Ship To Name', 'Default', 'Name', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Ship To Name'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Ship Via', 'Default', 'Ship Via', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Ship Via'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Supplier Address 1', 'Default', '', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Supplier Address 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Supplier Address 2', 'Default', '', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Supplier Address 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Supplier City State', 'Default', '', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Supplier City State'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Supplier Name', 'Default', 'Name', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Supplier Name'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Requisition', 'Total Cost', 'Default', 'Total Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Requisition'

        And LabelCaptions.FieldName = 'Total Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ShipVia', 'Code', 'Default', 'Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ShipVia'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'ShipVia', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'ShipVia'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'SkipDates', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'SkipDates'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'SkipDates', 'FromDate', 'Default', 'From Date', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'SkipDates'

        And LabelCaptions.FieldName = 'FromDate'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'SkipDates', 'SetName', 'Default', 'Set #2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'SkipDates'

        And LabelCaptions.FieldName = 'SetName'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'SkipDates', 'ToDate', 'Default', 'To Date', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'SkipDates'

        And LabelCaptions.FieldName = 'ToDate'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'StatusType', 'Status', 'Default', 'Status', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'StatusType'

        And LabelCaptions.FieldName = 'Status'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'StoreRoom', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'StoreRoom'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'StoreRoom', 'StoreRoom', 'Default', 'Store Room', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'StoreRoom'

        And LabelCaptions.FieldName = 'StoreRoom'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Address1', 'Default', 'Address 1', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Address1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Address2', 'Default', 'Address 2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Address2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'AfterHours', 'Default', 'After Hours', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'AfterHours'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'City', 'Default', 'City', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'City'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom1', 'Default', 'Custom 1', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom10', 'Default', 'Custom 10', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom10'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom11', 'Default', 'Custom 11', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom11'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom12', 'Default', 'Custom 12', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom12'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom13', 'Default', 'Custom 13', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom13'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom14', 'Default', 'Custom 14', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom14'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom15', 'Default', 'Custom 15', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom15'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom16', 'Default', 'Custom 16', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom16'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom2', 'Default', 'Custom 2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom3', 'Default', 'Custom 3', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom4', 'Default', 'Custom 4', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom5', 'Default', 'Custom 5', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom5'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom6', 'Default', 'Custom 6', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom6'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom7', 'Default', 'Custom 7', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom7'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom8', 'Default', 'Custom 8', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom8'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Custom9', 'Default', 'Custom 9', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Custom9'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Delivery', 'Default', 'Delivery', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Delivery'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'EMailAddress', 'Default', 'EMail Address', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'EMailAddress'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'FreightTerms', 'Default', 'Freight Terms', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'FreightTerms'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'InsidePhone', 'Default', 'Inside Phone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'InsidePhone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'InsideSales', 'Default', 'Inside Sales', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'InsideSales'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'InsideTech1', 'Default', 'Inside Tech 1', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'InsideTech1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'InsideTech1Phone', 'Default', 'Inside Tech 1Phone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'InsideTech1Phone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'InsideTech2', 'Default', 'Inside Tech 2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'InsideTech2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'InsideTech2Phone', 'Default', 'Inside Tech 2Phone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'InsideTech2Phone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Name', 'Default', 'Name', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Name'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Notes', 'Default', 'Notes', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'OnSite', 'Default', 'On Site', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'OnSite'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'OutsidePhone', 'Default', 'Outside Phone', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'OutsidePhone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'OutsideSales', 'Default', 'Outside Sales', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'OutsideSales'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'PaymentTerms', 'Default', 'Payment Terms', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'PaymentTerms'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Phone1', 'Default', 'Phone 1', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Phone1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Phone2', 'Default', 'Phone 2', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Phone2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Phone3', 'Default', 'Phone 3', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Phone3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'State', 'Default', 'State', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'State'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Supplier', 'Default', 'Supplier', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Supplier'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'SupplierTypes', 'Default', 'Supplier Types', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'SupplierTypes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'TaxRate', 'Default', 'Tax Rate', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'TaxRate'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Supplier', 'Zip', 'Default', 'Zip', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Supplier'

        And LabelCaptions.FieldName = 'Zip'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'SupplierTypes', 'Code', 'Default', 'Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'SupplierTypes'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'SupplierTypes', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'SupplierTypes'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'System', 'Planning Button', 'Default', 'Planning', 'System'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'System'

        And LabelCaptions.FieldName = 'Planning Button'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'System', 'Spell Check Button', 'Default', 'Spell Check', 'System'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'System'

        And LabelCaptions.FieldName = 'Spell Check Button'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TaskInstructions', 'Class', 'Default', 'Class', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TaskInstructions'

        And LabelCaptions.FieldName = 'Class'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TaskInstructions', 'Image', 'Default', 'Image', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TaskInstructions'

        And LabelCaptions.FieldName = 'Image'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TaskInstructions', 'Notes', 'Default', 'Notes', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TaskInstructions'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TaskInstructions', 'PrintImage', 'Default', 'Print Image', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TaskInstructions'

        And LabelCaptions.FieldName = 'PrintImage'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TaskInstructions', 'TaskCode', 'Default', 'Task Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TaskInstructions'

        And LabelCaptions.FieldName = 'TaskCode'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TaskInstructions', 'Title', 'Default', 'Title', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TaskInstructions'

        And LabelCaptions.FieldName = 'Title'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Address 1', 'Default', 'Address 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Address 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Address 2', 'Default', 'Address 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Address 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Attachments Tab', 'Default', 'Attachments', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Attachments Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'City', 'Default', 'City', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'City'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 1', 'Default', 'Custom 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 10', 'Default', 'Custom 10', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 10'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 11', 'Default', 'Custom 11', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 11'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 12', 'Default', 'Custom 12', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 12'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 13', 'Default', 'Custom 13', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 13'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 14', 'Default', 'Custom 14', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 14'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 15', 'Default', 'Custom 15', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 15'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 16', 'Default', 'Custom 16', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 16'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 2', 'Default', 'Custom 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 3', 'Default', 'Custom 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 4', 'Default', 'Custom 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 5', 'Default', 'Custom 5', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 5'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 6', 'Default', 'Custom 6', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 6'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 7', 'Default', 'Custom 7', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 7'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 8', 'Default', 'Custom 8', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 8'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom 9', 'Default', 'Custom 9', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom 9'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Custom Fields Tab', 'Default', 'Custom Fields', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Custom Fields Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Dept Date', 'Default', 'Dept Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Dept Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Email', 'Default', 'Email', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Email'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Emergency Name', 'Default', 'Emergency Name', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Emergency Name'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Emergency Phone', 'Default', 'Emergency Phone', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Emergency Phone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Hire Date', 'Default', 'Hire Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Hire Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'History Tab', 'Default', 'History', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'History Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Main Tab', 'Default', 'Main', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Main Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Name', 'Default', 'Name', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Name'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Notes', 'Default', 'Notes', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Notes'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Pager Number', 'Default', 'Pager Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Pager Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Personal Tab', 'Default', 'Personal', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Personal Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Phone', 'Default', 'Phone', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Phone'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Shift', 'Default', 'Shift', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Shift'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'SSN', 'Default', 'SSN', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'SSN'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'State', 'Default', 'State', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'State'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Technician', 'Default', 'Technician', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Technician'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Technician', 'Zip', 'Default', 'Zip', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Technician'

        And LabelCaptions.FieldName = 'Zip'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TechnicianTraining', 'Code', 'Default', 'Code', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TechnicianTraining'

        And LabelCaptions.FieldName = 'Code'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TechnicianTraining', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TechnicianTraining'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TechType', 'Description', 'Default', 'Description', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TechType'

        And LabelCaptions.FieldName = 'Description'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'TechType', 'TechType', 'Default', 'Tech Type', 'PopUp'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'TechType'

        And LabelCaptions.FieldName = 'TechType'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Actual Hours', 'Default', 'Actual Hours', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Actual Hours'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Actual Labor Tab', 'Default', 'Actual Labor', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Actual Labor Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Actual Parts Tab', 'Default', 'Actual Parts', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Actual Parts Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Asset Under Warranty', 'Default', 'Asset Under Warranty', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Asset Under Warranty'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Attachments Tab', 'Default', 'Attachments', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Attachments Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Auto Save Labor', 'Default', 'Auto Save Labor', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Auto Save Labor'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 1', 'Default', 'Condition 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 10', 'Default', 'Condition 10', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 10'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 11', 'Default', 'Condition 11', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 11'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 12', 'Default', 'Condition 12', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 12'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 13', 'Default', 'Condition 13', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 13'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 14', 'Default', 'Condition 14', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 14'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 15', 'Default', 'Condition 15', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 15'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 16', 'Default', 'Condition 16', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 16'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 2', 'Default', 'Condition 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 3', 'Default', 'Condition 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 4', 'Default', 'Condition 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 5', 'Default', 'Condition 5', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 5'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 6', 'Default', 'Condition 6', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 6'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 7', 'Default', 'Condition 7', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 7'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 8', 'Default', 'Condition 8', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 8'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Condition 9', 'Default', 'Condition 9', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Condition 9'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Conditions Tab', 'Default', 'Conditions', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Conditions Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Contractor Labor Cost', 'Default', 'Contractor Labor Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Contractor Labor Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Contractor Material Cost', 'Default', 'Contractor Material Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Contractor Material Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Contractor Total Cost', 'Default', 'Contractor Total Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Contractor Total Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Created By', 'Default', 'Created By', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Created By'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 1', 'Default', 'Custom 1', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 1'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 10', 'Default', 'Custom 10', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 10'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 11', 'Default', 'Custom 11', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 11'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 12', 'Default', 'Custom 12', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 12'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 13', 'Default', 'Custom 13', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 13'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 14', 'Default', 'Custom 14', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 14'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 15', 'Default', 'Custom 15', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 15'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 16', 'Default', 'Custom 16', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 16'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 2', 'Default', 'Custom 2', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 2'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 3', 'Default', 'Custom 3', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 3'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 4', 'Default', 'Custom 4', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 4'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 5', 'Default', 'Custom 5', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 5'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 6', 'Default', 'Custom 6', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 6'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 7', 'Default', 'Custom 7', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 7'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 8', 'Default', 'Custom 8', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 8'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom 9', 'Default', 'Custom 9', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom 9'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Custom Fields Tab', 'Default', 'Custom Fields', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Custom Fields Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Details', 'Default', 'Details', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Details'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Details Tab', 'Default', 'Details', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Details Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Downtime Start', 'Default', 'Downtime Start', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Downtime Start'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Downtime Stop', 'Default', 'Downtime Stop', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Downtime Stop'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Est Non Production Hours', 'Default', 'Est. Non-Production Hrs.', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Est Non Production Hours'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Est Production Hours', 'Default', 'Est. Production Hrs.', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Est Production Hours'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Estimated Finish Date', 'Default', 'Est. Finish Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Estimated Finish Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Estimated Issue Date', 'Default', 'Est. Issue Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Estimated Issue Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Estimated Labor Cost', 'Default', 'Est. Labor Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Estimated Labor Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Estimated Parts Cost', 'Default', 'Est. Parts Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Estimated Parts Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Estimated Total Cost', 'Default', 'Est. Total Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Estimated Total Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Estimated Total Hours', 'Default', 'Est. Total Hours', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Estimated Total Hours'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Financial Tab', 'Default', 'Financial', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Financial Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Follow Up Needed', 'Default', 'Follow Up Needed', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Follow Up Needed'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Follow Up WO', 'Default', 'Follow Up WO', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Follow Up WO'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Hours Remaining', 'Default', 'Hours Remaining', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Hours Remaining'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Inside Labor Cost', 'Default', 'Inside Labor Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Inside Labor Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Inside Parts Cost', 'Default', 'Inside Parts Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Inside Parts Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Instructions', 'Default', 'Instructions', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Instructions'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Job Costing Tab', 'Default', 'Job Costing', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Job Costing Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Job Finish Date', 'Default', 'Job Start Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Job Finish Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Job Start Date', 'Default', 'Job Finish Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Job Start Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Line Downtime', 'Default', 'Line Downtime', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Line Downtime'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Line Number', 'Default', 'Line Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Line Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'LTD WO Cost', 'Default', 'LTD WO Cost', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'LTD WO Cost'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Machine Downtime', 'Default', 'Machine Downtime', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Machine Downtime'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Main Tab', 'Default', 'Main', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Main Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Occurences', 'Default', 'Occurences', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Occurences'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Originating WO', 'Default', 'Originating WO', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Originating WO'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'PDA Work Order', 'Default', 'PDA Work Order', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'PDA Work Order'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Print Dedicated Part', 'Default', 'Print Dedicated Part', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Print Dedicated Part'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'RIME Priority', 'Default', 'RIME Priority', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'RIME Priority'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Schedule Number', 'Default', 'Schedule #', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Schedule Number'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Shift', 'Default', 'Shift', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Shift'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Status Date', 'Default', 'Status Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Status Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'UpdateJobFinish', 'Default', 'Update Job Finish', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'UpdateJobFinish'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'WO Create Date', 'Default', 'WO Creation Date', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'WO Create Date'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Work Close Tab', 'Default', 'Work Close', 'Module Tab'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Work Close Tab'

        And LabelCaptions.LanguageCode = 'Default');
 

INSERT INTO LabelCaptions

    (FacilityID, TableName, FieldName, LanguageCode, Caption, CaptionType) 

    Select FacilityID, 'Work Order', 'Work Order Number', 'Default', 'WO Number', 'Module'

       From FacilityID Where Not Exists

       (Select * From LabelCaptions Where LabelCaptions.FacilityID = FacilityID.FacilityID

        And LabelCaptions.TableName = 'Work Order'

        And LabelCaptions.FieldName = 'Work Order Number'

        And LabelCaptions.LanguageCode = 'Default');

Open in new window

0
Comment
Question by:phattuna
1 Comment
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
Comment Utility
as far as I could see: no.

just run a DROP TABLE xxxx  statement for each of the CREATE TABLE xxxx statments in your script against the master db, and those tables are gone again.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Read about achieving the basic levels of HRIS security in the workplace.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now