What are the benefits of using the built in HierarchyID data type rather than rolling my own and writing appropriate stored procedures to do my data access?
What are the benefits of using the built in HierarchyID data type rather than rolling my own and writing appropriate stored procedures to do my data access?
Short answer, it's easier to write code against it. If you roll your own storage mechanism, and write all your own access code, you'll do fine, but what happens when the next person has to write code against that same set of columns. They'll have to find out through some method of documentation what you did, how you did it, why you did it and how to access it themselves. With a HierarchyID column, the documentation is built into the product. Everyone is going to access it in the same way, every time. That consistency will lead to better code, easier to maintain and easier to hand off to others.
No one has followed this question yet.