HumanResources.uEmployeeDepartmentHistory Trigger

Information

NameHumanResources.uEmployeeDepartmentHistory
Table NameHumanResources.EmployeeDepartmentHistory
Created14.10.2005 1:59:52
Modified14.10.2005 1:59:52
Disabled 
For replication 
Instead of trigger 
Activates onUPDATE

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;