Bradley Fox
asked on
MS SQL Update Trigger
I have a simple one for any database guys out there.
I have the fields isActive (bit) and Inactive_Date (datetime) in the table users.
I need a trigger to update the Inactive_Date field with CURDATE() when the field isActive is updated to 0 (False).
There are circumstances where this field would already be 0 but updated to the same value (during imports). I do not want Inactive_Date updated under these circumstances. It should only happen when the field changes from 1 to 0.
SQL 2008 R2
I have the fields isActive (bit) and Inactive_Date (datetime) in the table users.
I need a trigger to update the Inactive_Date field with CURDATE() when the field isActive is updated to 0 (False).
There are circumstances where this field would already be 0 but updated to the same value (during imports). I do not want Inactive_Date updated under these circumstances. It should only happen when the field changes from 1 to 0.
SQL 2008 R2
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER