标签:
--在SQL Server 中其实提供了CTE[公共表表达式]来实现递归:
表结构(数据为纵向的):
/****** Object: Table [dbo].[Sys_Role] Script Date: 2015/2/16 13:17:55 ******/ SET ANSI_NULLS ON GO
SET QUOTED_IDENTIFIER ON GO
CREATE TABLE [dbo].[Sys_Role](
[ID] [nvarchar](36) [PRIMARY] NOT NULL,
[RoleName] [nvarchar](20) NOT NULL,
[ParentID] [nvarchar](36) NULL,
[UpdateBy] [nvarchar](50) NULL,
[UpdateDate] [datetime] NULL)
标签:
原文地址:http://www.cnblogs.com/Gxiaopan/p/4294008.html