/* 递归查询 塗聚文---SQL Server 2005环境下的实现: */--生成测试数据 create table Dept(ID int,ParentID int,msg varchar(20)) insert into Dept select 1,0,'d' insert into Dept select 2,1,'s' insert into Dept select 3,1,'nl' insert into Dept select 4,2,'d' insert into Dept s…