August 1, 2011 at 11:22 pm
Comments posted to this topic are about the item Get SQL Server IP Address
¤ §unshine ¤
August 2, 2011 at 12:20 am
Hi all!
I suggest a little add on to this 'IP-script' as follows:
OR upper (ipLine) like '%IPv4 ADDRESS%'
Cheers,
Bertil F
August 2, 2011 at 10:51 am
If you're running SQL Server 2005 or above you can use this (some shops disable xp_cmdshell):
Select
client_net_address,local_net_address
from sys.dm_exec_connections
where session_id=@@SPId;
Limitation: You only get IP addresses if you're connective via TCP/IP. If you're local and using Shared Memory then those attributes don't exist. If you turn off Shared Memory (or any protocols except for TCP/IP) via Server Configuration Manager you will always get IP address for any connection using this technique.
August 3, 2011 at 10:36 pm
Awesome!Thanks!
¤ §unshine ¤
September 30, 2011 at 1:09 pm
Select
client_net_address,local_net_address
from sys.dm_exec_connections
where session_id=@@SPId;
- This works
Yours does not on our cluster evironment (NULL)
create table #temp (ipLine varchar(200))
insert #temp
exec master..xp_cmdshell 'ipconfig'
February 16, 2012 at 1:46 pm
Hi
How i can get all remote servers IP add and host name ? you have any updated script?
May 12, 2016 at 7:12 am
Thanks for the script Sunshine.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy