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. I have a column and i need to find in which table this column exists throughout whole DB

I have a column and i need to find in which table this column exists throughout whole DB

Scheduled Pinned Locked Moved Database
database
3 Posts 3 Posters 1 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
    Anandkumar Prajapati
    wrote on last edited by
    #1

    I have a column and i need to find in which table this column exists throughout whole DB Using query

    V J 2 Replies Last reply
    0
    • A Anandkumar Prajapati

      I have a column and i need to find in which table this column exists throughout whole DB Using query

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      The column name is not unique. The column with a particular name may be in every DB table. And BTW, what DBMS are talking about: MS Access, SQL Server, Oracle, PostgrSQL, ...?

      1 Reply Last reply
      0
      • A Anandkumar Prajapati

        I have a column and i need to find in which table this column exists throughout whole DB Using query

        J Offline
        J Offline
        Jorgen Andersson
        wrote on last edited by
        #3

        Assuming Sql Server:

        SELECT SCHEMA_NAME(schema_id) [Schema Name]
        ,t.name AS [Table Name]
        FROM sys.tables AS t
        JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
        WHERE c.name = 'ColumnName'

        Wrong is evil and must be defeated. - Jeff Ello

        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