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]
 FROM SYS.DM_EXEC_CONNECTIONS 
 WHERE SESSION_ID = @@SPID

47 comments:

Kay bee said...

Thnx a lot.. god bless...

thongchai.jindatam said...

SELECT CLIENT_NET_ADDRESS AS [IP Address Of Client]
FROM SYS.DM_EXEC_CONNECTIONS
WHERE SESSION_ID = @@SPID


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

Anonymous 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

dataexpert said...

This is exactly the information I'm looking for, I couldn't have asked for a simpler read with great tips like this... Thanks! ExcelR Data Analytics Courses In Pune

ek said...

Know more about Data Analytics
Cool stuff you have, and you keep overhaul every one of us.

priyash said...

wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. keep it up.
data analytics course in Bangalore

priyash said...

wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. keep it up.
data analytics course in Bangalore

priyash said...

wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
Data Science Course

priyash said...

Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
Correlation vs Covariance
Simple linear regression

priyanka said...

Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
Correlation vs Covariance
Simple linear regression
data science interview questions

datasciencecourse said...

After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article.

Simple Linear Regression

Correlation vs Covariance

360digitmgas said...

Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. best software training

Robert Beauty said...

I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day!192.168.1.254

priyanka said...

Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
Simple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Logistic Regression explained

priyanka said...

Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
Simple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Logistic Regression explained

priyanka said...

Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
Simple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Logistic Regression explained

priyanka said...

very well explained .I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
Simple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Logistic Regression explained

priyanka said...

very well explained .I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
Simple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Logistic Regression explained

Unknown said...

Great Article Artificial Intelligence Projects

Project Center in Chennai

JavaScript Training in Chennai

JavaScript Training in Chennai

Mike Johnson said...

I like to post tiktok video about code and buy tiktok likes from this site https://soclikes.com/buy-tiktok-likes

Huongkv said...

Aivivu vé máy bay giá rẻ

vé máy bay tết

Vé máy bay đi Mỹ

vé máy bay Việt Nam đi Pháp

vé máy bay 1 chiều đi hàn quốc

giá vé máy bay đi osaka nhật bản

giá vé máy bay từ Hà Nội đi Anh

arshiya said...

Awesome article, I really enjoyed reading your blog. This is truly a great read for me.
what is keyword stuffing in seo
machine learning scope
angularjs plugins
rpa software
angularjs interview questions and answers
angularjs interview questions for freshers

Farhan.Jee said...

The python programming language is a modern web programming language that was originally conceived and developed by Guido van Rossum in the 1980s. Since that time, Python has evolved into a high-performance programming language that is modular and extensible. data science course in india

saketh321 said...

I enjoy it for creating the details, keep up the truly amazing perform continuing ExcelR Data Analytics Courses

Thanga malar said...

Nice post and this is very helpful to develop my skills. Thank you...
WordPress Training in Chennai
WordPress Course in Chennai
HTML5 Training in Chennai

saketh321 said...

Thanks for the informative and helpful post, obviously in your blog everything is good.. ExcelR Data Analyst Course

borav said...

Welcome! Exceptionally supportive counsel inside this article! It is the little changes that produce the biggest changes. Much obliged for sharing!
liveskye

Datascience Course Analyst said...

Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
Data Science Course in Bangalore

aivivubooking1 said...

Mua vé máy bay tại Aivivu, tham khảo

vé máy bay đi Mỹ giá bao nhiêu

lịch bay từ california về việt nam

giá vé máy bay từ anh về việt nam

chuyến bay từ paris về hà nội

Datascience Books said...

Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
Data Science Training in Bangalore

AI said...

ExcelR provides Data Analytics courses. It is a great platform for those who want to learn and become a Data Analytics course. Students are tutored by professionals who have a degree in a particular topic. It is a great opportunity to learn and grow.


Data Analytics courses

InstituteBlr said...

I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
data analytics course in bangalore

AI course in pune said...

I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
artificial intelligence course in pune

data analytics books said...

I am a new user of this site, so here I saw several articles and posts published on this site, I am more interested in some of them, hope you will provide more information on these topics in your next articles.
data analytics training in bangalore

Mallela said...

Thanks for posting the best information and the blog is very informative.data science interview questions and answers

Digital Marketing training - 360DigiTMG said...

Highly appreciable regarding the uniqueness of the content. This perhaps makes the readers feels excited to get stick to the subject. Certainly, the learners would thank the blogger to come up with the innovative content which keeps the readers to be up to date to stand by the competition. Once again nice blog keep it up and keep sharing the content as always.
Data Science training

AI Expert said...

I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
artificial intelligence course in pune

Viktoriya said...

The cloud is here to stay. We're at a point where organizations are moving from dabbling in cloud provisioning to making it the backbone of the IT infrastructure. According to "The New IT Normal: Cloudy and Getting Cloudier," by Arthur Cole: salesforce training in noida

Data Analytics Courses in Bangalore said...

I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
data science in bangalore

360DigiTMG said...

nice blog!! i hope you will share a blog on Data Science.
best data science course

Post a Comment

Ads