---
title: "How do you write a recursive query to fetch all descendants in a self-referencing table?"  
description: "How do you write a recursive query to fetch all descendants in a self-referencing table?"  
author: "Ashutosh Patel"  
published: 2025-04-30  
updated: 2025-04-30  
canonical: https://www.mindstick.com/forum/161549/how-do-you-write-a-recursive-query-to-fetch-all-descendants-in-a-self-referencing-table  
category: "SQL Server"  
tags: ["mssql server", "sql server", "sql"]  
reading_time: 1 minute  

---

# How do you write a recursive query to fetch all descendants in a self-referencing table?

How do you write a [recursive query](https://www.mindstick.com/forum/160921/help-with-writing-a-recursive-query-in-sql-server) to [fetch](https://www.mindstick.com/forum/156159/what-is-google-fetch) all descendants in a [self](https://www.mindstick.com/articles/44535/smart-ways-to-secure-self-storage-facilities)-referencing [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap)?


---

Original Source: https://www.mindstick.com/forum/161549/how-do-you-write-a-recursive-query-to-fetch-all-descendants-in-a-self-referencing-table

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
