--根据B更新AUPDATE a SET a.RecordId=b.RecordId FROM dbo.Z_InternalContract_RecordAttachment a JOIN dbo.T_InternalContract_Record b ON a.Old_RecordId=b.Old_RecordId