Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Name of client Machine

Author  Topic 

yaman
Posting Yak Master

213 Posts

Posted - 2010-02-01 : 08:09:58
Hello Sir ,

How i was was found the name of that user/client machine name who is connect my server .

Please help me out sir .

Thanks & Regards
Yaman

Yaman

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-01 : 08:40:16
use HOST_NAME() function

http://doc.ddart.net/mssql/sql70/ha-hz_2.htm
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2010-02-01 : 08:41:10
Well useing

EXEC sp_Who

OR

EXEC sp_who2

will show you all the connections and where they came from


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

manish29malhotra
Starting Member

1 Post

Posted - 2010-02-03 : 07:38:24
Select host_name()

will show the computer name
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-02-03 : 07:41:31
host_name() only shows your current connection. sp_who2 shows 'em all
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-02-03 : 07:43:55
Use sp_who2 like Charlie said.
That gives you more than only the current information about connection.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-02-03 : 07:44:22
Uups


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -