Controlling Database Changes Through Database Diagrams

See Also      Tasks

Database diagrams enable you to modify your database objects without updating the database until you explicitly save the changes you’ve made. If you modify a table and remove it from a diagram without saving it or you close your diagram without saving it, the table continues to exist in memory in its modified state until you close the Database Designer.

During an editing session, you have the freedom to experiment with different object definitions to see how a proposed modification will affect the database. When you complete your modifications, you can either save your diagram and thereby update the database to match your diagram, or you can discard it and leave the underlying database unchanged.

In this topic you can read about:

Differentiating Saved from Unsaved Database Changes

Identifying Modified Tables

When you edit a table in a database diagram, an asterisk (*) appears after the table name in the title bar to indicate that the table contains changes that you have not yet saved in the database.

This indicator appears as a result of a change you made to a database object, such as a column or index, in the table or your diagram. When you add a modified table to another open diagram, the table appears there with its unsaved changes and an asterisk in its title bar. When you save the table or the diagram, the asterisk disappears.

Identifying Modified Diagrams

Similarly, an asterisk (*) appears at the end of the diagram name in the title bar to indicate that the diagram contains changes that are not yet saved in the database.

This indicator appears whenever a database object in your diagram has an unsaved change or the diagram layout changed since you last saved it. When you save the diagram, the indicator disappears.

Using Change Scripts to View Unsaved Changes

At any point during your editing session, you can view unsaved changes for your diagram in an SQL change script displayed in the Save Change Script dialog box. If you don’t have security permissions to alter a database, or if you’re not ready to update the database but you want a record of your changes, you can save a change script and apply it to the database at a later time. For information about running change scripts, consult your database documentation.

For more information about change scripts, see Saving a Change Script.