In this post, we are going to learn “how we can convert a comma separated list into a table using a recursive CTE”. Below is the code:
Why OPTION MAXRECURSION?
Hint OPTION(MAXRECURSION 32767) is a query hint which instructs to compiler to iterate 32767 times. Default, max recursion of a loop in SQL is 100 and in case we will not put this hint at the end, any string which requires more loop than 100 will raise an error.
To avoid the error we have used OPTION(MAXRECURSION 32767).
Thanks for reading.… More