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)
 query update...

Author  Topic 

hai
Yak Posting Veteran

84 Posts

Posted - 2007-05-16 : 16:33:52
Any suggestion on how to improve this query?

Thanks

update tbl1
set col1 = (
select col from tbl2
where tbl1.col1 = tbl2.col
)

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-05-16 : 16:38:11
update tbl1
set col = col


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-05-16 : 16:38:55
You must have written the query wrong.
update		t1
set t1.col1 = t1.col3
from tbl1 as t1
inner join tbl2 as t2 on t2.col2 = t1.col4


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -