none
Linq SQL entity update question RRS feed

  • Question

  • Hi, say I load an SQL database with a huge amount (a million) of a single given entity class . After that I add a column to the entity class and recompile. Now of course the columns in SQL no longer match the columns in the entity class.

    How do I fix that without having to reload the complete database ???

    Thursday, February 24, 2011 7:34 AM

Answers

  • Use the Alter Table SQL-DDL statement to add the column to the table. E.g.: alter table some_table add column new_column nvarchar(200);

     

    If you want to generate SQL-DDL change scripts based on model <=> DB differences, my Visual Studio add-in can do that: http://huagati.com/dbmltools/

     


     
       Cool tools for Linq-to-SQL and Entity Framework 4:
     huagati.com/dbmltools - Visual Studio add-in with loads of new features for the Entity Framework and Linq-to-SQL designers
     huagati.com/L2SProfiler - Runtime SQL query profiler for Linq-to-SQL and Entity Framework v4
    Thursday, February 24, 2011 11:40 AM
    Answerer