Sql server 更新SQL中的语句时抛出错误

Sql server 更新SQL中的语句时抛出错误,sql-server,Sql Server,获取错误:“t2”附近的语法不正确。如何将临时表标记为t2?您需要在子查询中选择某个内容,或者是否需要使用别名对其进行标记,因为您没有使用任何字段。我添加了类似这样的内容:更新t1集t1.Act#flg='N'从STG_EmployeeMaster t1,temp#u EmployeeMaster t2其中t1.GPN不在(t2.GPN)但它结束了所有记录,而不是其他表中不存在的记录 update t1 set t1.Act_flg='N' from STG_EmployeeMaster t1

获取错误:“t2”附近的语法不正确。

如何将临时表标记为t2?您需要在子查询中选择某个内容,或者是否需要使用别名对其进行标记,因为您没有使用任何字段。我添加了类似这样的内容:
更新t1集t1.Act#flg='N'从STG_EmployeeMaster t1,temp#u EmployeeMaster t2其中t1.GPN不在(t2.GPN)
但它结束了所有记录,而不是其他表中不存在的记录
 update t1
set t1.Act_flg='N'
from STG_EmployeeMaster t1
where t1.GPN NOT IN (#Temp_EmployeeMaster.GPN) t2
update t1
set t1.Act_flg='N'
from STG_EmployeeMaster t1
where t1.GPN NOT IN (select GPN from #Temp_EmployeeMaster)