Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel1

Enabling a Trigger in Microsoft SQL Server Management Studio

By enabling triggers that track changes are turned on or off for these tables. Most of these tables have a delete trigger with a name in the format of  ‘XXXX_D_CDC’ where XXXX is the table name and an insert/update trigger in the form of ‘XXXX_IU_CDC’. Two tables make an exception to this rule and have 3 triggers, one for Insert, one for update and one for delete. They are tables SV00300 and SV00301.

...

  1. Launch Microsoft SQL Server Management Studio.
  2. Expand Databases > your company database > Tables.
  3. Expand the appropriate table.
  4. Expand Triggers.
  5. Right-click on the XXXX_D_CDC trigger and select Enable. (This is the "delete" trigger.)
  6. Right-click on the XXXX_IU_CDC trigger and select Enable. (This is the "insert/update" trigger.)


Enabled Triggers Script

This script provides a list of all enabled scripts for a given company:

SELECT sysobjects.name AS trigger_name, OBJECT_NAME(parent_obj) AS table_name,

             OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') AS [disabled]

FROM sysobjects

WHERE sysobjects.type = 'TR' AND sysobjects.name LIKE '%_CDC'

       and OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') = 0

ORDER BY disabled,sysobjects.name ASC

Enabled Triggers Query Results

These are the results of the enabled triggers script query, assuming all nine triggers are enabled:

...

Trigger Name

...

. Note that the Entity name does not display in the query results.

000000
Entity

Table Name

Trigger Name

Disabled

Job

JC00102


JC00102_D_CDC

JC00102

0

JC00102_IU_CDC

JC00102

0

0

Job Cost Code

JC00701


JC00701_D_CDCJC00701

0

JC00701_IU_CDC

JC00701

0

0

GP Customer

RM00101


RM00101_D_CDCRM00101

0

RM00101_IU_CDC

0

RM00101
Technician

SV00115


SV00115_D_CDCSV00115

0

SV00115_IU_CDC

0

SV00115

Service Option

sv00196


sv00196_D_CDC

sv00196

0

sv00196_IU_CDC

0

sv00196

Location

SV00200


SV00200_D_CDCSV00200

0

SV00200_IU_CDC

0

SV00200
Service Call

SV00300



SV00300_D_CDC

SV00300

0

SV00300_I_CDC

SV00300

0

SV00300_U_CDC

0

SV00300
Appointment

SV00301



SV00301_D_CDCSV00301

0

SV00301_I_CDC

SV00301

0

SV00301_U_CDCSV00301

0

Equipment

SV00400


SV00400_D_CDC

SV00400

0

SV00400_IU_CDC

SV00400

0

Disabled Triggers Script

If you need to enable triggers for a table not found in this list, run the following script to find the triggers for a given table not in the list and then go through Microsoft SQL Server Management Studio and manually enable the trigger:

SELECT sysobjects.name AS trigger_name, OBJECT_NAME(parent_obj) AS table_name,

             OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') AS [disabled]

FROM sysobjects

WHERE sysobjects.type = 'TR' AND (sysobjects.name LIKE '%_D_CDC' or sysobjects.name LIKE '%_IU_CDC')

       and OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') = 1

ORDER BY disabled,sysobjects.name ASC

Disabled Triggers Query Results

GP Database Level

These are the query results at the GP database level from the disabled triggers script, assuming the default nine triggers have been enabled:

...

Trigger Name

...

Table Name

...

Disabled

...

.  Note that the Entity name does not display in the query results.

Entity

Table Name

Trigger Name

Disabled

Call SourceSVCALSRCSVCALLSRC_D_CDC1
SVCALLSRC_IU_CDC1
GP CompanySY01500SY01500_D_CDC1
SY01500_IU_CDC1

Company Database Level

111JC0040111JC0060111JC008011111JC015011JC01504111JC2070511JC40201111RM0010211SV000451111SV001131SV001141SV0015511SV003101SV0032011111SV0040511SV004111SV0042011SV00500111SV007011SV00735111SV4018211SY01200111UPR40301111UPR411001WS10101111
Entity

Table Name

Trigger Name

Disabled

GP GL Account

GL00100

GL00100_D_CDC

GL00100

1

GL00100_IU_CDC

GL00100

1

Job User Defined

JC00107

JC00107_D_CDCJC00107

1

JC00107_IU_CDC

JC00107

1

Estimate Revision

JC00201

JC00201_D_CDC

JC00201

1

JC00201_IU_CDC

JC00201

1

Forecast Revision

JC00401

JC00401_D_CDC

JC00401

1

JC00401_IU_CDC

1

Job Cost Note

JC00501

JC00501_D_CDC

JC00501

1

JC00501_IU_CDC

JC00501

1

Job Bill Code

JC00601

JC00601_D_CDCJC00601

1

JC00601_IU_CDC

1

Job Revenue Code

JC00610

JC00610_D_CDCJC00610

1

JC00610_IU_CDC

JC00610

1

Employee Union Code Master

JC00801

JC00801_D_CDCJC00801

1

JC00801_IU_CDC

1

Change Order

JC01001


JC01001_D_CDC

JC01001

1

JC01001_IU_CDC

JC01001

1

Change Order Cost Code

JC01002

JC01002_D_CDCJC01002

1

JC01002_IU_CDC

JC01002

1

Job Change Order Revenue Code

JC01004

JC01004_D_CDCJC01004

1

JC01004_IU_CDC

JC01004

1

Job Vendor

JC01501

JC01501_D_CDCJC01501

1

JC01501_IU_CDC

1

Job Vendor Date

JC01504

JC01504_D_CDCJC01504

1

JC01504_IU_CDC

1

Job Project

JC01701

JC01701_D_CDCJC01701

1

JC01701_IU_CDC

JC01701

1

Rate Class

JC01801

JC01801_D_CDC

JC01801

1

JC01801_IU_CDC

JC01801

1

Job Lien Waiver

JC20705

JC20705_D_CDCJC20705

1

JC20705_IU_CDC

1

Fed Class

JC40106

JC40106_D_CDC

JC40106

1

JC40106_IU_CDC

JC40106

1

Union Code

JC40201

JC40201_D_CDC

JC40201

1

JC40201_IU_CDC

1

Cost Element

JC40209

JC40209_IU_CDC

1

JC40209

Resource Extension

K2A_ResourceExtension

K2A_ResourceExtension_D_CDC

K2A_ResourceExtension

1

K2A_ResourceExtension_IU_CDC

K2A_ResourceExtension

1

1

GP Purchase Order

POP10100

POP10100_D_CDC

POP10100

1

POP10100_IU_CDC

POP10100

1

1

GP Purchase Order Detail

POP10110

POP10110_D_CDC

POP10110

1

POP10110_IU_CDC

POP10110

1

GP Address

RM00102

RM00102_D_CDC

RM00102

1

RM00102_IU_CDC

1

GP Salesperson

RM00301

RM00301_D_CDCRM00301

1

RM00301_IU_CDC

RM00301

1

Installation By

SV_00415

SV_00415_D_CDC

SV_00415

1

SV_00415_IU_CDC

SV_00415

1

1

Time Zone

SV00045

SV00045_D_CDC

SV00045

1

SV00045_IU_CDC

1

Division

SV00077

SV00077_D_CDCSV00077

1

SV00077_IU_CDCSV00077

1

Note

SV000805

SV000805_D_CDCSV000805

1

SV000805_IU_CDCSV000805

1

Customer

SV00100

SV00100_D_CDC

SV00100

1

SV00100_IU_CDC

SV00100

1

Technician Vehicle

SV00113

SV00113_D_CDCSV00113

1

SV00113_IU_CDC

1

Technician Branch

SV00114

SV00114_D_CDCSV00114

1

SV00114_IU_CDC

1

Technician Skill Set

SV00155

SV00155_D_CDC

SV00155

1

SV00155_IU_CDC

1

Sublocation

SV00201

SV00201_D_CDCSV00201

1

SV00201_IU_CDC

SV00201

1

Problem Type

SV00310

SV00310_D_CDCSV00310

1

SV00310_IU_CDC

1

Call Type

