You can use cursor:
declare @Var1 varchar(10)
declare @Var2 varchar(10)
declare YourCursor cursor for
Select Field1, Field2 From YourTable
fetch next from YourCurstor into @Var1, @Var2
while @@fetch_status = 0 --indicate there are still records
begin
--Your code here
fetch next from YOurCursor into @Var1, @Var2
end
close YourCursor
deallocate YourCursor
Main Topics
Browse All Topics





by: MikeWalshPosted on 2003-10-27 at 13:11:43ID: 9629846
well there are a couple different ways to loop in sql. I am not a VB guy so I don't know the qdf.results. Can you give me a better picture of what you are trying to do?