Purchasing.uVendorContact Trigger

Information

NamePurchasing.uVendorContact
Table NamePurchasing.VendorContact
Created14.10.2005 1:59:57
Modified14.10.2005 1:59:57
Disabled 
For replication 
Instead of trigger 
Activates onUPDATE

SQL Script

CREATE TRIGGER [Purchasing].[uVendorContact] ON [Purchasing].[VendorContact] 
AFTER UPDATE NOT FOR REPLICATION AS 
BEGIN
    SET NOCOUNT ON;

    BEGIN TRY
        UPDATE [Purchasing].[VendorContact]
        SET [Purchasing].[VendorContact].[ModifiedDate] = GETDATE()
        FROM inserted
        WHERE inserted.[VendorID] = [Purchasing].[VendorContact].[VendorID]
            AND inserted.[ContactID] = [Purchasing].[VendorContact].[ContactID];
    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;