Register now or log in to join your professional community.
update table using data in other table You can do that by using "join" between the two tables dependence on the common..........
if I understand you , you want to update table using data in other table You can do that by using "join" between the two tables dependence on the common column between them like this example :
Table1 ID
Name1
Table2
ID
Name2
the update statment :
update Table2
set Name2 = Name1
from Table1 inner join Table2
on Table1.ID = Table2.ID
Hope that it helps
According to my knowledge, there is no one single statement to update multiple rows at once (trust me i tried). i ended up using a stored procedure. you can create a stored proc, call it in a loop and pass on your values.
I didint understand your question, means what do you mean by one line command ??
simple update command can aslo update multiple rows !! Do You mean you want to write query in One Line ?