This is someone else's code which I'm trying to modify to make it not use global variable. I've been pulling my hair though unable to make this work.
The basic concept of recursion is straightforward: a given chunk of code calls itself until some boundary condition is reached. Arthur Fuller demonstrates how to use recursion in T-SQL. TechRepublic’s ...