Retrieve Role Name

  •  

    I have setup roles and users for my database.  I have one department 'Marketing'.  There are 10-12 persons in that department.  The department is subdivided into three different groups based on their activities.  Say...Marketing1, Marketing2, Marketing3.  I have created three roles as Marketing1,Marketing2,Marketing3 and put the users in their respective rols and assigned the permission.  Everything worked fine so far.

    Now a new requirement has come. We have to develop an application in which all the marketing users will have the same permissions of read/write.  I created the another role with Marketing and put Marketing1,Marketing2,Marketing3 roles within that role. 

    Now in my front end application,which is Microsoft access 2003, I want to just retrieve the top level role name for the user which is Marketing in this case.

    I hope I make it clear. Please help.

  • I assume you are referring to SQL Server database roles as opposed to Active Directory groups?  Have you tried using sp_helprolemember and passing in the name of the role, e.g:

    EXEC sp_helprolemember 'Marketing'

    This will give you a list of all the users that are a member of the 'Marketing' role, you can then check whether the user/login name is in the recordset returned. 

    ll

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply