RachelW
4Penny.net
Points: 7353

5/18/2022 1:45:16 PM

Using EXCEPT in SQL triggers for Dynamics GP

* This article, and all our great SQL (General) documentation, Is available on the SQL (General) menu

Read this requirement carefully:

Write a trigger writes lines to an audit table ONLY WHEN THE RM00101 CUSTNMBR OR CUSTNAME CHANGES

If you've ever written a trigger on RM00101 (or any Dynamics GP table) you know that ALL fields are updated when you save in GP, even if the data is not changed. 

In the past, I've compared the field in the DELETED table to the field in the INSERTED table, but that gets wordy and is not... elegant. 

I have a solution

4Penny.net
Version: All
Section: SQL Scripts
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3