From last two days i am searching for the answer of this querry.
I want to know how can i access the rows of tables in stored procedures using loops(Without cursor).
We don't want to use cursor for that because of the performance issues.
sarvesh jaiswar
0
Newbie Poster
Recommended Answers
Jump to PostJust to a while loop.
declare @rowcount int,
@counter int
select @rowcount = (select count(*) from table_name)set @counter = 0
while @counter <= @rowcount
begin
select * from table_name where rowid = @counter
set @counter = @counter + 1
end
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.