Results 1 to 2 of 2

Thread: Database/Table List in SQL Server

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    5

    Question

    I was wondering if anyone could tell me how to obtain a list of the available databases on an SQL Server, and also a list of tables inside of a particular database on the SQL Server. I am wanting to add them to a list box so that the user can choose his database and table from a dynamically updated list.

    Any information would be greatly appreciated.

    Thanks,

    Green Onyx

  2. #2
    New Member
    Join Date
    Oct 1999
    Posts
    7
    List of databases (names):
    Connect to "master" database(you must have permission)

    "SELECT name FROM sysdatabases"

    List of tables in database:
    Connect to database

    "SELECT name FROM sysobjects where type='U'"

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