CREATE OR ALTER TRIGGER TTBPDV_REPRESENTANTE_BIUD998 FOR TBPDV_REPRESENTANTE
ACTIVE BEFORE INSERT OR UPDATE OR DELETE POSITION 998
AS
BEGIN
    IF(INSERTING) THEN
    BEGIN
        EXECUTE PROCEDURE SPI_INTEGRACAO('TBPDV_REPRESENTANTE', NEW.ID, 2);
    END ELSE
    BEGIN
        EXECUTE PROCEDURE SPI_INTEGRACAO('TBPDV_REPRESENTANTE', OLD.ID, 2);
    END
END;