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.
| Author |
Topic |
|
ikhuram
Starting Member
28 Posts |
Posted - 2004-06-01 : 03:01:52
|
| How can update multiple columns' of a table while selecting values from another table's column. Please tell me the syntax |
|
|
vganesh76
Yak Posting Veteran
64 Posts |
Posted - 2004-06-01 : 04:22:21
|
| Here is a sample code which has select values from one table and then updating the values in the base table.update t1 set col1=b.col1, col2 =b.col2from t1 a,(SELECT col1,col2 from T2WHERE T2.C1 = <CND2>) as bwhere a.col1=b.col1Enjoy working |
 |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-06-01 : 04:23:42
|
| UPDATE aSET col1 = b.Col1, col2 = b.Col2FROM TableA aJOIN Tableb b ON a.ID = b.IDWHERE b.Amount < 100000--***** Something like thatDuane. |
 |
|
|
Werwolf13
Starting Member
7 Posts |
Posted - 2004-06-01 : 04:31:20
|
| it dependes on the order in which are you going to populate the destination column and to query from the source one.... write more accurate details... |
 |
|
|
|
|
|