I'm trying to move my understanding of recursion to tsql.
id name subid
1 Steve 3
2 Margot 3
3 Family 6
4 Other Family 6
5 Evert 4
6 Department 7
7 City 8
8 State 9
I understand that sql allow 32 levels of recursives deep.
I have to approaches with this test:
1 Make a recursive stored procedure that gives a result with all related subid ordered
2. Make it like a path (ponder if there was a web path that needs to be concated)
And also that @@nestLevel is a sort of built in function for avoiding deeper levels.