Trying to run a simple update query but it throws the following error on line 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?
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'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.