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 2000 Forums
 SQL Server Administration (2000)
 Capturing User login

Author  Topic 

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2006-07-20 : 14:01:14
guys,

Is there anyway I can get the windows login name when user logins into the sql server from the same machine

right now I get session user using

DECLARE @session_usr char(30)
SET @session_usr = SESSION_USER
SELECT 'This session''s current user is: '+ @session_usr
GO

is there any way that I can get the windows user

Thanks

stephe40
Posting Yak Master

218 Posts

Posted - 2006-07-20 : 16:22:08
select loginame from master.dbo.sysprocesses
where spid=@@spid

- Eric
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-07-20 : 21:50:47
select system_user

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -