Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Can I Use Join in Update Query?

Author  Topic 

khufiamalik
Posting Yak Master

120 Posts

Posted - 2008-09-09 : 05:22:56
Can I Use Join in Update Query?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-09 : 05:25:21
Yes.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-09 : 05:25:55
quote:
Originally posted by khufiamalik

Can I Use Join in Update Query?




Yes

Update t1
set t1.col1=t2.col1,
t1.col2=t2.col2
.
.
from table1 as t1 inner join table2 as t2 on t1.keycol=t2.keycol


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

sunil
Constraint Violating Yak Guru

282 Posts

Posted - 2008-09-09 : 05:27:44
Sure. Did you search on google before posting here?

For your reference and help
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76409
http://weblogs.sqlteam.com/jeffs/archive/2008/01/17/60458.aspx
Go to Top of Page
   

- Advertisement -