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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:40:34+00:00 2026-05-19T02:40:34+00:00

I have an asp.net mvc 2 application with a SQL Server database accessed by

  • 0

I have an asp.net mvc 2 application with a SQL Server database accessed by the Entity Framework ORM. Now I found out I had used the wrong datatype for one of the fields in the database – int instead of double.

Now, this is not a big commercial application, but it is nevertheless already in use internally in my company. It works fine, but the users would need to be able to enter decimal values rather than just integers…

So my question is, can I change the type of the field after the fact so to speak, and not lose the data already entered? Of course I would have to change the references to this field in the model and everything that references it, but is it possible at all without losing the data?

I would appreciate any suggestions for how to go about solving this problem!

  • 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-19T02:40:35+00:00Added an answer on May 19, 2026 at 2:40 am

    Well if you used int instead of decimal the data you have might have already been incorrect and code would even break. You wont lose any data in your case as you are going from int to decimal.Steps you need to take-

    1. Change the column type to decimal. Use alter command.
    2. Delete the table in question and add it back again.
    3. Change all the references in the code to use decimal instead of int.

    You might want to do the database step last in case your stuff is live and being used in that case do it when you upload the changes.

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

Sidebar

Related Questions

I have an ASP.NET MVC 3 application with a SQL Server 2005 database backend.
I have an ASP.Net MVC application and I'm using Forms authentication in SQL Server.
I am implementing a SaaS application using ASP.Net MVC 2 and SQL Server database.
I have an ASP.NET MVC 3 (using Entity Framework 4.2) application that uses transactions
I have an ASP.NET MVC 3 application using an Entity Framework (4.3.1) Code First
I have an ASP.NET MVC Web Application that interacts with a SQL Server 2008
I have just started a new web application with asp.net mvc and sql server
We have a web based (ASP.NET MVC) application that uses SQL Server 2008 for
I have an ASP.NET MVC application that uses Linq to SQL repositories for all
I have an Asp.Net MVC application that works in the vs.net development web server.

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.