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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:49:21+00:00 2026-05-23T11:49:21+00:00

.NET 4.0 with SQL Server 2008 R2. I am trying to represent a 0..1

  • 0

.NET 4.0 with SQL Server 2008 R2. I am trying to represent a 0..1 to 0..1 relationship and I keep getting the following error:

Error 113: Multiplicity conflicts with the referential constraint in Role ‘{0}’ in relationship ‘{1}’. Because all of the properties in Dependent Role are non-nullable, multiplicity of the Principal Role must be ‘1’.

I get this message even when the properties in the dependent entity are nullable. Is it possible to represent this relationship in Entity Framework?

An example of when this might occur (independently of whether it is good database design to do so) is when you have a request that exists by itself, a result that becomes associated with it once the request is completed, and when the request is eventually pruned but the results all remain.

  • 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-23T11:49:21+00:00Added an answer on May 23, 2026 at 11:49 am

    No it is not possible and I doubt it works in SQL server. Database relation requires that one end becomes dependent. It means that it references primary key (PK) of a principal end – we call this foreign key (FK). If we talk about one-to-one relation the FK must be marked as unique so that only one record in the dependent table can reference a given record from the principal table. The only valid relation in this case is 0..1 – 1 where principal can exist without dependent but the dependent can exist only when related to existing principal because its FK value must be set to PK value of the principal. Theoretically FK can be nullable but it depends on the way how database implements unique constraints. If the database counts null as another unique value only one dependent record can have FK set to null (I think this is a case of SQL server).

    In EF this is even more complicated because EF doesn’t support unique constraints and because of that you can build one-to-one relation only when FK in dependent entity is also its PK (= no way to set it to null). If you cannot set FK to null you cannot have it nullable and because of that principal entity must exists otherwise the referential integrity will throw error.

    The best solution for you is considering Request as principal entity and Result as dependent. Request must be created first and it must be kept in the database as long as the Result. Result must have same PK value (the column cannot be auto incremented) as the corresponding Request (and PK must be FK to Request).

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

Sidebar

Related Questions

I am working with C#.net and also SQL Server 2008. I have the following
I am using SQL Server 2008 in a asp.net/c# program. I am trying to
I am trying to store a .Net TimeSpan in SQL server 2008 R2. EF
If I am using .Net and SQL Server 2008, what is the best way
I am using VSTS 2008 + C# + ADO.Net + SQL Server 2008. My
I am running windows server with asp.net websites and sql server 2008 and IIS
Does SQL Server 2008 ship with the .NET 3.5 CLR, so that stored procedures
Is there any API SQL Server 2008 offers for .net application to create and
I am using VSTS 2008 + C# + .Net 3.5 + SQL Server 2008
I have an asp.net web application written in C# using a SQL Server 2008

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.