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
 Transact-SQL (2000)
 Capture Windows user name

Author  Topic 

blackX
Posting Yak Master

102 Posts

Posted - 2008-10-08 : 10:09:45
I need to capture the user name for a parameter it a stored procedure, is this possible?
Thanks in advance

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-10-08 : 10:14:21
maybe...

select SUSER_SNAME()

Em
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-08 : 10:14:43
use SUSER_SNAME()
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-08 : 10:22:29
Try SYSTEM_USER also
Go to Top of Page

blackX
Posting Yak Master

102 Posts

Posted - 2008-10-08 : 10:26:30
thanks but that returned the database user and it is a universal account. I actually need the Windows user name.
Go to Top of Page

blackX
Posting Yak Master

102 Posts

Posted - 2008-10-08 : 10:28:17
quote:
Originally posted by visakh16

Try SYSTEM_USER also



it retured the sql user also, but thanks.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-08 : 10:28:20
quote:
Originally posted by blackX

thanks but that returned the database user and it is a universal account. I actually need the Windows user name.


both returned db user?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-08 : 10:29:10
i think this is what you're asking for

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=319323&SiteID=1
Go to Top of Page

blackX
Posting Yak Master

102 Posts

Posted - 2008-10-08 : 13:47:50
quote:
Originally posted by visakh16

i think this is what you're asking for

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=319323&SiteID=1




thanks for the imput but I acutally was able to do it through the application in Visual basic.
Go to Top of Page
   

- Advertisement -