Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Towards the innovative SQL ideas
Browse by Tags · View All
ms sql server 119
ms sql 118
sql server 116
sql 115
database 102
tsql 81
#SQL Server 78
t-sql 75
#sql 71
sql server general 67

Archive · View All
April 2011 14
July 2011 12
May 2011 12
August 2011 11
June 2011 10
September 2011 8
December 2011 6
November 2011 6
June 2013 5
April 2013 5

Introduction to HierarchyId data type - Amazing feature of SQL Server 2008

May 30 2011 1:00PM by Paresh Prajapati   

With earlier version before 2008 of the SQL server, When we need to required hierarchical data at that time we were using the loop to get the data of parent - child hierarchy. And it was make code lengthy , very complex and costly as well.

What should be other feature and alternative for above? It is HierarchyId data type, introduced by SQL Server 2008. It is really amazing feature and very useful to avoid above such scenario. It is really used to reduce the code complexity and better performer.

There are some introduction of HierarchyId data type and as following, 1. It’s a new CLR data type. 2. Stored as varbinary. 3. Can create an Index on that. Now there are some methods which can be used with this feature.

1. GetRoot() : Return root node of the hierarchy tree
2. ToString() :  To get string representation of the hierarchy node.
3. Parse() : Get conversation from string representation to hierarchy node.
4. GetLevel() : Get level  depth of hierarchy node.
5. GetAncestor(n) : Get nth ancestor of the hierarchy node.
6. IsDescendant() : Returns of true/false if child node is descendant of hierarchy node.
7. GetDescendant () :  Get the child nodes of hierarchy node.
8. Reparent() : Move a node of hierarchy to new location.

Let’s look on the below hierarchy  where you can see the structure of it.

HierarchyId_Main
 
 Hierarchical data can get and this indexed in two ways.

1. Breath First Strategy
It traverse hierarchy from level by level means in breath first. Look on the screen shot below which give more idea.


2. Depth First Strategy
Traverse in depth node first, below screen shot will very clear us.



I will future posts the details of the every methods and functions with HierarchyId feature.

Tags: sql, sql server 2008, tsql, sql server, ms sql, ms sql server, t-sql, new features, feature, #SQL Server, mssql, #sql, database, enhancements,


Paresh Prajapati
6 · 22% · 7054
3
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"Introduction to HierarchyId data type - Amazing feature of SQL Server 2008" rated 5 out of 5 by 3 readers
Introduction to HierarchyId data type - Amazing feature of SQL Server 2008 , 5.0 out of 5 based on 3 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]