0

i have a two table one name is "user" and another name is "Prod".

My query is

update User_list_SQL set team=s.uteam, S.flag='Y' 
from User_list_SQL as U, SQlVal as S 
where U.name=S.uname

the error comes the following

[SQL Server]The multi-part identifier "S.flag" could not be bound.

How to write the query the above instance? please advice. Thanks

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843

1 Answers1

0

You cannot update two tables at once. You will need to split it into 2 queries.

Follow below post..

Update multiple tables in SQL Server using INNER JOIN

Community
  • 1
  • 1
Sateesh Pagolu
  • 8,769
  • 2
  • 24
  • 45