Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Get all the tables in the database

Get all the tables in the database

Scheduled Pinned Locked Moved Database
databasehelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ArchaBhandare
    wrote on last edited by
    #1

    Is there a sql query which will help me get the names of all the tables in the database.

    C A B 3 Replies Last reply
    0
    • A ArchaBhandare

      Is there a sql query which will help me get the names of all the tables in the database.

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      SELECT * FROM INFORMATION_SCHEMA.TABLES


      Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

      1 Reply Last reply
      0
      • A ArchaBhandare

        Is there a sql query which will help me get the names of all the tables in the database.

        A Offline
        A Offline
        Aaron VanWieren
        wrote on last edited by
        #3

        If you are doing it from code you could use the GetSchema("Databases") command off of the sqlconnection.

        _____________________________________________________________________ Our developers never release code. Rather, it tends to escape, pillaging the countryside all around. The Enlightenment Project (paraphrased comment) Visit Me at GISDevCafe

        1 Reply Last reply
        0
        • A ArchaBhandare

          Is there a sql query which will help me get the names of all the tables in the database.

          B Offline
          B Offline
          Balagurunathan S
          wrote on last edited by
          #4

          Hi.. Try the following query.. select * from sysobjects where xtype='u'

          Balaguru

          A 1 Reply Last reply
          0
          • B Balagurunathan S

            Hi.. Try the following query.. select * from sysobjects where xtype='u'

            Balaguru

            A Offline
            A Offline
            ArchaBhandare
            wrote on last edited by
            #5

            Nothing is working. My db name is siebeldb and presently there is only 1 table in it, namely 'orders'. But knowing that siebeldb is the database, how do I get the names of the tables it contains. Also when I know a table, how do I get the fieldnames and fieldtypes in the table.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups