Hierarchy in TSQL – step by step guide