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. Database schema

Database schema

Scheduled Pinned Locked Moved Database
databasecsharpsql-serversysadminxml
3 Posts 2 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.
  • U Offline
    U Offline
    User 16796
    wrote on last edited by
    #1

    Hi all, In my .NET application i want to read the sql server database schema(Table names,triggers attached to tables etc). Once user selects the database (sql server) to connect to, i will open the connection and show to user list of tables available in the database. Is there any way of reading the database schema after opening connection to the database. Thanks in advance, Tushar Mahajan.

    C 1 Reply Last reply
    0
    • U User 16796

      Hi all, In my .NET application i want to read the sql server database schema(Table names,triggers attached to tables etc). Once user selects the database (sql server) to connect to, i will open the connection and show to user list of tables available in the database. Is there any way of reading the database schema after opening connection to the database. Thanks in advance, Tushar Mahajan.

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

      The query you need to run is:

      SELECT *
      FROM INFORMATION_SCHEMA.TABLES
      WHERE TABLE_TYPE='BASE TABLE'


      My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

      U 1 Reply Last reply
      0
      • C Colin Angus Mackay

        The query you need to run is:

        SELECT *
        FROM INFORMATION_SCHEMA.TABLES
        WHERE TABLE_TYPE='BASE TABLE'


        My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

        U Offline
        U Offline
        User 16796
        wrote on last edited by
        #3

        Thanks Colin it is returning all Table Names. For triggers i am executing 'sp_helptrigger' stored procedure with table Name as a parameter.It returns all the triggers and their types for that table. Thanks, Tushar Mahajan.

        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