我对 a 使用以下语法merge
:
MERGE INTO studentinfo as Target
USING StudentInfo_Temp as Source ON Target.Form Number = Source.Form Number
WHEN MATCHED THEN
UPDATE
SET Target.Form Number = Source.Form Number
WHEN NOT MATCHED THEN
INSERT ([Form Number], [Academic Program])
VALUES (Source.Form Number, Source.Academic Program);
但是我在上面遇到了一个错误
on Target.Form Number = Source.Form Number
如果我用 Taget.ID = Source.ID 替换它,它工作正常,所以我假设我必须以其他方式写一个名称中有空格的列。
关于正确语法的任何建议?