Results 1 to 5 of 5

Thread: Diagram Editor

  1. #1
    Join Date
    Jul 2002
    Posts
    7

    Unanswered: Diagram Editor

    Hello,

    i just moved over from MS Access to MSSQL.

    when trying to save a relation in the Diagram editor
    between 2 tables i get this error:

    'abbrev' table saved successfully
    'companies' table
    - Unable to create relationship 'FK_companies_abbrev'.
    ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE statement conflicted with COLUMN FOREIGN KEY constraint 'FK_companies_abbrev'. The conflict occurred in database 'intranet', table 'abbrev', column 'id'.

    relation is between companies.id <-> abbrev.company

    both are 4 byte INTs.

    it works fine with the other 4 tables but not for this last one.

    any ideas/clues about what could be wrong?
    and is it usefull to use that diagram or should i redo all the relations just in the query editor everytime it's needed?

    thanks in advance.

    Sorex

  2. #2
    Join Date
    Jul 2002
    Posts
    10
    Are they also both "identity" columns?

    Make sure that you have set the following properties for these columns in their respective tables...

    Identity: YES
    Identity Seed: 1
    Identity Increment: 1

    Also, I would set both of these columns as PRIMARY KEYS in their respective tables, so that they can be relate to each other as FKs.

  3. #3
    Join Date
    Jul 2002
    Posts
    7
    >Are they also both "identity" columns?

    no, the link is between companies.id & abbrev.company (not abbrev.id)

    >Make sure that you have set the following properties for these
    > columns in their respective tables...
    >Identity: YES
    >Identity Seed: 1
    >Identity Increment: 1

    done this for both ID's of the tables.

    i've put a screenshot online to look at what it actually is

    should be on http://users.skynet.be/sky81117/sql.gif

  4. #4
    Join Date
    Jul 2002
    Posts
    7
    what's the use of the diagram anyway?

    when i reopen the things i did yesterday i see the relations but they dissapear when the table content appears.

    so it's a waste of time to use this feature or not?

  5. #5
    Join Date
    Jul 2002
    Posts
    10
    Originally posted by sorex
    what's the use of the diagram anyway?

    when i reopen the things i did yesterday i see the relations but they dissapear when the table content appears.

    so it's a waste of time to use this feature or not?
    The major purpose of the Diagram Editor is providing a visual tool to identify referential integrity within your database. It is the exact same tool as "Relationships" in Access. Yes, you can identify FK constraints by using the "Manage Index" tool for each table, however, I find the Diagram Editor to be quite useful and easy to establish FK constraints and show referential integrity between tables within my database systems.

    The major problem with what you have done so far is within your database schema design. When I said that you should have primary key IDs in your tables, I meant that you needed to specify a current column within the tables and make that the PK, not necessary adding another field. Also, your columns are not normalized across the two tables.

    Why do you have duplicate Company and contact information columns within each table?

    What is the purpose of the abbrev and company tables? How are they supposed to relate to one another?

Posting Permissions

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