• Please supply the indexes on pp (patenit_property) and pp_staging as well as the INSERT statement used to copy the data.

    One thing I can say is that if you were to alter your trigger to skip the update if arrival_timestamp were supplied and supply "arrival_timestamp = SYSDATETIMEOFFSET()" in your INSERT statement you would save yourself a ton of I/O. You would need to do some impact analysis however to ensure a change like this would not compromise your data should other inserts or updates supply invalid values for that column thereby circumventing the usefulness of the trigger. If that were a concern there are other things you could do with CONTEXT_INFO to skip the work in the trigger for only your batch process.

    ALTER TRIGGER [dbo].[patient_property_arrival] ON [dbo].[patient_property]

    AFTER INSERT, UPDATE

    AS

    BEGIN

    IF NOT UPDATE(arrival_timestamp)

    BEGIN

    UPDATE dbo.pp

    SET arrival_timestamp = SYSDATETIMEOFFSET()

    FROM inserted i

    WHERE dbo.pp.p_id = i.p_id

    AND dbo.pp.s_name = i.s_name

    AND dbo.pp.pro_id = i.pro_id

    AND dbo.pp.timestamp_ts = i.timestamp_ts

    AND dbo.pp.checked = i.checked;

    END

    END

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato