Listing table triggers

It's not uncommon for DynamicsGP users and partners to "tweak" GP by adding SQL triggers or custom stored procedures. As with any modification to the standard GP behavior, it can have unanticipated consequences, especially when there are integrations to other components present.

Here's a script that lists all the triggers present in the selected database. Note that GP comes with it's own triggers, so it can be tricky to determine what was added/modified versus what was part of the original installation. This script shows both the table's created date, and the trigger's created date in order to help sort out the mystery.

 

-- Get Triggers w/ Code
SELECT Tables.Name TableName, Tables.crdate TableCreatedDate, Triggers.crdate TriggerCreatedDate,
Triggers.name TriggerName, Triggers.[type],
Comments.Text TriggerText
FROM sysobjects Triggers
Inner Join sysobjects Tables On Triggers.parent_obj = Tables.id
Inner Join syscomments Comments On Triggers.id = Comments.id
WHERE Triggers.xtype = 'TR'
And Tables.xtype = 'U'
ORDER BY Tables.Name, Triggers.name

 

 

Have more questions? Submit a request

Comments