• Here are two versions, column lists removed for clarity. Don't rely on "SELECT *" to work across servers.

    -- V1: Copy the entire remote table, keep only what you need

    INSERT INTO dbo.table

    SELECT * FROM linksrv.db.dbo.table

    WHERE id NOT IN (SELECT id FROM dbo.table)

    -- V2: Get the remote table to read the existing IDs, and only send the records you want

    -- Requires linked servers both ways, with working two-hop security

    INSERT INTO dbo.table

    SELECT * FROM OPENQUERY(sourceserver,

    'SELECT * FROM db.dbo.table

    WHERE id NOT IN (SELECT id FROM targetserver.db.dbo.table WHERE id IS NOT NULL)')