SQL Server update query update two table -


i using sql server. have written update statement using join. try update 1 column in table, update statement removes value table. not understand why happening though updating value 1 column.

update rs set rs.col1 = t.col2 table1 r join table2 rs on rs.id = r.id join @temp t on t.id = rs.id 

i trying update col1 value in table2 updates value both in table2 col1 , in table1

i think have problem joins. i've renamed of aliases of tables make statement bit more clearer.

update t2 set t2.col1 = t.col2 table1 t1     join table2 t2 on t2.id = t1.id     join @temp t on t.id= t2.id 

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -