• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

enumerate databases on a server Oracle, SQL Server, etc.

I would like to know how to enumerate all databases on a given server, whether it be Oracle, SQL Server, Sybase, MySQL, etc.

I'm familiar with SQLDMO for SQL Server.
0
kevinbenedict
Asked:
kevinbenedict
  • 3
  • 2
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
Well, for SQL Server you can use the following query:

     SELECT * FROM master..sysdatabases


I don't think there is a generic way that works across all database servers.
0
 
leonstrykerCommented:
Ther is no generic way to do this.  Each database server has a different way of keeping track of their own databases.  You would have to setup different functions base on the type of database server used.

Leon
0
 
kevinbenedictAuthor Commented:
  "Each database server has a different way of keeping track..."

Does anyone know what those ways are, say of 3 of the common RDBMSes out there? (Oracle, Sybase, MySQL)

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
leonstrykerCommented:

MySQL: show databases;
Sybase and MS-SQL: SELECT name FROM master..sysdatabases

MS SQL Server database is equivalent to an Oracle tablespace. A tablespace is a logical method of storage. A tablespace consists of one or more physical files. A tablespace can have 0 or more schemas (eg a rollback or temp tablesspace doesn't really have a schema).

Oracle: SELECT tablespace_name FROM dba_tablespaces;

Leon
0
 
kevinbenedictAuthor Commented:
Leon,

   you said: "MySQL: show databases;"

Is "show databases" a command I can execute on an ADO Connection and return a recordset?  How would that work to list the databases in code?

Thanks
0
 
leonstrykerCommented:
>>Is "show databases" a command I can execute on an ADO Connection and return a recordset?  

As far as I understand it, Yes.  I have not worked with MySQL myself, but got this from a reliable source.  Of course you should test it.  You can also post this question in the MySQL area and I am sure they will confirm this or suggest a better method.

Leon
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now