SQL Server Trigger to copy specific records from one table to another
Posted on 2016-08-10
In short, when the “Customer” column is update in TABLE1, I need to write a trigger to copy *most* (about12 columns) of that record information from TABLE1 into TABLE2. However, the columns names are not all an exact match.
The trigger need to fire only on data update, so when going from data to a NULL value, the trigger will NOT fire.
Also, when inserting that record into TABLE2, I also need to insert that customer e-mail address which is found in TABLE3.eMail where the relation is TABLE1.Customer=TABLE3.Customer
Thank you all! Please be so kind to refrain from lecturing about the data design since this is a simplified version of a much more complex design :-)