Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with view syntax
Message
From
03/10/2009 09:22:02
 
 
To
03/10/2009 09:04:44
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Application:
Desktop
Miscellaneous
Thread ID:
01427486
Message ID:
01427493
Views:
31
>Correction
>
>select u_id,
>	u_name,
>	ur_RoleId,
>	r_name, 
>	Isnull(MIN(ri_Restriction), 0) as restriction
>	from @User 
>		join @UserRoles on ( u_id = ur_UserId ) 
>		join @Role on ( ur_RoleId = r_Id )  /* this is just to see the drscription of the role */
>		left join @RoleItems  on  (ur_RoleId = ri_RoleId )
>		group by u_id, u_name, ur_RoleId, r_name
>
>
>1	Viv	1	Admin	0
>1	Viv	2	User	2
>
>
Hi,

Of course you were absolutely right earlier about needing to navigate via UserRoles.

>But I don't see where ri_ItemId fits in
The RoleItems table links Roles to Items. At the end of the day I want to pass in a user name and Item Id and only get back the lowest restriction (i.e first record in the above example)

My head is starting to hurt......
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform