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
 SQL Server Administration (2008)
 Get domain user name

Author  Topic 

raguyazhin
Posting Yak Master

105 Posts

Posted - 2011-04-08 : 03:16:46
Hi

we using SQL server 2008 EE with Mixed Mode in our site and i configured server level DDL trigger and saved the eventdata to a single table for audit purpose.

ALL application developers accessing a SQL server through SSMS with single SQL server login user.if any developer create a new database in server then event actions were stored fine in audit table.

but SQL server login only saved in audit table.how to get windows domain user login name of the action performed machine.


--
Ragu Thangavel
Junier Sql Server DBA

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-04-08 : 04:17:20
SELECT USER_NAME()
SELECT SUSER_SNAME()

etc etc


N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

raguyazhin
Posting Yak Master

105 Posts

Posted - 2011-04-08 : 05:26:59
quote:
Originally posted by Peso

SELECT USER_NAME()
SELECT SUSER_SNAME()

etc etc


N 56°04'39.26"
E 12°55'05.63"




this function gives we connect sql server in sql server authentication it gives sql server username.

i want windows domain login user account for the query fired machine .

--
Ragu Thangavel
Junier Sql Server DBA
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-04-08 : 05:32:44
Tried select ORIGINAL_LOGIN() ?

I don't think you can't. You can however log the machine name.
SELECT HOST_NAME()






N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -