Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reference box on where sql server is running
Message
 
To
20/01/2011 21:15:34
General information
Forum:
ASP.NET
Category:
Installation, Setup and Configuration
Environment versions
Environment:
VB 9.0
Miscellaneous
Thread ID:
01496802
Message ID:
01496893
Views:
38
>Is there a way to programmaticly determine the network address of the box hosting the sql server my app is connected to? ( assuming the connection string is obfuscated within the app ) ?

Charles,

Just guessing here, but assuming you can actually connect to the server, you could use SELECT SERVERPROPERTY('MachineName') AS MachineName to get the computer name of the computer where sql server is running and in a second step converting the computer name to an ip address, for example using WMI

[Update]
This guy created a store procedure to get the IP Address, I did not test it

http://www.sqlmag.com/article/tsql3/dynamically-obtain-a-sql-server-s-ip-address-in-t-sql-code.aspx
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform