1,需求分析 在TSql中实现层次结构,例如有这样一种数据结构,省,市,县,乡,村,如何使用一张表表示这种数据结构,并且允许是不对称的,例如,上海市是个直辖市,没有省份. create table dbo.hierarchy ( ID int not null primary key, --type int not null, ParentID int not null, name ) not null ) type表示类型,可以设置:省,Type是1:市,type是2,以此类推. Parent…