T-SQL Query to find IP Address of SQL Server | SansSQL

Saturday, March 23, 2013

T-SQL Query to find IP Address of SQL Server

Here is a handy T-SQL script to find the IP Address of the SQL Server you are connected to.

SELECT CONNECTIONPROPERTY('local_net_address') AS [IP Address Of SQL Server]

SELECT SERVERPROPERTY('ComputerNamePhysicalNetBIOS') [Machine Name]
   ,SERVERPROPERTY('InstanceName') AS [Instance Name]
   ,LOCAL_NET_ADDRESS AS [IP Address Of SQL Server]
   ,CLIENT_NET_ADDRESS AS [IP Address Of Client]


Unknown said...

Thnx a lot.. god bless...

thongchai.jindatam said...


RESULT >>> local machine

Help Me plese

Sandesh Segu said...

You have to run this query from a remote PC to get IP address. If you are running from the same server as SQL server then the query returns Local Machine.

Unknown said...

Computer devices in the network configuration like PCs, printers, scanners and other machines are assigned with IP addresses. UK IP Restriction

SATEESH said...

i am unable to run this query in my sql, What are the permissions to perform this action.

Muhammad Hassan said...

Excellent website! I adore how it is easy on my eyes it is. I am questioning how I might be notified whenever a new post has been made. Looking for more new updates. Have a great day! 192.168

mark johnson said...

Much obliged to you again for all the learning you distribute,Good post. I was exceptionally intrigued by the article, it's entirely rousing I ought to concede. I like going by you site since I generally run over fascinating articles like this one.Great Job, I enormously acknowledge that.Do Keep sharing! Respects, check my ip address

markson said...

In the time of 2012 Gartner had anticipated that employment opportunities in Business Analytics and Data Scientist are surrendering to head toward somewhere in the range of Millions preceding 2015 attract to a nearbyData Analytics Course

vinith said...

Very Informative Article
Data Science Interview Questions

priyanka said...

I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
data analytics course

Post a Comment