开发者

Converting adjacency list tables to MPTT in SQL Server 2008

开发者 https://www.devze.com 2023-01-05 07:39 出处:网络
Is there a helpful tool or script resource to aid conver开发者_开发问答sion from old-school adjacency list tables to MPTT?

Is there a helpful tool or script resource to aid conver开发者_开发问答sion 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消