SQL Server 2005 - relationships

  • Hello,

    I built a ER using erwin and deploy it to sql server 2005, everything went well, but my question is

    wich way I know if the relationships (parent and child) are there?

    I'm little lost on that, please somebody can answer that...thanks

  • You can get this information from the INFORMATION_SCHEMA.TABLE_CONSTRAINTS and INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS views.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • DO I NEED TO CREATE A DIAGRAM?

  • You don't need to create a diagram, but you can if you want to visualize what was created on the database. If you want to use the GUI to check for foreign key constraints, first, connect to the right server. Make sure you can see the Object Explorer window. Expand the "Databases" list. Expand the database that you're interested in. Expand the "Tables" list in that database. Then expand one of the tables. Expand the "Keys" list and you'll see the primary and foreign keys that define the parent and child relationships. All done.

    Much easier to run the query as defined above.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply