Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 sql server api

Author  Topic 

jassie
Constraint Violating Yak Guru

332 Posts

Posted - 2011-08-25 : 12:04:22
I have the following sql server data access questions:

1. I would like users to sign on to sql server using group roles by using sql authenication. However, I would like sql server to know who the individual users are are so I can keep an audit trail of changes made to the various database tables. Can you tell me if this is possibly and point me to a reference I can use to see how to code this request?

2. Can sql server 2008 use the active directory? If so, can you point me to a reference that shows how to accomplish this task?

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-08-25 : 12:10:41
Just create logins for the AD groups.

You can capture individual group members who are logged in like this:

SELECT distinct s.login_name, s.host_name, c.client_net_address
from sys.dm_exec_connections c
join sys.dm_exec_sessions s
on c.session_id = s.session_id


Also, for auditing, use suser_name() which will return the actual user account, not the group.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-08-25 : 12:12:41
See this article
Go to Top of Page
   

- Advertisement -