1
How do I get EmployeeID
of the father passing the EmployeeID
of the child in the table below using the type variable hierarchyid
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
Thank you very much, very simple, and thank you for showing the Sqlfiddle, did not know this tool.
– Gabriel Santos Reis