SV00320

SV00320_D_CDCSV00320

1

SV00320_IU_CDC

1

Appointment Status

SV00325

SV00325_D_CDCSV00325

1

SV00325_IU_CDC

SV00325

1

Technician Activity

sv00326

sv00326_D_CDCsv00326

1

sv00326_IU_CDCsv00326

1

User Define 1

SV00330

SV00330_D_CDC

SV00330

1

SV00330_IU_CDC

SV00330

1

User Define 2

SV00331

SV00331_D_CDCSV00331

1

SV00331_IU_CDC

SV00331

1

Contract Equipment

SV00403

SV00403_D_CDC

SV00403

1

SV00403_IU_CDC

SV00403

1

Equipment Type

SV00405

SV00405_D_CDC

SV00405

1

SV00405_IU_CDC

1

Manufacturer

SV00410

SV00410_D_CDCSV00410

1

SV00410_IU_CDC

SV00410

1

Model Number

SV00411

SV00411_D_CDCSV00411

1

SV00411_IU_CDC

1

Extended Warranty Type

SV00420

SV00420_D_CDCSV00420

1

SV00420_IU_CDC

1

Meter Reading

SV00430

sv00430_D_CDC

sv00430

1

sv00430_IU_CDCsv00430

1

Contract

SV00500

SV00500_D_CDCSV00500

1

SV00500_IU_CDC

1

Task Code

SV00560

SV00560_D_CDCSV00560

1

SV00560_IU_CDC

SV00560

1

Skill Level

SV00572

SV00572_D_CDC

SV00572

1

SV00572_IU_CDC

SV00572

1

Invoice History

SV00701

SV00701_D_CDC

SV00701

1

SV00701_IU_CDC

1

Service Cost Code

SV00735

SV00735_IU_CDC

1

Building

SV01200

SV01200_D_CDCSV01200

1

SV01200_IU_CDC

SV01200

1

Refrigerant Type

SV40180

SV40180_D_CDC

SV40180

1

SV40180_IU_CDC

SV40180

1

Refrigerant Code

SV40182

SV40182_D_CDC

SV40182

1

SV40182_IU_CDC

1

Refrigerant Leak

SV40184

SV40184_D_CDC

SV40184

1

SV40184_IU_CDC

SV40184

1

GP Internet Address

SY01200

SY01200_D_CDCSY01200

1

SY01200_IU_CDC

1

GP Employee

UPR00100

UPR00100_D_CDCUPR00100

1

UPR00100_IU_CDC

UPR00100

1

1

GP Employee Tax Info

UPR00300

UPR00300_D_CDC

UPR00300

1

UPR00300_IU_CDC

UPR00300

1

1

GP Employee Pay Code

UPR00400

UPR00400_D_CDCUPR00400

1

UPR00400_IU_CDC

UPR00400

1

1

GP Employee State Tax

UPR00700

UPR00700_D_CDCUPR00700

1

UPR00700_IU_CDC

UPR00700

1

GP Department

UPR40300

UPR40300_D_CDC

UPR40300

1

UPR40300_IU_CDC

UPR40300

1

GP Position

UPR40301


UPR40301_D_CDC

UPR40301

1

UPR40301_IU_CDC

1

GP Pay Code

UPR40600

UPR40600_D_CDC

UPR40600

1

UPR40600_IU_CDC

UPR40600

1

GP Workers Comp

UPR40700

UPR40700_D_CDCUPR40700

1

UPR40700_IU_CDC

UPR40700

1

GP Payroll State

UPR41100

UPR41100_D_CDCUPR41100

1

UPR41100_IU_CDC

1

Purchase Order Detail

WS10101

WS10101_D_CDCWS10101

1

WS10101_IU_CDC

1

TimeTrack Option

WS40000

WS40000_D_CDC

WS40000

1

WS40000_IU_CDC

WS40000

1

TimeTrack Registered User

WS41001


WS41001_D_CDCWS41001

1

WS41001_IU_CDCWS41001

1

Attachment

WSDOCS

WSDOCS_D_CDCWSDOCS

1

WSDOCS_IU_CDCWSDOCS

1