Enumarate through Servers and Databases
Hi everybody,
Does anyone know how to enumarate through all DBMS Servers and Databases.
I need to see all available SQL Server servers and databases on each server.
Is there any api function that does that.
Thanks
[234 byte] By [
Mike] at [2007-11-10 0:20:13]

# 1 Re: Enumarate through Servers and Databases
Mike,
Check out the NetServerEnum API call - it will give you the servers.
As for the database info, look into the sysdatabases table in the master
database of each server.
Mike wrote in message <38d24204$1@news.dev-archive.com>...
>
>Hi everybody,
>Does anyone know how to enumarate through all DBMS Servers and Databases.
>I need to see all available SQL Server servers and databases on each
server.
>Is there any api function that does that.
>
>Thanks
# 2 Re: Enumarate through Servers and Databases
Mike,
Check out the NetServerEnum API call - it will give you the servers.
As for the database info, look into the sysdatabases table in the master
database of each server.
Mike wrote in message <38d24204$1@news.dev-archive.com>...
>
>Hi everybody,
>Does anyone know how to enumarate through all DBMS Servers and Databases.
>I need to see all available SQL Server servers and databases on each
server.
>Is there any api function that does that.
>
>Thanks
# 3 Re: Enumarate through Servers and Databases
Set a reference in your VB project to SQL-DMO objects. DMO will easily
allow you to enum servers,dbs,tables,columns,...etc. There's even a demo
provided if you've installed Sql 7 client tools. For example, on my machine
it's at:
C:\MSSQL7\DevTools\Samples\sqldmo\vb\explore
"Mike" <MikeSan@mail.com> wrote in message news:38d24204$1@news.dev-archive.com...
>
> Hi everybody,
> Does anyone know how to enumarate through all DBMS Servers and Databases.
> I need to see all available SQL Server servers and databases on each
server.
> Is there any api function that does that.
>
> Thanks
# 4 Re: Enumarate through Servers and Databases
Set a reference in your VB project to SQL-DMO objects. DMO will easily
allow you to enum servers,dbs,tables,columns,...etc. There's even a demo
provided if you've installed Sql 7 client tools. For example, on my machine
it's at:
C:\MSSQL7\DevTools\Samples\sqldmo\vb\explore
"Mike" <MikeSan@mail.com> wrote in message news:38d24204$1@news.dev-archive.com...
>
> Hi everybody,
> Does anyone know how to enumarate through all DBMS Servers and Databases.
> I need to see all available SQL Server servers and databases on each
server.
> Is there any api function that does that.
>
> Thanks