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 |
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2005-05-05 : 04:55:02
|
| How can I update only the top 10 rows only.Is there any way to do this? |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2005-05-05 : 04:57:45
|
| What do you mean the top 10 rows? Top has no meaning in a relational database unless you apply an order.-------Moo. :) |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-05-05 : 04:59:24
|
and you can't do that in an update. i kind of thinking you want to use set rowcount 10Go with the flow & have fun! Else fight the flow |
 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2005-05-05 : 05:12:50
|
You could probably do something likeUPDATE yourtable SET yourvalue = Whatever WHERE yourkeycolumn IN (SELECT TOP 10 yourkeycolumn FROM yourtable ORDER BY yourkeycolumn) -------Moo. :) |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2005-05-05 : 13:57:16
|
| Thanks.......this should work |
 |
|
|
|
|
|