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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:59:32+00:00 2026-06-10T20:59:32+00:00

SQL Server 2008R2 Entity Framework 4.x (early version) I recently changed a view within

  • 0
  • SQL Server 2008R2
  • Entity Framework 4.x (early version)

I recently changed a view within a SQL Server 2088 R2 instance so that it now contains some LEFT OUTER JOINS instead of INNER JOINS which causes some fields to contains NULL now. That leaves with a exception that this fields are not allowed to be null cause they are entity keys.

Please note that all files are Entity Keys

Please note that all shown are required to be entity keys and that the image just showing a part of the whole view.

So am I doing anything totally wrong? Is there any fix around or do I have to life with it.

Here’s one of the errors

Error 213 Running transformation: Key Part: ‘WorkStepId’ for type
OrderSummary is not valid. All parts of the key must be non nullable.

  • 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-10T20:59:33+00:00Added an answer on June 10, 2026 at 8:59 pm

    Entity keys are not allowed to be NULL. Entity Framework has to be able to determine the uniqueness of an entity by a combination of one or more keys. I don’t know your exact data circumstance, but there may be a way to work around this requirement, but it’s not very clean.

    A possible workaround is including logic in your view T-SQL to coalesce NULL values to a known “dummy” value. For instance, with your data above, you can set the two NULL values to be -1 on reads. However:

    • You will have to use some sort of validation logic or stored procedure on save to prevent bad data being persisted to the database if you are doing writes.
    • You have to be sure that only one row with two NULL values for WorkStepId and StepStatusId per Id can be returned.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Entity Framework 4 with stored procedures and SQL Server 2008 SP1... When running
ASP.NET MVC, VB.NET, SQL Server 2008 R2, Entity Framework v4 I created a stored
I develop desktop-based WPF-application, that uses SQL Server 2008 R2 Database and ADO.NET Entity
I am using Entity Framework 4.0, C# 4.0, .Net 2010 and SQL Server 2008
Using Entity Framework 4.1 with SQL Server 2008 R2 Express. I have a strongly
I've an .NET app using Entity Framework 4 and SQL Server 2008 R2, where
I using visual studio 2010 and using Entity Framework, and SQL Server 2008 R2.
I am having 2 instances of SQL Server 2008R2 and instance of SQL Server
Using: CR in VS2010, SQL Server 2008R2 I have a SP that returns results
If a SQL Server 2008r2 database were receiving update statements to both a child

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.