April 2011
Beginner to intermediate
443 pages
11h
English
First, create an employee containing a HIERARCHYID. The employee table will have the following attributes: a unique record identifier, the employee's name, the employee's position, and the employee's level in the company. Create the employee table in the AdventureWorksDW2008R2 database by entering and executing the following T-SQL code in an SSMS query:
CreateTabledbo.EmployeeHierarchy
(
EmployeeID IntIdentity (1, 1)NotNull Primary Key,
Name Varchar(50)NotNull,
Position Varchar(50)NotNull,
OrganizationLevel HierarchyID
);
Go
Read now
Unlock full access