Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with view syntax
Message
De
03/10/2009 09:22:02
 
 
À
03/10/2009 09:04:44
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Desktop
Divers
Thread ID:
01427486
Message ID:
01427493
Vues:
32
>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......
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform