1.Hierarchical data is not relational. It is organized as a tree structure of parent and child elements rather than as flat lists of rows in related tables.
2.The most common hierarchical data format in today's world is XML. But XML is the wrong choice when you'd prefer to keep your data stored relationally as normal rows with standard SQL Server data-typed columns and all you really want is hierarchical linking capabilities between the rows. Since your data is then encapsulated within a single XML document.
3.The self-joining table approach and CTEs recursive queries can fulfill the hierarchy structure, but it requires you to handle much of the maintenance of the tree structure yourself.
沒有留言:
張貼留言