I think it is better to limit the input parameter @n <= 10.
I modify this proc in my SQL 2000 Query Analyzer
just change the length of all parameters such as @sqlStmt,@base etc. to
5000
Then,I used 11 as input parameter and the Query Analyzer return an error:
can't generate query plan......
But I didn't try 10......