Don't have Telegram yet? Try it now!
https://blog.techygeekshome.info/2014/01/sql-query-for-sccm-hierarchy-information/
SQL Query for SCCM - Hierarchy information