This is a migrated thread and some comments may be shown as answers.

MSSQL Update Database From Model

2 Answers 60 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ryan
Top achievements
Rank 1
Ryan asked on 07 Nov 2013, 02:15 AM
Hi,

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.

Thanks,

Ryan

2 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 07 Nov 2013, 02:22 AM
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.
0
Kristian Nikolov
Telerik team
answered on 08 Nov 2013, 01:59 PM
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.

Regards,
Kristian Nikolov
Telerik
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!
Tags
Databases and Data Types
Asked by
Ryan
Top achievements
Rank 1
Answers by
Ryan
Top achievements
Rank 1
Kristian Nikolov
Telerik team
Share this question
or