How to get the name of the MSSQL running server?

01-08-2004, 06:37 AM

I am writing an Administration Tool to an application that uses MSDE/SQL-Server.

One of the application instances will be installed in the same PC as the MSDE (local connection), that's ok.

However, the other instances will be installed in remote computers.

To make easier the administrator work, I would like to know if there is a way to get the name of the running server instead to need to type or copy/paste it.


01-08-2004, 06:50 AM
For any information on SQL SERVER information schema, download the SQL SERVER BOOK ONLINE. You should find what your're looking for.

01-08-2004, 06:51 AM
Thanks, pal, but I am looking for something more straight.
I hope that someone could help me with that showing some sample.

Thanks anyway.

01-08-2004, 07:28 AM
Hey, thanks to all!
I wrote a simple sub to list all servers...


Public Sub FindAllSQLServer()
Dim oSQL As New SQLDMO.Application
Dim z As Integer
For z = 1 To oSQL.ServerGroups.Item(1).RegisteredServers.Count
List1.AddItem oSQL.ServerGroups.Item(1).RegisteredServers.Item(z).Name
Next z
End Sub

Thanks anyway, guys!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum