Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Get SQL Server IP Address Expand / Collapse
Author
Message
Posted Monday, August 01, 2011 11:22 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, March 18, 2014 11:34 AM
Points: 361, Visits: 1,138
Comments posted to this topic are about the item Get SQL Server IP Address

¤ §unshine ¤
Post #1152292
Posted Tuesday, August 02, 2011 12:20 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, September 28, 2012 9:00 AM
Points: 11, Visits: 156
Hi all!

I suggest a little add on to this 'IP-script' as follows:

OR upper (ipLine) like '%IPv4 ADDRESS%'

Cheers,
Bertil F
Post #1152301
Posted Tuesday, August 02, 2011 10:51 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 2:13 PM
Points: 188, Visits: 424
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.




PeteK
I have CDO. It's like OCD but all the letters are in alphabetical order... as they should be.
Post #1152739
Posted Wednesday, August 03, 2011 10:36 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, March 18, 2014 11:34 AM
Points: 361, Visits: 1,138
Awesome!Thanks!

¤ §unshine ¤
Post #1153994
Posted Friday, September 30, 2011 1:09 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, April 14, 2014 10:47 AM
Points: 2,141, Visits: 263
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'
Post #1183908
Posted Thursday, February 16, 2012 1:46 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 1:05 PM
Points: 304, Visits: 1,171
Hi
How i can get all remote servers IP add and host name ? you have any updated script?


Aim to inspire rather than to teach.
SQL Server DBA
Post #1253416
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse