SQL Server - Recursive CTE query to get manager hierarchy

less than 1 minute read

I've used the CONNECT BY syntax to do hierarchy queries in oracle, but recursive queries seem to be the new standard (not so new I guess, but new for me!). Now that I'm using SQL server it seems to be the only way to go. So here's my reference for walking a single table parent/child hierarchy:

Updated: