I don't know why you don't want to use a cursor which is probably the most
suitable means to solve your problem. But anyway, you have some other
options like these:
1. Add a flag to your table. After proccessing each record set the flag and
select the next nonprocessed record (using select top 1).
2. Copy all the records you want into a temporary table and again using
selectp top 1 read them one by one and delete them after processing.
3. Use a temporary table as a list of processed records, after processing
each record add its key to this list and select next record where its key
does not belong to this list.
If you give us more information about what you are exactly looking for and
what your problem is, you'll have a better chance to get the solution.
Shervin
"Chris" <ch***@dagran.com> wrote in message
news:73**************************@posting.google.c om...
Hi,
I am going to be difficult here... How do I retrieve one row at a
time from a table without using a cursor?
For example, I have a table with 100 rows. I want to retrieve the
data from row 1, do some stuff to it and send it on to anther table,
then I want to grab
row 2, do some stuff to it and send it to another table.
Here is how I am envisioning it:
WHILE arg1 < arg2 {arg1 is my initial row, arg2 would be by total
rowcount)
BEGIN
SELECT * FROM [TABLE] BUT ONLY ONE ROW
.... MANIPULATE THE DATA
INSERT into another table
END
Other notes, I am using SQL Sever 2000....
Thanks and in advance and as always the help is greatly appreciated.
Regards,
CLR