Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Windows Login Name in TSQL
I've looked but I can't find.
Is there a way to get the windows login name in TSQL?
Also I would like the workstation name (computer name).

The software we use doesn't use a separate login name for each user, so
everyone is actually logging in using the same database login, but I need
some way to get to their computer name and login name.

Thanks,
Alan Sawyer

Report this thread to moderator Post Follow-up to this message
Old Post
asawyer@chambersREMOVEbelt.com
08-31-05 01:23 AM


Re: Windows Login Name in TSQL
I am using SS2k.
Alan Sawyer

Report this thread to moderator Post Follow-up to this message
Old Post
asawyer@chambersREMOVEbelt.com
08-31-05 01:23 AM


RE: Windows Login Name in TSQL
If the authentication being used is "windows authentication", then you can
get it with suser_sname(). If the authentication being used is "sql server"
then you can not see the nt user.

For the "computer name" see host_name in BOL.


AMB

" asawyer@chambersREMO
VEbelt.com" wrote:

> I've looked but I can't find.
> Is there a way to get the windows login name in TSQL?
> Also I would like the workstation name (computer name).
>
> The software we use doesn't use a separate login name for each user, so
> everyone is actually logging in using the same database login, but I need
> some way to get to their computer name and login name.
>
> Thanks,
> Alan Sawyer
>

Report this thread to moderator Post Follow-up to this message
Old Post
Alejandro Mesa
08-31-05 01:23 AM


Re: Windows Login Name in TSQL
See SUSER_SNAME function in SQL Server Books Online. Also the HOST_NAME
function.

--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @ http://vyaskn.tripod.com/


< asawyer@chambersREMO
VEbelt.com> wrote in message
news:uEPF0UZrFHA.3392@TK2MSFTNGP11.phx.gbl...
> I've looked but I can't find.
> Is there a way to get the windows login name in TSQL?
> Also I would like the workstation name (computer name).
>
> The software we use doesn't use a separate login name for each user, so
> everyone is actually logging in using the same database login, but I need
> some way to get to their computer name and login name.
>
> Thanks,
> Alan Sawyer



Report this thread to moderator Post Follow-up to this message
Old Post
Narayana Vyas Kondreddi
08-31-05 01:23 AM


Re: Windows Login Name in TSQL
Since there is only one user setup in the database, it would have to be
using sql server authentication, wouldn't it??
The individual users are not being setup in the database.
Does this mean there is no way to get it?
Alan Sawyer

Report this thread to moderator Post Follow-up to this message
Old Post
asawyer@chambersREMOVEbelt.com
08-31-05 01:23 AM


Re: Windows Login Name in TSQL
Depend. If the user is bound to a login that is a ntgroup, then you can. You
can see the login using sp_helpuser and inquire master.dbo.syslogins to see
if the login is an ntgroup or ntuser.


AMB



" asawyer@chambersREMO
VEbelt.com" wrote:

> Since there is only one user setup in the database, it would have to be
> using sql server authentication, wouldn't it??
> The individual users are not being setup in the database.
> Does this mean there is no way to get it?
> Alan Sawyer
>

Report this thread to moderator Post Follow-up to this message
Old Post
Alejandro Mesa
08-31-05 01:23 AM


Re: Windows Login Name in TSQL
Doesn't look like that will work
I have 30 users in the software, but a
select * from master.dbo.syslogins only shows 12 records returned.
Alan

Report this thread to moderator Post Follow-up to this message
Old Post
asawyer@chambersREMOVEbelt.com
08-31-05 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 10:50 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006