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 |
|
erwine
Yak Posting Veteran
69 Posts |
Posted - 2006-06-08 : 23:57:02
|
| Okay, I have :SELECT t_name, t_code FROM [TABLE1]It will result in, let's say :'T1','0001''T1','0011''T2','0106''T2','0203'Now from the result, I actually want to do :Update T1 set Lock = 1 where Code = '0001'Update T1 set Lock = 1 where Code = '0011'Update T2 set Lock = 1 where Code = '0106'Update T2 set Lock = 1 where Code = '0203'Any idea how to do that in one shot?Thx for your kind attention.... sql is fun... |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
erwine
Yak Posting Veteran
69 Posts |
Posted - 2006-06-09 : 00:31:44
|
| Yes..currently im using loop to execute UPDATE by using sp_executesqlIm juz thinking whether there is a way to do without looping.thx btw..i'll read the link 1st.:)... sql is fun... |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|