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. How to get list of tables in SQL Server

How to get list of tables in SQL Server

Scheduled Pinned Locked Moved Database
databasesql-serversysadmintutorialquestion
6 Posts 5 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.
  • P Offline
    P Offline
    Prashant C
    wrote on last edited by
    #1

    Hi Everyone, How to get the list of table name and tables related to them, in SQL Server Database??? Thanks in advance........... -Prashant :rose:

    P K A 3 Replies Last reply
    0
    • P Prashant C

      Hi Everyone, How to get the list of table name and tables related to them, in SQL Server Database??? Thanks in advance........... -Prashant :rose:

      P Offline
      P Offline
      PrakashBhaskar
      wrote on last edited by
      #2

      select * from sysobjects select * from syscolumns

      Thanks Warm Regards Prakash-B

      1 Reply Last reply
      0
      • P Prashant C

        Hi Everyone, How to get the list of table name and tables related to them, in SQL Server Database??? Thanks in advance........... -Prashant :rose:

        K Offline
        K Offline
        Krish KP
        wrote on last edited by
        #3

        SYSOBJECTS table contains all objects created in a databse SELECT * FROM sysobjects WHERE xtype = 'U' AND uid = user_id() this returns all tables created in the current database by the current user.

        Regards KP

        S 1 Reply Last reply
        0
        • K Krish KP

          SYSOBJECTS table contains all objects created in a databse SELECT * FROM sysobjects WHERE xtype = 'U' AND uid = user_id() this returns all tables created in the current database by the current user.

          Regards KP

          S Offline
          S Offline
          sajjadtx
          wrote on last edited by
          #4

          good answer. more details http://msdn2.microsoft.com/en-us/library/ms177596.aspx

          xpherion

          K 1 Reply Last reply
          0
          • S sajjadtx

            good answer. more details http://msdn2.microsoft.com/en-us/library/ms177596.aspx

            xpherion

            K Offline
            K Offline
            Krish KP
            wrote on last edited by
            #5

            Thank you. The URL is very usefull for me.

            Regards KP

            1 Reply Last reply
            0
            • P Prashant C

              Hi Everyone, How to get the list of table name and tables related to them, in SQL Server Database??? Thanks in advance........... -Prashant :rose:

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

              You should also look at getschema("Tables"). This is an Ado method introduced in 2.0 to eliminate the need to query the system tables.

              _____________________________________________________________________ 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
              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