HumanResources.uEmployeeDepartmentHistory Trigger
Information
| Name | HumanResources.uEmployeeDepartmentHistory |
| Table Name | HumanResources.EmployeeDepartmentHistory |
| Created | 14.10.2005 1:59:52 |
| Modified | 14.10.2005 1:59:52 |
| Disabled |   |
| For replication |   |
| Instead of trigger |   |
| Activates on | UPDATE |
SQL Script
CREATE TRIGGER [HumanResources].[uEmployeeDepartmentHistory] ON [HumanResources].[EmployeeDepartmentHistory]
AFTER UPDATE NOT FOR REPLICATION AS
BEGIN
SET NOCOUNT ON;
UPDATE [HumanResources].[EmployeeDepartmentHistory]
SET [HumanResources].[EmployeeDepartmentHistory].[ModifiedDate] = GETDATE()
FROM inserted
WHERE inserted.[EmployeeID] = [HumanResources].[EmployeeDepartmentHistory].[EmployeeID]
AND inserted.[DepartmentID] = [HumanResources].[EmployeeDepartmentHistory].[DepartmentID]
AND inserted.[StartDate] = [HumanResources].[EmployeeDepartmentHistory].[StartDate]
AND inserted.[ShiftID] = [HumanResources].[EmployeeDepartmentHistory].[ShiftID];
END;