Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

client ip address connected to sql server

Posted on 2009-03-31
4
Medium Priority
?
645 Views
Last Modified: 2012-05-06
I have problem to find Current IP address for client computer that have a connection to Specific DataBase Server .I need to find out current client user IP address that I am seeking to find it
,How can I do this by using T-SQL command?
Please write full T-SQL code .
0
Comment
Question by:help_me_programming
  • 2
4 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24032947
please provider the table structure, and the input value/field...
0
 

Author Comment

by:help_me_programming
ID: 24032983
this is a generic question about client ip connection
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 24033207
i see.
you want to look in the master.sys.sessions table (sql 2005+) resp: master.dbo.syssessions (sql 2000), the field hostname will give the computer name (or eventually the ip address).

to resolve the name into a ip address is "not possible" built-in in sql server.
for the current session, the function hostname() returns the info also.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question