Disabling or enabling the trigger may impact UI (non-replication) table updates.
- Add a table to hold the replication update user's logon name for the replication updates.
- Change your trigger function to first check for the user name presence in the above table. If there is no user in the table, it's a standard table update taking place, so the trigger function continues normally. If there IS a record of this user's name in the above table, replication is taking place; do not perform the code in the function.
- Finally, alter the replication script, so that it writes the current user name to the table above before writing replication records into the main table, and removes the current user name at the end of the script.
This way, while user Bob starts the replication script, if user Fred then used the UI while the replication update was taking place, Fred's updates would be handled normally, even while Bob's replication updates would cause the trigger function to 'short circuit' its normal operation.
The only time this would 'bite you' would be if Bob tried to use the UI at the same time he's running the replication script...