views:

30

answers:

3

I am connected to my company's SQL 2005 server over LAN.

How do I find out the host?

+1  A: 

Start -> Run

then type:

cmd

in a command window type:

netstat -o -a

Then switch to taskmanager and find PID of your application, so you can then search this pid in netstat output. I think there will be enough details for you.

smok1
netstat -o -a runs very fast and the command closes within 1 sec. How could I keep it open?
Greg
Either run it from a command prompt or use cmd /k netstat -o -a
adrianbanks
start -> Execute -> cmdThen write netstat there and the window will not close.
Jonathan
@Greg - use Jonathan or adrianbanks approach. I am also adding this to my reply.
smok1
Thanx a million smok1
Greg
Thank you Jonathan
Greg
Thank you adrianbanks
Greg
+2  A: 

In command prompt type in

netstat -a

This should give you the list of all current TCP connections. You should be able to see the one connected to a server on the mssql port.

holz
netstat -a runs very fast and the command closes within 1 sec. How could I keep it open?
Greg
thanx a million holz
Greg
+3  A: 

Have you tried select host_name()?

Neil Barnwell