Results 1 to 4 of 4

Thread: Get Relations betwwen the tables?

  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Get Relations betwwen the tables?

    i want to write program that will return
    the relations between the tables and its type (one to many,.....etc)
    any help
    Thanks in advance

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    You can query the system catalog get that information. In SQL Server it will be in syscontraints and sysobjects.

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    look at the logic behind sp_helpconstraint.

    use master
    go
    sp_helptext sp_helpconstraint
    go






    example:


    create table mytable (id int identity(1,1) constraint mytable_pk primary key,
    name char(100) constraint mytable_def default ('NoName'))
    go
    sp_helpconstraint mytable
    go

  4. #4
    Join Date
    Dec 2003
    Posts
    2

    Thanks

    Thanks For All
    I will try This Solutions
    Thanks again
    Last edited by Mohammad Al Hus; 12-22-2003 at 05:51 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •