WITH cteName as (
SELECT SCHED.mList_id, ml.id, MD.mList_id, SM.mList_id
FROM [TEST].[dbo].[PATP_Schedule] AS SCHED
INNER JOIN TEST..PATP_MarshrutList AS ML
ON SCHED.mList_id = ML.id
INNER JOIN TEST..PATP_MarshrutData AS MD
ON MD.mList_id = ML.id
INNER JOIN [TEST].[dbo].[PATP_SubMarshrut] AS SM
ON ML.id = SM.mList_id
)
UPDATE cteName set mList_id = <someValue>;