Hiya Geo,
One thing you could try is to write a quickie VFP tool to generate the triggers for you. Shouldn't take you more than an hour to do it. This way, you could just compare every field in your trigger, but you wouldn't have to code it all, the tool would do it for you.
~Bonnie
>This is really a multi-part question, so please bear with me. I’m posting this question on both the VFP and SQL Server forums in hopes of finding an answer.
>
>I’ve been given the assignment to write a series of update triggers for some SQL Server 7.0 tables. Each table has a “date last modified” field. What the assignment entails is not updating that field if the record currently in the table is exactly the same other than this field. The source of the problem is twofold. First, if a user makes a change to a field, then changes the data back to the original, the modification date should not be changed. I realize that this is largely a UI problem, but since the updates are coming from a non-VFP application and one I’m not involved with, there’s nothing I can do on that side to make the problem easier. Second, these tables are regularly updated from a series of DB2 tables, which reside on the mainframe. In this case, all records are being updated.
>
>So the first question is simply, is there an easier way, other than comparing all the other fields in the inserted table against the same fields in the same record in the deleted table? Further, is there any way to do it generically? IOW, without having to hard code the actual fields names into the trigger. If this simply involved one or two fields, it would be relatively easy.
>
>The second question is, assuming that there isn’t another way, can anyone give me any idea of the degree of severity this will impact performance? The tables are relatively small (1000-2000 records), with about an average of 20 fields to be compared.
>
>TIA,