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 7797325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:38:57+00:00 2026-06-01T23:38:57+00:00

Consider we have two tables ProductType and ProductSizeGroup as below ProductType Id Name MaleSizeGroupId

  • 0

Consider we have two tables ProductType and ProductSizeGroup as below

ProductType

Id 
Name
MaleSizeGroupId
FemaleSizeGroupId
ChildSizeGroupId

ProductSizeGroup

Id
Name

Each of MaleSizeGroupId, FemaleSizeGroupId and ChildSizeGroupId fields should be FKs to ProductSizeGroup.Id.

I add one using the following statement:

ALTER TABLE [dbo].[ProductType]  
WITH CHECK ADD CONSTRAINT
    [FK_ProductType_ProductSizeGroup_Male] FOREIGN KEY([MaleGroupId]) 
    REFERENCES [dbo].[ProductSizeGroup] ([Id])

This works fine. I try to add the next using

ALTER TABLE [dbo].[ProductType]
WITH CHECK ADD CONSTRAINT
    [FK_ProductType_ProductSizeGroup_Female] FOREIGN KEY([FemaleGroupId]) 
    REFERENCES [dbo].[ProductSizeGroup] ([Id])

But I get the error:

The ALTER TABLE statement conflicted with the FOREIGN KEY constraint “FK_ProductType_ProductSizeGroup_Female”. The conflict
occurred in database “dbname”, table “dbo.ProductSizeGroup”, column
‘Id’.

So there is conflict.. but what conflict? What should I be looking for?

  • 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-06-01T23:39:00+00:00Added an answer on June 1, 2026 at 11:39 pm

    That just means: there are rows in your table ProductType that have values in the FemaleGroupId column which do not exist in the referenced table (ProductSizeGroup).

    It’s not a problem per se – you can totally have multiple columns going from one table to another.

    The problem is with the existing data – you have data in there that doesn’t live up to that FK constraint. Fix that data and you should be fine.

    To find those offending rows, use a query like this:

    SELECT * 
    FROM [dbo].[ProductType]
    WHERE FemaleGroupId NOT IN (SELECT DISTINCT Id FROM [dbo].[ProductSizeGroup])
    

    That will list all offending rows – update their attribute and get going again!

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

Sidebar

Related Questions

Consider I have two tables, t1 and t2 t1 = (id, name), t2 =
Consider the two following tables. In bold the field name. Below the field name,
Consider that I have two tables. One is Table1 as shown below. One more
I have two tables like so: EventTable (EID, Name, EventTime) VideoTable (VID, StartTime, Video,
I have two tables, each with their own model... class FamilyMan { public int
I have a two tables as follows: product category(t1): id name product master(t2): id
Consider following two tables: tag_names (tag_id, tag_name) tag_links (tag_id, image_id) An image can have
Consider I have two database tables: images and albums . They have these schemas:
Consider the following: I have two tables (Customers and Cases) defined as follows: **Customers**
I have two tables, both with start time and end time fields. I need

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.