x
login about faq Site discussion (meta-askssc)

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 '09 at 01:02 PM in Default

Melvyn Harbour 1 gravatar image

Melvyn Harbour 1 ♦♦
1.4k 17 20 22

(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 '09 at 10:34 AM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
61.9k 12 19 66

(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

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1601
x4

asked: Oct 12 '09 at 01:02 PM

Seen: 1648 times

Last Updated: Oct 15 '09 at 05:56 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.