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 |
|
Swati Jain
Posting Yak Master
139 Posts |
Posted - 2010-01-14 : 05:59:47
|
| I want to update multiple rows of the columnHow can i do this using for loop??Or writing Cursor is required.Because i want to avoid the use of cursors . how i can write loops performing same update operation |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-01-14 : 06:08:45
|
Do you have an example? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-14 : 09:54:26
|
quote: Originally posted by Swati Jain I want to update multiple rows of the columnHow can i do this using for loop??Or writing Cursor is required.Because i want to avoid the use of cursors . how i can write loops performing same update operation
you dont need loops in most cases. you can go for set based solution. but to advise further we need to know actual scenario. would you mind explaining your scenario with some sample data? |
 |
|
|
sudheepdivakar
Starting Member
5 Posts |
Posted - 2010-01-14 : 12:03:50
|
| you can use while loop. i dont think sql have for loop. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-14 : 12:11:31
|
quote: Originally posted by sudheepdivakar you can use while loop. i dont think sql have for loop.
you should try to go for set based solution as far as you can . use of cursors and loops can hurt performance |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|