Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

List of SQL Servers in network

271 views
Skip to first unread message

Johan Thijsen

unread,
Sep 28, 1999, 3:00:00 AM9/28/99
to
Hi,

Does anyone know how you can get a list of all the SQL Server's in the
network?

You have something similar if you want to register a server in the
enterprice manager.

Thanks in advance,

Johan Thijsen.

Andy Barshinger

unread,
Sep 28, 1999, 3:00:00 AM9/28/99
to
Hi Johan,

You can use DMO to get a list of the SQL Servers. You can use the
Application object's ListAvailableSQLServers().
This will return a NameList object that you can iterate through to get all
the servers on the network.

Andy
Johan Thijsen <jthi...@rug.be> wrote in message
news:u3ELpYcC$GA....@cppssbbsa02.microsoft.com...

Darren Green

unread,
Sep 28, 1999, 3:00:00 AM9/28/99
to
This code come straight from another current posting, I take no credit -

To enumerate all network-visible SQL servers using SQL-DMO objects,
create a
new standard EXE project and add a reference to sqldmo.rll. This file
can be
found in \Binn\Resources\1033\sqldmo.rll under the SqlServer70
directory.
Now add this code and declaration in your form's code:

Private Function GetAllSqlServerCollection(colSqlServers As Collection)
As
Boolean
Dim intIndex As Integer
Dim oApplication As SQLDMO.Application
Dim oNameList As SQLDMO.NameList

Set oApplication = New Application
With oApplication
Set oNameList = .ListAvailableSQLServers
With oNameList
For intIndex = 1 To .Count
colSqlServers.Add (oNameList.Item(intIndex))
Next
End With
End With
Set oApplication = Nothing
GetAllSqlServerCollection = True
End Function

This code quickly fetches a list of SQL servers and can be put inside a
combo box's drop-down event to always get a refreshed list of SQL
servers on
your form.

In article <u3ELpYcC$GA....@cppssbbsa02.microsoft.com>, Johan Thijsen
<jthi...@rug.be> writes


>Hi,
>
>Does anyone know how you can get a list of all the SQL Server's in the
>network?
>
>You have something similar if you want to register a server in the
>enterprice manager.
>
>Thanks in advance,
>
>Johan Thijsen.
>
>

--
Darren Green
SQL/DTS - http://www.swynk.com/friends/green/

Johan Thijsen

unread,
Sep 30, 1999, 3:00:00 AM9/30/99
to
Hi Andy,

Thanks, this is just what I need.

I still have a small question. Our NT domain struncture is a single master
domain:

Master Domain
|-------------- -----------------|
Domain1 Domain2

The SQL Servers are located in Domain1 and Domain2. So If I capture the
list of network-visible SQL Servers, I only get the ones in the domain I'm
sitting in.
If I'm in domain2, I can perfectly register (in the enterprice manager for
instance) a server in Domain1 by typing in its name, so there is no matter
of security problem.

Do you know how I can get also a list the servers of the other domain? (I
know offcourse the name of the domain)

Best wishes,
Johan.

Andy Barshinger <Andy.Ba...@wonderware.com> wrote in message
news:#nyRcjeC$GA.230@cppssbbsa05...


> Hi Johan,
>
> You can use DMO to get a list of the SQL Servers. You can use the
> Application object's ListAvailableSQLServers().
> This will return a NameList object that you can iterate through to get all
> the servers on the network.
>
> Andy
> Johan Thijsen <jthi...@rug.be> wrote in message
> news:u3ELpYcC$GA....@cppssbbsa02.microsoft.com...

Johan Thijsen

unread,
Sep 30, 1999, 3:00:00 AM9/30/99
to
Hi Darren,

Thanks, this is just what I need.

I still have a small question. Our NT domain struncture is a single master
domain:

Master Domain
|-------------- -----------------|
Domain1 Domain2

The SQL Servers are located in Domain1 and Domain2. So If I capture the
list of network-visible SQL Servers, I only get the ones in the domain I'm
sitting in.
If I'm in domain2, I can perfectly register (in the enterprice manager for
instance) a server in Domain1 by typing in its name, so there is no matter
of security problem.

Do you know how I can get also a list the servers of the other domain? (I
know offcourse the name of the domain)

Best wishes,
Johan.


Darren Green <dgr...@shortie.demon.co.uk> wrote in message
news:sdJV6GA7...@shortie.demon.co.uk...

> >Hi,
> >
> >Does anyone know how you can get a list of all the SQL Server's in the
> >network?
> >
> >You have something similar if you want to register a server in the
> >enterprice manager.
> >
> >Thanks in advance,
> >
> >Johan Thijsen.
> >
> >
>

silv...@gte.net

unread,
Oct 4, 1999, 3:00:00 AM10/4/99
to
In article <sdJV6GA7...@shortie.demon.co.uk>,

--

Darren,

Do you know how to do this from DMO in SQL 6.5? The
ListAvailableSQLServers method does not exist in this version.

Thanks,

--Sil
-Sil Zendejas


Sent via Deja.com http://www.deja.com/
Before you buy.

Darren Green

unread,
Oct 4, 1999, 3:00:00 AM10/4/99
to
Johan,

I have no idea how to talk across domains as I only have the one. I'm
guessing it must have something to do with trust relationships between
the domains.


In article <eFhXsxxC$GA.254@cppssbbsa03>, Johan Thijsen
<jthi...@rug.be> writes


>Hi Darren,
>
>Thanks, this is just what I need.
>
>I still have a small question. Our NT domain struncture is a single master
>domain:
>
> Master Domain
> |-------------- -----------------|
> Domain1 Domain2
>
>The SQL Servers are located in Domain1 and Domain2. So If I capture the
>list of network-visible SQL Servers, I only get the ones in the domain I'm
>sitting in.
>If I'm in domain2, I can perfectly register (in the enterprice manager for
>instance) a server in Domain1 by typing in its name, so there is no matter
>of security problem.
>
>Do you know how I can get also a list the servers of the other domain? (I
>know offcourse the name of the domain)
>
>Best wishes,
>Johan.
>
>
>Darren Green <dgr...@shortie.demon.co.uk> wrote in message
>news:sdJV6GA7...@shortie.demon.co.uk...

Gert Drapers

unread,
Oct 9, 1999, 3:00:00 AM10/9/99
to
This is not possible using DMO, only using the old LAN Manager API
NetServerEnum passing in a SV_TYPE_SQLSERVER and a domain.
-GertD

0 new messages