Trying to run a simple update query but it throws the following error on line 5
尝试运行一个简单的update查询,但它在第5行抛出以下错误
update t3
set t3.Act_Flg = 'N', t3.ActiveEndDate = getdate()
from dbo.STG_EmployeeMaster_TEMP t3
inner join dbo.TEMP_EmployeeMaster t1 on t3.GPN = t1.GPN, t3.Name = t1.Name
where t1.RecordChangedFlag = 'Y'
It is throwing an error:
它抛出了一个错误:
Incorrect syntax near '='.
不正确的语法“=”附近。
I am not getting where is mistake?
我不知道哪里出错了?
1 个解决方案
#1
4
Use AND.
和使用。
update t3
set t3.Act_Flg='N', t3.ActiveEndDate=getdate()
from dbo.STG_EmployeeMaster_TEMP t3 INNER join dbo.TEMP_EmployeeMaster t1
on t3.GPN=t1.GPN and
t3.Name = t1.Name
where t1.RecordChangedFlag='Y'
#1
4
Use AND.
和使用。
update t3
set t3.Act_Flg='N', t3.ActiveEndDate=getdate()
from dbo.STG_EmployeeMaster_TEMP t3 INNER join dbo.TEMP_EmployeeMaster t1
on t3.GPN=t1.GPN and
t3.Name = t1.Name
where t1.RecordChangedFlag='Y'