HumanResources.uShift Trigger
Information
| Name | HumanResources.uShift |
| Table Name | HumanResources.Shift |
| Created | 14.10.2005. 1:59:56 |
| Modified | 2.7.2009. 10:35:10 |
| Disabled |   |
| For replication |   |
| Instead of trigger |   |
| Activates on | UPDATE |
SQL Script
CREATE TRIGGER [HumanResources].[uShift] ON [HumanResources].[Shift]
AFTER UPDATE NOT FOR REPLICATION AS
BEGIN
SET NOCOUNT ON;
BEGIN TRY
UPDATE [HumanResources].[Shift]
SET [HumanResources].[Shift].[ModifiedDate] = GETDATE()
FROM inserted
WHERE inserted.[ShiftID] = [HumanResources].[Shift].[ShiftID];
END TRY
BEGIN CATCH
EXECUTE [dbo].[uspPrintError];
-- Rollback any active or uncommittable transactions before
-- inserting information in the ErrorLog
IF @@TRANCOUNT > 0
BEGIN
ROLLBACK TRANSACTION;
END
EXECUTE [dbo].[uspLogError];
END CATCH;
END;