Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 16 Next »

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.

To enable a trigger in Microsoft SQL Server Management Studio:

  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. Note that the Entity name does not display in the query results.

Entity

Table Name

Trigger Name

Disabled

Job

JC00102


JC00102_D_CDC

0

JC00102_IU_CDC

0

Job Cost Code

JC00701


JC00701_D_CDC

0

JC00701_IU_CDC

0

GP Customer

RM00101


RM00101_D_CDC

0

RM00101_IU_CDC

0

Technician

SV00115


SV00115_D_CDC

0

SV00115_IU_CDC

0

Service Option

sv00196


sv00196_D_CDC

0

sv00196_IU_CDC

0

Location

SV00200


SV00200_D_CDC

0

SV00200_IU_CDC

0

Service Call

SV00300



SV00300_D_CDC

0

SV00300_I_CDC

0

SV00300_U_CDC

0

Appointment

SV00301



SV00301_D_CDC

0

SV00301_I_CDC

0

SV00301_U_CDC

0

Equipment

SV00400


SV00400_D_CDC

0

SV00400_IU_CDC

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.  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

These are the query results at the Company database level from the disabled triggers script, assuming the default nine triggers have been enabled.  Note that the Entity name does not display in the query results.

Entity

Table Name

Trigger Name

Disabled

GP GL Account

GL00100

GL00100_D_CDC

1

GL00100_IU_CDC

1

Job User Defined

JC00107

JC00107_D_CDC

1

JC00107_IU_CDC

1

Estimate Revision

JC00201

JC00201_D_CDC

1

JC00201_IU_CDC

1

Forecast Revision

JC00401

JC00401_D_CDC

1

JC00401_IU_CDC

1

Job Cost Note

JC00501

JC00501_D_CDC

1

JC00501_IU_CDC

1

Job Bill Code

JC00601

JC00601_D_CDC

1

JC00601_IU_CDC

1

Job Revenue Code

JC00610

JC00610_D_CDC

1

JC00610_IU_CDC

1

Employee Union Code Master

JC00801

JC00801_D_CDC

1

JC00801_IU_CDC

1

Change Order

JC01001


JC01001_D_CDC

1

JC01001_IU_CDC

1

Change Order Cost Code

JC01002

JC01002_D_CDC

1

JC01002_IU_CDC

1

Job Change Order Revenue Code

JC01004

JC01004_D_CDC

1

JC01004_IU_CDC

1

Job Vendor

JC01501

JC01501_D_CDC

1

JC01501_IU_CDC

1

Job Vendor Date

JC01504

JC01504_D_CDC

1

JC01504_IU_CDC

1

Job Project

JC01701

JC01701_D_CDC

1

JC01701_IU_CDC

1

Rate Class

JC01801

JC01801_D_CDC

1

JC01801_IU_CDC

1

Job Lien Waiver

JC20705

JC20705_D_CDC

1

JC20705_IU_CDC

1

Fed Class

JC40106

JC40106_D_CDC

1

JC40106_IU_CDC

1

Union Code

JC40201

JC40201_D_CDC

1

JC40201_IU_CDC

1

Cost Element

JC40209

JC40209_IU_CDC

1

Resource Extension

K2A_ResourceExtension

K2A_ResourceExtension_D_CDC

1

K2A_ResourceExtension_IU_CDC

1

GP Purchase Order

POP10100

POP10100_D_CDC

1

POP10100_IU_CDC

1

GP Purchase Order Detail

POP10110

POP10110_D_CDC

1

POP10110_IU_CDC

1

GP Address

RM00102

RM00102_D_CDC

1

RM00102_IU_CDC

1

GP Salesperson

RM00301

RM00301_D_CDC

1

RM00301_IU_CDC

1

Installation By

SV_00415

SV_00415_D_CDC

1

SV_00415_IU_CDC

1

Time Zone

SV00045

SV00045_D_CDC

1

SV00045_IU_CDC

1

Division

SV00077

SV00077_D_CDC

1

SV00077_IU_CDC

1

Note

SV000805

SV000805_D_CDC

1

