﻿--同步重阅申请表结构后，再维护该字段

UPDATE VisitTaskReReading
SET TrialId = VisitTask.TrialId
FROM VisitTaskReReading 
INNER JOIN VisitTask ON VisitTaskReReading.OriginalReReadingTaskId = VisitTask.Id;

delete VisitTaskReReading where TrialId is NULL