chelandrew
IS-IT--Management
I have a procedure that needs to select/sort through a table 10 times. The only thing different in each select is the 'where' and 'order by' clauses. I need to use a cursor to process but don't want to duplicate processing code for each cursor ten times since the routine is the same for each pass. Can I use a cursor variable to point to each of the selects or should I use dynamic sql? Can't seem to find many examples of cursor variables or using dynamic sql.