Hierarchyid数据类型

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

Use AdventureWorksLT 
Go  
--Scheme Creation 
Create Schema HumanResources 
Go  
--Table Creation 
CREATE TABLE HumanResources.EmployeeDemo 
(
OrgNode HIERARCHYID,
EmployeeID INT,
LoginID VARCHAR(100),
Title VARCHAR(200),
HireDate DATETIME
)
Go 
--Index Creation 
CREATE UNIQUE CLUSTERED INDEX idxEmployeeDemo 
ON HumanResources.EmployeeDemo (OrgNode,EmployeeID)