INSERT INTO ies.T_F042_TREKMP (F042TrekmpID,N_EXPERT,UIDEKMP,D_BEGIN,DATEBEG,IDEKMP,comment)
SELECT NEWID(),f004.N_EXPERT,'','2024-01-01 00:00:00.000','2024-01-01 00:00:00.000','','Добавлено при миграции'
FROM ies.T_F004_EXPERT as f004
LEFT JOIN ies.T_F042_TREKMP as f042 ON f004.N_EXPERT = f042.N_EXPERT
WHERE f042.N_EXPERT IS NULL;