Results 1 to 3 of 3

Thread: Listing all databases on a SQL Server machine

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 1999
    Location
    Warner Robins, GA
    Posts
    37

    Post

    Anyone know how to retrieve the listing of all the databases available on a SQL Server machine thru code? I would like the user to enter the name of the server and display all the databases available. Very similar to what happens when you are setting up a connection the a particular DB. Thanks!

    Matt

  2. #2
    Lively Member
    Join Date
    Dec 1999
    Location
    Karlsruhe, Germany
    Posts
    122

    Post

    Hi,

    Code:
    select * from master..sysdatabases
    Roger

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 1999
    Location
    Warner Robins, GA
    Posts
    37

    Post

    Thanks for the help...

    I found a different solution in case anyone runs across the same problem. I used the OpenSchema method on the connection object after I opened a connection but didn't specify the initial catalog. There is alot of good information you can get from that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width