Link to home
Start Free TrialLog in
Avatar of jdana
jdanaFlag for United States of America

asked on

SQL Server Trigger - FOR INSERT, UPDATE - Is it possible to calculate a value and save that value to a row before an insert or update takes place?

I know it's possible to validate an inserted or updated row with a trigger.  Is it possible to use a trigger to modify an inserted or updated row before the row is saved to the database?

Hopefully, the graphic below clarifies what I'm looking for.  The user has entered values in Column A and Column B.  I want the trigger to use the values in A and B to generate the value in C before the row is saved.  Is it possible?
Trigger-Value.jpg
ASKER CERTIFIED SOLUTION
Avatar of _bmendoza
_bmendoza

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jdana

ASKER

jagssidurala,

I've asked a few stupid questions before, but this one may take the cake.  Thanks for the candid response.

J