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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQl question

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-12-07 : 08:38:48
Atsou ATTOH writes "I would like to us either while or for to get row by row a data fro table in SQL SERVER 2000"

nr
SQLTeam MVY

12543 Posts

Posted - 2004-12-07 : 09:48:12
Where do you want to get the data to?
select ...., identity(int,1,1) as id in #a from ...
declare @id int
select @id = 0
while @id < (select max(id) from #a
begin
select @id = min(id) from #a where id > @id
select * from #a where id = @id
end


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -