Home > Archive > microsoft.public.sqlserver.server > June 2002 > How to retrieve a computer name and user name of a computer





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to retrieve a computer name and user name of a computer
allen davidson

2002-06-22, 8:31 pm

Hi Tin Le

Try these in query analyser

select @@servername
select user_name()
select current_user
select host_name()

Allen

>-----Original Message-----
>Hi!
>I would like to retrieve a computer name and user ID from

a stored procedure
>but do not know how.
>
>Please help
>
>Thank you.
>
>Tin Le
>
>
>.
>

Tin Le

2002-06-22, 8:31 pm

Thank you Allen,

Yes! That is what I needed.

I have added a new one

Select (suser_sname())

to get UserID too


Thank again.

Tin Le

"allen davidson" <allen_davidson@europe.mccann.com> wrote in message
news:d79f01c2115b$6bd236b0$3ae
f2ecf@TKMSFTNGXA09...
> Hi Tin Le
>
> Try these in query analyser
>
> select @@servername
> select user_name()
> select current_user
> select host_name()
>
> Allen
>
> >-----Original Message-----
> >Hi!
> >I would like to retrieve a computer name and user ID from

> a stored procedure
> >but do not know how.
> >
> >Please help
> >
> >Thank you.
> >
> >Tin Le
> >
> >
> >.
> >



Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net