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 |
lcastillo83
Starting Member
2 Posts |
Posted - 2010-09-29 : 18:51:09
|
Hello GuysI've been working with SQL for a couple of months so I'm basicaly new on this... I have a question related to update statement...I have one temp table declare @TempTable table(id bigint, order bigint)with valuesid | order180 | 10151 | 20172 | 30130 | 40I would like to Update table "request" field rqorder with order field in @TempTable.Request table before updaterqid | rqorder130 | 10180 | 20151 | 30172 | 40161 | 120162 | 130163 | 140Request table after desired updaterqid | rqorder180 | 10151 | 20172 | 30130 | 40161 | 120162 | 130163 | 140I tried doing this but it does not do anything (no error) at all...update request set rqorder= (select order from @TempTable t1 , request where t1.id=request.rqorder) where exists (select id from @TempTable t1, rqs where t1.id=request.rqorder)db is MS SQL Express 2005I appreciate any help...LCastillo |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|