How do I get EmployeeID
of the parent passing the EmployeeID
of the child from the table below using the hierarchyid
variable in SQL Server?
CREATE TABLE Employee
(
Node hierarchyid PRIMARY KEY CLUSTERED,
EmployeeID int UNIQUE NOT NULL,
EmpName varchar(20) NOT NULL,
Title varchar(20) NULL
) ;
GO