Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesI'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
Post Follow-up to this messageIf 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 >
Post Follow-up to this messageSee 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
Post Follow-up to this messageSince 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
Post Follow-up to this messageDepend. 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 >
Post Follow-up to this messageDoesn'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
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread