Title: Recursive Query in Sql Server                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
WITH TempTable(ID,Name,ReportingTo)
AS
(
SELECT e.empID,e.empName,e.empReportingTo FROM Employee_MAster e
WHERE e.empID = `JSD001`
 
UNION ALL
 
SELECT e.empID,e.empName,e.empReportingTo FROM Employee_MAster e, TempTable temp
WHERE e.empID = temp.ReportingTo
)
 
SELECT * FROM TempTable