Avatar of MARIO LOPEZ
MARIO LOPEZ
Flag for Mexico asked on

What capabilities or configuration are required to run the following code to get the IP from the database server?

select distinct local_net_address as [IP_SQLServer] from sys.dm_exec_connections where session_id = @@SPID

Thanks
Microsoft SQL Server

Avatar of undefined
Last Comment
MARIO LOPEZ

8/22/2022 - Mon
Nitin Sontakke

I am not sure if i understand the question. Do you mean permissions?
MARIO LOPEZ

ASKER
Sorry if I was not clear, I'm running a program in a client-server environment (Delphi-SQL Server-Windows) and I need to get the IP of the database server. I have obtained it through the instruction that I mentioned in my question and it works correctly, but I need to install the solution to different clients in different environments. The question is if I require special permissions on the connection to the server or inside SQL SERVER in order to execute the statement, I am connecting via ODBC. I wish I had no surprises when I installed the clients.
ASKER CERTIFIED SOLUTION
Nakul Vachhrajani

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Vitor Montalvão

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
MARIO LOPEZ

ASKER
Thank you very much for your comments Nakul and Vitor
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy