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. Sql query find the primary key ,foreign key relationship between tables

Sql query find the primary key ,foreign key relationship between tables

Scheduled Pinned Locked Moved Database
databasetutorial
4 Posts 3 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.
  • R Offline
    R Offline
    Rmesh
    wrote on last edited by
    #1

    How to write query to find relationship between the primary key and foreign key re lation ship between the tables

    P C 2 Replies Last reply
    0
    • R Rmesh

      How to write query to find relationship between the primary key and foreign key re lation ship between the tables

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Elaborate a bit more about your question. What database are you using?

      "Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus

      1 Reply Last reply
      0
      • R Rmesh

        How to write query to find relationship between the primary key and foreign key re lation ship between the tables

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

        Rmesh wrote:

        How to write query to find relationship between the primary key and foreign key re lation ship between the tables

        That depends on the database you are using. In SQL Server there are sys* tables and INFORMATION_SCHEMA views that will allow you to get at this information.


        Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." Ready to Give up - Your help will be much appreciated. My website

        P 1 Reply Last reply
        0
        • C Colin Angus Mackay

          Rmesh wrote:

          How to write query to find relationship between the primary key and foreign key re lation ship between the tables

          That depends on the database you are using. In SQL Server there are sys* tables and INFORMATION_SCHEMA views that will allow you to get at this information.


          Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." Ready to Give up - Your help will be much appreciated. My website

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          Colin Angus Mackay wrote:

          depends on the database you are using

          That is why I asked earlier. easy in SQL, but I am not sure about Access. I've looked at some of the system table and it might be a little more work.

          "Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus

          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