Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    Puerto Rico
    Posts
    2

    Angry Unanswered: SQL Diagram error

    Hi. I am getting back into working SQL now after a bunch of years and I am having problems with creating relationships with my tables.

    All of the fields are defined the same, to clear that.

    The error message that I am getting is:
    'StaffTable' table saved successfully
    'Billing Data Table 2' table
    - Unable to create relationship 'FK_Billing Data Table 2_StaffTable'.
    ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE statement conflicted with COLUMN FOREIGN KEY constraint 'FK_Billing Data Table 2_StaffTable'. The conflict occurred in database 'HIMS_TRANS_UPDATE', table 'StaffTable', column 'StaffID'.


    Any suggestions.

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    If I am reading this correctly .. you already have a foreign key constraint on the table
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    Mar 2004
    Location
    Puerto Rico
    Posts
    2
    Originally posted by Enigma
    If I am reading this correctly .. you already have a foreign key constraint on the table
    Hi Enigma.

    That is what I can't understand.

    Intentionally, I saved the diagram without defining the foreign key contraints and when I scroll through the data from the forms I created, the relationship between the tables is fine.

    But, when I try to save the Diagram with the contraints defined , I get the error I mentioned above.

    One note I must mention:
    The tables were imported into SQL from Access and the relationship between the tables was established prior to the Import.

    Could it be that, internally, some magic way, the key contraints were maintained during the conversion process from Access to SQL and they just don't reflect graphically in the diagram?

    Is there a way to tell through through querying the master table?

    Ducati

  4. #4
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Try running sp_foreignkeys on involved tables and see whether referenced columns are stated.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

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