UPDATE AD
SET AD.ArrangementLineUniqueID = A.ArrangementLineUniqueID
FROM ArrangementLinesDeleted AD
JOIN ArrangementLines A ON AD.LineNumber = A.ArrangementLineNumber

UPDATE AD
SET AD.ArrangementLineUniqueID = A.ArrangementLineUniqueID
FROM ArrangementLinesDepDeleted AD
JOIN ArrangementLines A ON AD.LineNumber = A.ArrangementLineNumber


UPDATE AD
SET AD.FK_ArrangementLineUniqueID = A.ArrangementLineUniqueID
FROM ArrangementLineDepartmentXTab AD
JOIN ArrangementLines A ON AD.FK_ArrangementLineNumber = A.ArrangementLineNumber
