I am in the same boat, actually I was. We also had
thousands and thousands of lines of procedural code to be
converted to SQL 2K.
What I have discovered is most of the time a select
statement would achieve the same recursiveness as a scan-
endscan or do-while's. Especially the Where part of the
clause can be used extensively for any if-else-endif
statements that mat exist inside do-loops or scan loops.
Moreover case statement can be used within the select
clause itself to determine any conditions for each row and
for each column. In my experience so far I have seldom
used a cursor for any of the stuff you are mentioning. As
far as time is concerend it is negligible for any kind of
updates or deletions as compared to do-while etc. kind of
oriented approach which
as a single query. [/ref]