The ip address will be the ip address of the server the sql server was installed. Only use the external ip address when connecting to a remote server that is at another location.
Best idea i come up with to get that info from sql server is using xp cmdshell command to execute command prompt commands from sql.
How to get ip address in sql server 2008. Go to start run and type cmd then click ok. Just populate the server ip port field with the server ip address and the port separated by a comma. When launching amberpos after a database connection failure it will launch into this screen.
Select connectionproperty local net address as ip address of sql server. Resolving machine names from ip address is something your network s dns server does. It will return the ip address of the client system.
Execute the below function and call this function through a stored procedure. Also i commended the client net address and other some information s if you need then uncommand it and execute. Type ping servername where servername is the name of your sql server.
In 2008 and above you can get it from some of the dmv s or from some new when i run the query listed above if shows 192 168 1 1 as the use the attached script to get the ip address of the sql server i used the dmv sys dm exec connections when i pass the session id it will get the ip address of the server by this we can get the ip address of. Where to put the ip address into amberpos. 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.
Use the attached script to get the ip address of the sql server i used the dmv sys dm exec connections when i pass the session id it will get the ip address of the server by this we can get the ip address of the server. I might be wrong but as far as i know sql server can not do what you want. If you know the server name you might be able to ping the server from a command prompt.
Xp cmdshell nbtstat a 10 10 10 10.