执行此 SQL 脚本时出现以下错误:
MERGE TridionCentres TridionCentres
USING (SELECT * FROM #CentresToUpdate) NewInfo
ON (TridionCentres.[publication id] = NewInfo.[publication id] AND
TridionCentres.centre_number = NewInfo.centre_number)
WHERE matched THEN
UPDATE
SET TridionCentres.centre = NewInfo.centre,
TridionCentres.[date] = NewInfo.[date];
错误:
Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'WHERE'.
我看不出哪里出错了!
最佳答案
关键字是 WHEN,而不是 WHERE :)
更多信息 here ,但要回答的有点多。
关于SQL Server 合并语句 - 语法不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13380575/