Wednesday, 30 July 2014

Gethering full hierarchy from SQL Server table

Some time ago I’ve had to make some part of system, that uses hierarchical data stored in the database. Let’s imagine that we have an online store, which have products. That products points to one of categories. Our categories are organized as tree – creates hierarchy. The problem is, how to get all the products from category and all the subcategories in our hierarchy.