两种写法,暂未知道区别
1.
UPDATE a
SET a.resblockid = (
SELECT b.resblockId
FROM yyy.dbo.yyy b
WHERE a.unitId = b.id
)
FROM xxx.dbo.xxx a;
2.
UPDATE a
SET a.brokerId = b.brokerId,
a.brokerAssignedBy = b.brokerAssignedBy,
a.brokerAssignedTime = b.brokerAssignedTime
FROM
xxx.dbo.xxx a ,yyy.dbo.yyy b
WHERE
a.unitId = b.unitId;