MSSQL Update Database From Model

3 posts, 0 answers
  1. Ryan
    Ryan avatar
    8 posts
    Member since:
    Jun 2012

    Posted 06 Nov 2013 Link to this post


    I am using the latest open access connection to a MSSQL server. Is the update database from model wizard supposed to try to recreate the whole database every time it is run? I was under the impression that if I added a field to the table, it would only generate a script to alter the table to add that column, rather than recreate the whole table. If I run the update database wizard and create the whole database and then open the wizard again it wants to recreate all the tables again, shouldn't it show that there are no changes to be made? The second time I run the wizard it shows <null> or<empty> in the "Old value" column for every single row in the select changes grid.


  2. Ryan
    Ryan avatar
    8 posts
    Member since:
    Jun 2012

    Posted 06 Nov 2013 Link to this post

    Looks like I have managed to sort of work out how to fix it. If I initially create the database from the model and then delete all the tables from open access and then update the model from the database, things start working as expected.
  3. DevCraft banner
  4. Kristian Nikolov
    Kristian Nikolov avatar
    206 posts

    Posted 08 Nov 2013 Link to this post

    Hello Ryan,

    When using the Update Database from Model wizard, you have two options - Create Database and Migrate Database.

    When using the Create Database option, OpenAccess ORM will generate DDL script which will attempt to create the entire database schema based on the model you have.

    When using the Migrate Database option OpenAccess ORM will update an already existing database. The generated DDL script will only reflect the changes made to your model as compared to the underlying database. When using this option you can select which entities will be used to update the database. For more information about handling changes to the model please refer to this documentation article.

    I hope this helps. If you have any more questions, do not hesitate to contact us via our Ticket System or post in our forums again.

    Kristian Nikolov
    OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Back to Top