Revising the FmLib Database Diagram

After the changes described in the preceding sections, the SQL Server™ database diagram for FmLib must be updated to include the new relationships between the new Critique table and existing tables — specifically, the title and borrower tables. The original CML application's FmLib database is described, and the database diagram is shown, in Database Design. The new database diagram should look something like this:

The following procedure describes how you relate the Critique table to the title and borrower tables using the SQL Server Edit Diagram window. This is a task you do by hand, using the SQL Server Enterprise Manager.

To update the database diagram

  1. Start the SQL Server Enterprise Manager.
  2. Expand the FmLib folder.
  3. Expand the Diagrams folder.
  4. Double-click the icon that appears in the details pane to open the previous version of the diagram.
  5. Add the Critique table to the diagram. Right-click the mouse or click Add Table on the toolbar, select Critique from the list box, and click Add. Click Close to close the dialog box. The Critique table appears in the diagram.
  6. Relate the Critique table to the title and borrower tables, keeping in mind that the title and borrower tables have a one-to-many relationship with the Critique table. Select the bib# from the title table and drop it on the Critique table to create the relationship. Repeat for the borrower table using the borrower#. You can also define the foreign key constraints using SQL scripts.

Important  The title table is enabled for full-text search and you need to remove the full-text index on the table before you can create the foreign key constraint between the title and the Critique tables. When a table is enabled for full-text search, the full-text index must be dropped before you can add, delete, or modify table columns or relationships. After making these changes, you can re-add full-text indexes by following the steps (starting with step 3) in the "Getting the CML Database Ready for Full-Text Search" procedure in the CML and Full-Text Search topic.