I have a logical and a relational model and a running database created by the DDL generated from the relational model. Now I need to modify the logical model in that way that I have to add a "NOT NULL" attribute to an entity. What is the best practice to get the changes into the database?
As far as I can see the DDL creation creates only "create" statements. So the first question is: how can I create "alter" statements?
And the second question is: how do I get the data into the database during the alter statement? The data is necessary to satisfy the constrain of the new column. This means I have to merge the alter statements with the data insertion in one transaction. How to get this done?
you can create alter statements as discussed here:
You can execute an update statement before executing the alter script.