Retrievin SQL Group Info on logged in user

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
 
T

Tom Ellison

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
 
V

Vadim Rapp

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top