Board index » delphi » Logged in users name

Logged in users name

In my latest application I am using an MSSQL-server, and I need to get
the username of the logged in user.
How do I do this ?

(This has probably been answered before, but I couldn't find any
remaining posts)

Niklas Gustafsson
nic...@hem.passagen.se

 

Re:Logged in users name


Try the following statement:

select * from master..sysprocesses where loginame = USER

Hope that helps,
Yuri Sheino,
Creator of the SQLDirect at www.sqldirect-soft.com

Quote
Niklas Gustafsson wrote in message <389EA05F.4F4D5...@hem.passagen.se>...
>In my latest application I am using an MSSQL-server, and I need to get
>the username of the logged in user.
>How do I do this ?

>(This has probably been answered before, but I couldn't find any
>remaining posts)

>Niklas Gustafsson
>nic...@hem.passagen.se

Re:Logged in users name


Hi Niklas!

On Mon, 07 Feb 2000 11:37:19 +0100, Niklas Gustafsson

Quote
<nic...@hem.passagen.se> wrote:
>In my latest application I am using an MSSQL-server, and I need to get
>the username of the logged in user.

If I properly understood you then you should do:

select USER_NAME()

there is also a

select SUSER_NAME()

that will give you a login name.

tomi.

Other Threads