Retrievin SQL Group Info on logged in user

  • Thread starter Thread starter Alan Fisher
  • Start date Start date
A

Alan Fisher

I would like to retrieve the current users SQL group membership. What I want
is to be able to write code like:



If USERNAME is member of POWERUSERS Then

Do something
Else

Do Something different

End If

Thanks for any help
 
Dear Alan:

Write the first line using a subquery:

If USERNAME IN (SELECT UserName FROM AllUsers
WHERE IsPowerUser = 1)

You must fix all column names and the table name I assumed, and fix the
WHERE condition according to your design of what is a power-user.

Tom Ellison
 
Hello,
You wrote on Fri, 27 Jan 2006 18:10:54 GMT:

AF> I would like to retrieve the current users SQL group membership.

check out the function IS_MEMBER.

Vadim Rapp
 
Back
Top