Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003

    Unanswered: How to view constraints...?

    Hi all. I have a SQL Server DB that i need to port out of SQL Server. I do not have a diagram illustrating the constraints in the construct of the tables. What is the best way to for me learn the relationships of the tables in sql server?
    thanks for your help

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    I'd recommend using a tool like ErWin or Visio to construct a diagram.

    If that isn't acceptable, I'd script the entire database using SQL Enterprise Mangler and look for the primary key and foreign key definitions. This is free, but it can take a lot of work.

    If that doesn't work for you, then I'd need to understand why it wasn't acceptable before I could even venture a guess as to what you might want to try next.


  3. #3
    Join Date
    Jan 2003
    Provided Answers: 11
    You can also use sp_helpconstraint 'tablename' to find not only the freign keys on 'tablename', but also the foreign keys that reference 'tablename'.

  4. #4
    Join Date
    Jul 2003
    San Antonio, TX
    Where are you porting your db to? Are you sure that's what you want to do?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

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