Purchasing.uVendor Trigger
Information
| Name | Purchasing.uVendor |
| Table Name | Purchasing.Vendor |
| Created | 14.10.2005 1:59:57 |
| Modified | 14.10.2005 1:59:57 |
| Disabled |   |
| For replication |   |
| Instead of trigger |   |
| Activates on | UPDATE |
SQL Script
CREATE TRIGGER [Purchasing].[uVendor] ON [Purchasing].[Vendor]
AFTER UPDATE NOT FOR REPLICATION AS
BEGIN
SET NOCOUNT ON;
BEGIN TRY
UPDATE [Purchasing].[Vendor]
SET [Purchasing].[Vendor].[ModifiedDate] = GETDATE()
FROM inserted
WHERE inserted.[VendorID] = [Purchasing].[Vendor].[VendorID];
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;