Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reference box on where sql server is running
Message
 
À
20/01/2011 21:15:34
Information générale
Forum:
ASP.NET
Catégorie:
Installation et Configuration
Versions des environnements
Environment:
VB 9.0
Divers
Thread ID:
01496802
Message ID:
01496893
Vues:
39
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform