November 25, 2009 at 11:20 pm
Hi,
Are there any constructs which provide same functionality of cursors
Thanks
November 25, 2009 at 11:25 pm
November 26, 2009 at 1:16 am
And if you look around this forum, you will also find that for 99.9% of the time that you think you need a cursor, guess what, you don't.
A majority of the time there is probably a set-based solution that is both faster and more scalable than a cursor-based solution.
November 27, 2009 at 9:23 am
the classic scenario is a while loop:
declare @i tinyint
set @i = 1
while @i < 10
begin
do something here
set @i = @i + 1
end
obviously you can do lots of things with @i or the comparison in the while...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy