how we find the server name using sqlserver2005-Query analyser
find server name using query
Collapse
X
-
Tags: None
-
Check it out ?!
to find machine name by sql qury : select host_name();
to find machine name and ip addrss by c# :
string hostName = Dns.GetHostName ();
listBox1.Items. Add ("Host Name = " + hostName);
//v can also use this
//IPHostEntry local =Dns.GetHostByN ame(hostName);
IPHostEntry local = Dns.GetHostEntr y(hostName);
foreach (IPAddress ipaddress in local.AddressLi st)
{
listBox1.Items. Add ("IPAddress = " + ipaddress.ToStr ing());
}Comment
Comment