Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7514251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:26:28+00:00 2026-05-30T00:26:28+00:00

I was trying to create a table that has a one to many relationships.

  • 0

I was trying to create a table that has a one to many relationships. but it seems that adding a foreign key in Personal is not working. I am trying to link a Personal Information table to a address table? what is the solution for this error?

  • Address table saved successfully
  • Personal table

Unable to create relationship ‘FK_Personal_Address’.
Cascading foreign key ‘FK_Personal_Address’ cannot be created where the
referencing column ‘Personal.ID’ is an identity column. Could not
create constraint. See previous errors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:26:29+00:00Added an answer on May 30, 2026 at 12:26 am

    The primary key in the Person table is presumably an identity. This is an auto-incrementing integer field.

    You need to make the foreign key in the address table of type int, not identity. It will hold integers which correspond to Person records, but you don’t want the foreign key to auto-increment. For each record in the child table (address) you will set a specific value for the foreign key indicating to which parent record (Person) it belongs.

    Example:

    INSERT person (firstname, lastname) VALUES ('John', 'Smith')
    

    This will insert the new person record and the field personid will be filled automatically because it is an IDENTITYfield.

    Now to insert an address from John Smith you need to know his personid. For example:

    -- Say, for example, personid of John Smith is 55
    INSERT address (personid, street, city) VALUES (55, 'High Street', 'London')
    

    So in the person table the personid is generated automatically but in the address table you specify the value that matches an existing person. That’s the whole point of a foreign key.

    Without more information about your schema it’s hard to guess the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a column in a table that's a foreign key,
I'm trying to create a Users table that only has OpenId registrations, exactly like
I am trying to create a template that will put items in a table.
Im trying to create an ajax (post) event that will populate a table in
I'm trying to create a <table> that doesn't exceed a certain width (let's say
I'm trying to create a table with two columns comprising the primary key in
I am trying to create a table though prepare statement but it is giving
I am trying to create a JTable that has a row header that looks
I'm trying to create some sort of many-to-one association. The basic premise is a
I'm using Entity Framework 4.1 and trying to create a one-to-many relationship. In my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.