Renaming and refactoring tables in physical data models

When you rename tables in physical data models by using the refactoring feature in this product, you also can update view references and related object names automatically.

Before you begin

You must have a physical data model stored in a data design project.

About this task

If you choose to update view references, you can make the following choices about updating their SQL expressions:
  • Whether to search for views within only the schema or within the entire model of the renamed table.
  • Whether to perform a case-sensitive search for the original table name.
If you choose to update related object names, you can make the following choices about updating their SQL expressions:
  • Which related objects should be renamed. For example, you can choose to rename related indexes, primary keys, or foreign keys.
  • Whether to search for related objects within the table, the schema, or within the entire model of the renamed table.
  • Whether to perform a case-sensitive search for the original table name.

In addition to this method, you can also rename tables by highlighting a table object in a physical data model and pressing F2, either from the Data Project Explorer or from a data diagram. However, if you use the F2 method, view objects are not automatically updated. Therefore, the approach that is described in this topic is the preferred method for renaming tables.

Procedure

To rename and refactor a table in a physical data model:

  1. In the Data Project Explorer, expand a physical data model and right-click a table.
  2. Select Refactor > Rename. The Rename Table wizard opens.
  3. Complete the steps of the wizard. To see information about the fields in the wizard, press F1.
  4. Click Finish.

Results

The table is renamed, and any views that reference the table or related object names are also updated, if you specified these options. The changes are visible in the Data Project Explorer and in data diagrams that contain these objects.

Feedback