View Single Post

   
  #1 (permalink)  
Old 05-10-2008, 03:12 PM
Leif Neland
 
Posts: n/a
Default updating multiple columns with subselect

This is not supported in MSsql.

update T1 set (theUpdatedValue, theOtherValue) =
(select theTop, theValue from T2 where T2.theKey = T1.theID)

Is there a workaround?

Other than doing it in a loop from eg asp, over either fields (one statement
per field), or over records (a query with a loop which for each row does a
select from one table, update other table with the selected values.)


Reply With Quote