在SQL Server中,可以使用以下方法批量更新數據:
UPDATE table1
SET column1 = table2.column2
FROM table1
JOIN table2 ON table1.key = table2.key
UPDATE table1
SET column1 = (
SELECT column2
FROM table2
WHERE table1.key = table2.key
)
MERGE table1 AS target
USING table2 AS source
ON target.key = source.key
WHEN MATCHED THEN
UPDATE SET target.column1 = source.column2;
這些方法可以根據具體的需求和數據情況選擇合適的方式進行批量更新操作。