The interview asked the question: what is the use of cursors when working with hierarchical structures?
Prior to this, it is necessary to say a lot with hierarchies did not have to work. There are a couple of “parent-child” tables in the project, but they are just two-level.
And now I decided to take up a more detailed study of hierarchies and cursors . But somehow, I would not look for it and no matter how big the data would be, programmers write on the forums that, regarding the parent-child structure, everything works well with рекурсии - обобщенные табличные выражения (CTE) . And there is no need to resort to cursors.
I haven’t detailed the hierarchyid data type yet, but in my opinion there’s also no point in looking for the advantages of cursors. With a superficial study of this type, as far as I understand it, I generally have my own statistical methods for working with nodes.
I thought maybe there would be some advantage found by the client application, and not the database administrator. But Google did not give anything. And in the literature that I have about cursors do not speak at all or one page material. MSDN and Intuit are more or less detailed about this, but again, there is nothing about the work of cursors with hierarchies.
I am sure that this advantage does not concern performance , here is something else).
Does anyone have any thoughts on this?