Modifying SQL Documents

You can modify SQL documents, including finding and replacing text.

To modify an SQL document

  1. Right click on the routine, view, trigger, or synonym in the Object Explorer and select Edit from the popup menu.
    The SQL Editor document appears in the Document pane.
  2. Choose File->Open.
    The Open dialog box appears. 
  3. Go to the SQL document file and open the file.
    The SQL Editor document appears in the Document pane.
  4. Right-click in the editor text box and select the appropriate editing commands from the popup menu.
  5. Choose SQL->Check All Syntax to check the SQL statements before you submit them to the database server.
  6. Choose SQL-> Execute All SQL to execute the SQL statements in the selected database.
    The statements are submitted to the database selected in the Database list box of the SQL Editor document.

To find in an SQL document

  1. Choose Edit->Search., the Search toolbar button or the CTRL+F hotkey.
  2. In the Find what text box, type the text that you want to locate.
  3. Check the Match whole word only or the Match case check box to narrow your search.
  4. Click Find Next button (or press the F3 hotkey) to locate subsequent occurrences of the text.
  5. Click Cancel to close the dialog box.

To replace in an SQL document

  1. Choose Edit->Replace, the Replace toolbar button or the CTRL+R hotkey.
  2. In the Find what text box, type the text that you want to locate.
  3. Check the Match whole word only or the Match case check box to narrow your search.
  4. Type the new text in the Replace with text box.
  5. Click Find Next to locate subsequent occurrences of the text.
  6. Click Replace to replace the found text with the new text, or click Replace All to replace all occurrences of the text.
  7. Click Cancel to close the dialog box.

 Tips