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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:11:03+00:00 2026-06-13T12:11:03+00:00

I’m working with EF5 using the model-first approach. I’ve designed the model and executed

  • 0

I’m working with EF5 using the model-first approach. I’ve designed the model and executed the SQL script which generated the corresponding database (using “Generate Database from Model”).

I then had to use UDFs to calculate a couple of column values (which requires dropping and re-adding the columns). I’ve done that in SSMS and then used “Update Model from Database…” to reflect the changes in the model.

Till this point, everything worked great.

But from this point, every time I update the database from the model (as described above), the computed columns are overridden with “standard” columns.

For example, following is an excerpt from the SQL script generated by EF:

-- Creating table 'ShipmentSet'
CREATE TABLE [dbo].[ShipmentSet] (
[Id] int IDENTITY(1,1) NOT NULL,
[Details] nvarchar(128)  NOT NULL,
[BarcodeValue] nvarchar(32)  NOT NULL,
[ExecutionDate] datetime  NOT NULL,
[RouteId] int  NOT NULL,
[IsLocationBarcodeRequired] bit  NOT NULL,
[IsPending] bit  NULL,
[LastAction] tinyint  NULL
);
GO

The two last columns are computed columns, and their StoreGeneratedPattern in the model is defined as Computed.

Is there a way to add the computed column formulas in the model? The SQL script drops the tables then re-creates them, so “ignoring” these columns won’t do.

  • 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-13T12:11:04+00:00Added an answer on June 13, 2026 at 12:11 pm

    I got the following response from Microsoft’s developer center (see full thread here)

    Essentially the answer is that it’s not a bug, it’s simply not supported:

    You can’t mix model-first and database-first. Once you manually modify database you can’t use Generate database from EDMX any more. UDF-based computed columns information are stored in SSDL, CSDL know nothing about it, so everytime you generate the database from EDMX file, the special columns will be generated as regular columns.

    So if you want to use computed columns and UDFs, Database-first is the only choice for you.

    I can’t say I’m satisfied with the answer, as it means EF Model-first is useless for the most of my projects, but that’s just the way things are.

    Any comments are welcome.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I have an autohotkey script which looks up a word in a bilingual dictionary
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the

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.