This works if you have a few things already in place, which I did.  You table must have

Id,

ParentId, (Points to the parent AKA adjacency hierarchy)

and Depth (which says how deep the element is.  I only had 3 levels so lineage works well in this case).

Set the root element's lineage to be the same as the Id.

Then run this till you get to your max depth, increasing the depth number each time.

UPDATE <Table_name>
SET Lineage = (SELECT Lineage FROM <Table_name> WHERE <Table_name>.ParentId = Id) + ',' + Cast(Id as varchar)
WHERE Depth = 1

There could very possibly be other ways to do this, but this seemed the easiest with what I had.