SV000805_IU_CDC

1

Customer

SV00100

SV00100_D_CDC

1

SV00100_IU_CDC

1

Technician Vehicle

SV00113

SV00113_D_CDC

1

SV00113_IU_CDC

1

Technician Branch

SV00114

SV00114_D_CDC

1

SV00114_IU_CDC

1

Technician Skill Set

SV00155

SV00155_D_CDC

1

SV00155_IU_CDC

1

Sublocation

SV00201

SV00201_D_CDC

1

SV00201_IU_CDC

1

Problem Type

SV00310

SV00310_D_CDC

1

SV00310_IU_CDC

1

Call Type

SV00320

SV00320_D_CDC

1

SV00320_IU_CDC

1

Appointment Status

SV00325

SV00325_D_CDC

1

SV00325_IU_CDC

1

Technician Activity

sv00326

sv00326_D_CDC

1

sv00326_IU_CDC

1

User Define 1

SV00330

SV00330_D_CDC

1

SV00330_IU_CDC

1

User Define 2

SV00331

SV00331_D_CDC

1

SV00331_IU_CDC

1

Contract Equipment

SV00403

SV00403_D_CDC

1

SV00403_IU_CDC

1

Equipment Type

SV00405

SV00405_D_CDC

1

SV00405_IU_CDC

1

Manufacturer

SV00410

SV00410_D_CDC

1

SV00410_IU_CDC

1

Model Number

SV00411

SV00411_D_CDC

1

SV00411_IU_CDC

1

Extended Warranty Type

SV00420

SV00420_D_CDC

1

SV00420_IU_CDC

1

Meter Reading

SV00430

sv00430_D_CDC

1

sv00430_IU_CDC

1

Contract

SV00500

SV00500_D_CDC

1

SV00500_IU_CDC

1

Task Code

SV00560

SV00560_D_CDC

1

SV00560_IU_CDC

1

Skill Level

SV00572

SV00572_D_CDC

1

SV00572_IU_CDC

1

Invoice History

SV00701

SV00701_D_CDC

1

SV00701_IU_CDC

1

Service Cost Code

SV00735

SV00735_IU_CDC

1

Building

SV01200

SV01200_D_CDC

1

SV01200_IU_CDC

1

Refrigerant Type

SV40180

SV40180_D_CDC

1

SV40180_IU_CDC

1

Refrigerant Code

SV40182

SV40182_D_CDC

1

SV40182_IU_CDC

1

Refrigerant Leak

SV40184

SV40184_D_CDC

1

SV40184_IU_CDC

1

GP Internet Address

SY01200

SY01200_D_CDC

1

SY01200_IU_CDC

1

GP Employee

UPR00100

UPR00100_D_CDC

1

UPR00100_IU_CDC

1

GP Employee Tax Info

UPR00300

UPR00300_D_CDC

1

UPR00300_IU_CDC

1

GP Employee Pay Code

UPR00400

UPR00400_D_CDC

1

UPR00400_IU_CDC

1

GP Employee State Tax

UPR00700

UPR00700_D_CDC

1

UPR00700_IU_CDC

1

GP Department

UPR40300

UPR40300_D_CDC

1

UPR40300_IU_CDC

1

GP Position

UPR40301


UPR40301_D_CDC

1

UPR40301_IU_CDC

1

GP Pay Code

UPR40600

UPR40600_D_CDC

1

UPR40600_IU_CDC

1

GP Workers Comp

UPR40700

UPR40700_D_CDC

1

UPR40700_IU_CDC

1

GP Payroll State

UPR41100

UPR41100_D_CDC

1

UPR41100_IU_CDC

1

Purchase Order Detail

WS10101

WS10101_D_CDC

1

WS10101_IU_CDC

1

TimeTrack Option

WS40000

WS40000_D_CDC

1

WS40000_IU_CDC

1

TimeTrack Registered User

WS41001


WS41001_D_CDC

1

WS41001_IU_CDC

1

Attachment

WSDOCS

WSDOCS_D_CDC

1

WSDOCS_IU_CDC

1

  • No labels