Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


The HierarchyID Datatype in SQL Server 2008


The HierarchyID Datatype in SQL Server 2008

Author
Message
clementhuge
clementhuge
SSC-Enthusiastic
SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)

Group: General Forum Members
Points: 117 Visits: 301
Good article. I just switched to SQL server 2008 and I played a little with all those hierarchy functions.
There is a typo though. The function is not IsDescendant but IsDescendantOf.
Other than that. Great Article.

Clement
jake.hulse
jake.hulse
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 12
Your example shows
SELECT *
From dbo.Organization
WHERE @BossNode.IsDescendant(EmployeeID)


How is this rewriten using IsDescendantOf?

Thanks for the article, very interesting!
Jake

Found the answer in case any other newbs stumble across this:

DECLARE @c AS HierarchyID
SELECT *
From dbo.Organization
WHERE @c.IsDescendantOf(Organization.EmployeeID)


Fozzie
Fozzie
Old Hand
Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)

Group: General Forum Members
Points: 393 Visits: 1172
And Reparent is now GetReparentedValue...

Good article, I am wandering myself about using this rather than the old child / parent id of past. One of the issues where I work, is getting everyone on the same page.

P.S I know this was written a year ago.... how things change! :-P
JRoughgarden
JRoughgarden
Valued Member
Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)

Group: General Forum Members
Points: 51 Visits: 195
Great article. I apologize for my rude English-speaking compatriots. You seem to speak French natively, and I very much appreciate your writing the article in English, because I sure don't speak French. Incidentally, I had little trouble understanding your article, but it would be a good idea to get an English editor in the future. You could even contact me!



Venky Subramaniam
Venky Subramaniam
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 135
[font="Tahoma"][/font]
Extremely well-written article with lots of valuable input but as some of the readers have observed (rather correctly), it would have been greatly helpful if the French was somehow substituted with English (the World's accepted dictum) that would make the author's sincere efforts fully appreciated and assimilated as should be...

I wish I knew French and that would have certainly made it easier to think like the author....If wishes were horses...Smile
David McKinney
David McKinney
SSC Eights!
SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)

Group: General Forum Members
Points: 871 Visits: 2090
Excellent article...pitched just right for me. Like some of the other readers, I found that it required a little effort to understand, but that was to do with the subject matter rather than the style / language.

To go from Recursive CTE to HierarchyId, was a lot to chew, but it tasted great.

I'm sure I'm not alone in saying that I'm quite shocked by the tone of some of the earlier comments, and I hope it won't dissuade you from writing more articles.

Thanks,

David McKinney.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search