views:

17

answers:

1

Is there a helpful tool or script resource to aid conversion from old-school adjacency list tables to MPTT?

I would have thought it was a problem faced by a few cleverer souls than I in the past, and thought I'd check here first in case they came up with a clever solution in their travels - before embarking on my own journey to do such a thing.

A: 

This link includes code to make the conversion. Look at the bottom for the SQL version of the code (there's also a PHP script to do it).

I know that I've seen code from Joe Celko on how to do it, but I don't recall if that was on the intertubes or in his book on trees and hierarchies in SQL.

Tom H.