1

Topic: Re: Hierarchy in the plane

Hello, S, you wrote: S> There is a table with roles of type Role (Id, Parent) and table UserRole (User, Role). Roles can be hierarchical. Whether there is any elegant request without cursors to receive the table to type FlattenUserRole (User, Role) where lines on User would be doubled so much time, how many roles (including parent) have User. It is called transitive closing. "The elegant" request is possible in Oracle c it Hierarchical clause. In other DBMS with support recursive CTE the request without cursors too is possible, but its elegant to name already difficult (if as elegance to understand laconicism).

2

Re: Re: Hierarchy in the plane

Hello, S, you wrote: S> There is a table with roles of type Role (Id, Parent) and table UserRole (User, Role). Roles can be hierarchical. Whether there is any elegant request without cursors to receive the table to type FlattenUserRole (User, Role) where lines on User would be doubled so much time, how many roles (including parent) have User. Here found an article on a subject. On MS-SQL it is supported since version MSSQL Server 2005. If it is necessary, I can a SQL query  it is applicable was specific to MS-SQL

3

Re: Re: Hierarchy in the plane