Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

User & Group Security

1 view
Skip to first unread message

Derek Hart

unread,
Feb 26, 2002, 7:17:18 PM2/26/02
to
In an ADP file, I wish to build security where I look at the logged on
user's name and groups he/she is in. Can I, in an ADP, access this
information from an NT 4.0 server, with Windows 98 and Windows XP
workstations?

Derek


Stuart Kirk

unread,
Feb 28, 2002, 2:09:20 PM2/28/02
to
hmmmmm

getting the logged on user name in TSQL is simply Current_User

then you could use something like:-

DECLARE @UserName varchar(100)
SET @UserName = Current_User

SELECT DbRole.Name
FROM sysusers AS DbRole
INNER JOIN sysmembers AS DbMembers ON DbRole.Uid = DbMembers.Groupuid
INNER JOIN sysusers AS DbUser ON DbMembers.MemberUid = DbUser.Uid
WHERE DbUser.Name = @UserName
and DbRole.issqlrole = 1

that will give you the list of Roles that this user belongs to.

Regards, Stuart


"Derek Hart" <dmh...@gte.net> wrote in message
news:O8zeIQyvBHA.2128@tkmsftngp07...

Derek Hart

unread,
Mar 4, 2002, 11:21:45 AM3/4/02
to
I will have SQL Server groups that define what users should have specific
access. Will I make every SQL Server group a role in Enterprise Manager?
So then I do not have to check the users and passwords in NT?

Derek


"Stuart Kirk" <in...@sks.demon.co.uk> wrote in message
news:#o$rC2IwBHA.2412@tkmsftngp04...

0 new messages