Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
Administering
»
GET the windows or Operating System loginname...
23 posts, Page 1 of 3
1
2
3
»
»»
GET the windows or Operating System loginname using sql server 2005
Rate Topic
Display Mode
Topic Options
Author
Message
dakshinamurthy-655138
dakshinamurthy-655138
Posted Monday, April 19, 2010 7:05 AM
Old Hand
Group: General Forum Members
Last Login: Today @ 2:35 AM
Points: 328,
Visits: 880
How to get the windows loginname using sql server 2005, for example My system IP Address is 192.191.190.1 i will have to give my loginname and password to connect to my system. The Loginname which i give to connect to the machine need to fetch this loginname using SQL Server 2005 please let me know how to find this.
With Regards
Dakshina Murthy
Post #905937
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Monday, April 19, 2010 7:13 AM
SSC-Dedicated
Group: Administrators
Last Login: Yesterday @ 6:14 PM
Points: 31,421,
Visits: 13,734
suser_sname()
http://msdn.microsoft.com/en-US/library/ms174427%28v=SQL.90%29.aspx
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #905940
dakshinamurthy-655138
dakshinamurthy-655138
Posted Monday, April 19, 2010 7:44 AM
Old Hand
Group: General Forum Members
Last Login: Today @ 2:35 AM
Points: 328,
Visits: 880
Thanks a lot for the reply, but when i execute the query i will get the systemname or computer name, in our case the computer name will be different and the loginname or the username for OS is different, here in our case, all of us are having the system name like issys320, issys318 etc, but for the issys320 the loginname which i use to login is dakshina i need to track the login dakshina.
With Regards
Dakshina Murthy
Post #905979
Lynn Pettis
Lynn Pettis
Posted Monday, April 19, 2010 7:56 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 12:11 AM
Points: 21,602,
Visits: 27,431
Curious. I execute
select suser_sname()
and it returns my username, not the name of my desktop system from which I have logged into the SQL Server instance.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #905992
Bhuvnesh
Bhuvnesh
Posted Monday, April 19, 2010 8:08 AM
SSCrazy
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
dakshinamurthy-655138 (4/19/2010)
but for the issys320 the loginname which i use to login is dakshina i need to track the login dakshina.
whats your sql windows login ?
can you see that dakshina in
select name , * from sys.syslogins
-------Bhuvnesh----------
While 1 = 1 (Learning SQL....)
Click to get fast response of your post
Post #906010
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Monday, April 19, 2010 8:10 AM
SSC-Dedicated
Group: Administrators
Last Login: Yesterday @ 6:14 PM
Points: 31,421,
Visits: 13,734
Sorry, I think I typed too many S's. Old habit from tracking machines too often.
suser_name() should return the security context.
http://msdn.microsoft.com/en-US/library/ms187934%28v=SQL.90%29.aspx
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #906012
dakshinamurthy-655138
dakshinamurthy-655138
Posted Monday, April 19, 2010 8:14 AM
Old Hand
Group: General Forum Members
Last Login: Today @ 2:35 AM
Points: 328,
Visits: 880
Hi Bhuvanesh,
here i am loging to SQL Server after loging to my desktop or Laptop PC , now i would like to track the login name which i use to login to the lap top where i have SQL Server 2005 and from there i will connect to my Destination DB.
When i execute the query you gave i will get the information as follows
name sid
sa 0x01
and so on.
With Regards
Dakshina Murthy
Post #906018
dakshinamurthy-655138
dakshinamurthy-655138
Posted Monday, April 19, 2010 8:15 AM
Old Hand
Group: General Forum Members
Last Login: Today @ 2:35 AM
Points: 328,
Visits: 880
Hi,
i even tried that, i will ge the login used to connect to sql server, but i am required of the loginname used to connect to my PC or Laptop system
With Regards
Dakshina Murthy
Post #906020
Bhuvnesh
Bhuvnesh
Posted Monday, April 19, 2010 8:16 AM
SSCrazy
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
@Steve
Difference between suser_sname() and suser_name() ?
-------Bhuvnesh----------
While 1 = 1 (Learning SQL....)
Click to get fast response of your post
Post #906022
Lynn Pettis
Lynn Pettis
Posted Monday, April 19, 2010 8:21 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 12:11 AM
Points: 21,602,
Visits: 27,431
dakshinamurthy-655138 (4/19/2010)
Hi,
i even tried that, i will ge the login used to connect to sql server, but i am required of the loginname used to connect to my PC or Laptop system
With Regards
Dakshina Murthy
Are you using the same user name to connect to SQL Server as your PC or Laptop?
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #906024
« Prev Topic
|
Next Topic »
23 posts, Page 1 of 3
1
2
3
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.