Capture windows group login - suser_sname does not work

R

Rachel

Hi,

I have 3 Windows Groups security logins called WL , PP and AB and I
have 3 users in each group. In my sql server db I have created a new
role and added the above groups to it. When one of the users attempts
to connect to my db via ADP (access project) they can connect to it
no
problem - however my problem is this, I need to be able to separate
data dependant on the users who input each record. So I have a
trigger
that populates a column called 'generated by' which uses
suser_sname() :

ALTER TRIGGER tbl_Client_GeneratedByTrigger
ON dbo.tbl_Client
FOR insert
AS
BEGIN

UPDATE dbo.tbl_Client SET GeneratedBy = suser_sname()
WHERE Client_ID IN (SELECT Client_ID FROM inserted)
END

This nearly does what i want except I need the generatedby column to
display the name of the windows group not the username. So in the
generatedby column it would read 'Domain/Wl' or 'Domain/AB instead of
Domain/Firstname.Surname etc

Please help as this is doing my head in :-o)
Rachel
 

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

Similar Threads


Top