Benefits of using HierarchyID

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?

more ▼

asked Oct 12, 2009 at 01:02 PM in Default

avatar image

Melvyn Harbour 1 ♦♦
1.4k 19 40 26

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Oct 13, 2009 at 10:34 AM

avatar image

Grant Fritchey ♦♦
137k 20 46 81

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Oct 12, 2009 at 01:02 PM

Seen: 2714 times

Last Updated: Oct 15, 2009 at 05:56 AM

Copyright 2018 Redgate Software. Privacy Policy