0

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.

3
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by pty
0

Just 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

0

Just 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

MY REPLY:
What was rowid here. It was giving invalid column name in SQL SERVER. PLZ reply soon.

0

MY REPLY:
What was rowid here. It was giving invalid column name in SQL SERVER. PLZ reply soon.

your auto-incrementing id field

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.