SQL statements are stored in the SQL Repository for use in an Index Impact Analysis, an Index Usage Analysis, a Migration Analysis, or a Configuration Analysis. From within the SQL Repository window, you can add a single SQL statement, some or all SQL statements found by the SQL Scanner, and SQL statements that reference specific tables or views. SQL statements can also be added to the SQL Repository from other modules.
To add a single SQL statement
The Add SQL wizard has three pages to selects the options for saving the SQL statement to the SQL Repository.
After making the selections from the three tabs, click OK to save the SQL to the SQL Repository.
The SQL syntax is checked and the query plan retrieved before adding a new node to the SQL tree view with the SQL name. Each SQL statement added to the SQL Repository contains a query plan, SQL classification type (Simple, Complex or Problematic) and the current connection information (login name, server name, database and user). The query plan stored with the SQL statement is important as it indicates the current performance of the SQL.
To add SQL from the SQL Scanner
On the General page of the wizard, select the location to save the SQL statements.
On the SQL Scanner page, select the Groups or Jobs that contain the SQL you want to add.
To add all SQL statements that references a specific table or view
From the SQL Repository window, select SQL | Add SQL by Database Object.
In the Database object pane, select the tables or views that you want the SQL to reference.
Click Extract. The Save SQL to SQL Repository wizard displays.
On the General page, select the location to save the SQL statements.