• You can view a cursor like something that is based on a select statement. It is this select statement that populates the cursor.

    So, you may have a table that have some rows physically sorted by a clustered index from, say 1-10. However, to actually see these rows you must get them, and to get them you must say SELECT mycolumn from mytable.

    But - there is no such thing as up or down, back or front or order in relational theory, unless you ask for it. So, by just saying 'SELECT mycolumn from mytable' will not guarantee that you are served the rows in the same order as they may lie in the table. To be sure, you must say SELECT mycolumn from mytable ORDER BY myColumn. Then, and only then can you be sure that rows are in the expected order (for sequential processing and the like)

    So, your cursor should be declared something like;

    DECLARE myCursor AS SELECT myCol FROM myTab ORDER BY myCol

    ....

    Hope it got clearer?

    /Kenneth