puresourcecode.com
Building of an organizational chart for AdventureWorks & AdventureWorks2008
-- SQL recursive CTE to find subordinates of executive, manager & supervisor-- Tree processing - find all descendants - find children - self-referencing tableDECLARE @EmployeeID INT SET @EmployeeID = 109 USE AdventureWorks; WITH cteEmployeeName AS (SELECT FullName = FirstName + ' ' + LastName, EmployeeID FROM HumanResources.Employee e INNER JOIN Person.Contact c ON e.ContactID =...
Enrico