• Create a linked server connection and use a

    SELECT ... INTO {linkedserver}.[{database}]..[{table}] FROM [{database}]..[{table}] WHERE statusflag = 0

    Update the statusflag on the source table after the insert (perhaps include an inner join with the destination table if during the transfer other records in the source will get a value 0 for statusflag).

    UPDATE [{database}]..[{table}]

    SET statusflag = 1 WHERE statusflag = 0

    FROM [{database}]..[{table}] source

    INNER JOIN {linkedserver}.[{database}]..[{table}] target

    ON source.ID = target.ID

    WHERE target.ID = 0

    Off course the above solution needs to be adjusted to your needs....

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **