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 |
|
mk_garg20
Constraint Violating Yak Guru
343 Posts |
Posted - 2004-08-25 : 00:28:42
|
| Hi All,I have two tables:-Create table #x(a int, b int,c int)Insert into #xSELECT 1,1,1UNION ALLSELECT 2,2,2UNION ALLSELECT 3,3,3UNION ALLSELECT 4,4,4Create table #y(a int, b int,c int)Insert into #ySELECT 1,1,111UNION ALLSELECT 2,2,222select * from #xselect * from #ydrop table #xdrop table #yHow to update column #x.c with #y.c where #x.a=#y.a and #x.b=#y.bThanksmk_garg |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-08-25 : 00:54:34
|
| UPDATE #x SET #x.c = #y.c FROM #x, #y WHERE #x.a = #y.a and #x.b = #y.b |
 |
|
|
mk_garg20
Constraint Violating Yak Guru
343 Posts |
Posted - 2004-08-25 : 01:25:36
|
| Thanksmk_garg |
 |
|
|
|
|
|
|
|