How to get the name of the MSSQL running server?

JustAGuy
01-08-2004, 06:37 AM
Hi,

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.

Thanks!

rufen101
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.

http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

JustAGuy
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.

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

Look:


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