Learn more about Toad for SQL Server
at Dell Software

Find solutions and downloads at the
Toad for SQL Server Support Portal

Toad for SQL Server 6.6

You are here: Edit SQL > About Editing SQL

About Editing SQL

The editor combines a powerful SQL and procedure editor and debugger into a single interface.

Notes:

To edit SQL

  1. Select Tools | Edit.

  2. Review the following to help enter SQL:

  3. Click to format the code. See Format SQL for more information.

  4. Right-click a block of code in the Editor to see additional actions available in the context menu. For example, you can turn a line into comment, uppercase or lowercase it, surround with snippet, set numbered bookmark, collapse or expand nodes, send to Query Builder and etc. You can also right-click an object (e.g. a table) and manage it as if in the Object Explorer.
  5. Select the block of code in the Editor, and click to validate the syntax.

    Note: Toad undoes any changes to the object and data in the database after executing the script (notice that the Result Sets tab is empty). To modify the object and data, you need to execute the script.

  6. Debug code. See About Debugging SQL for more information.

  7. Click to execute SQL on the current server or multiple servers at one time.See Group Execution of Scripts for more information. In the Editor toolbar, the execute SQL buttons are grouped under . The button will retain the function of the last execute action for the active Editor window. If you switch to another Editor window, the button will change to reflect the last action for that window.

  8. To tune SQL, right-click a statement in the Editor and select Advanced | Optimize the Current Statement (available if you purchased a version of Toad that includes the SQL Optimizer). If you have not purchased this version, you can tune the statement by right-clicking it and selecting Advanced | Analyze in Database Engine Tuning Advisor.

  9. Select the block of code in the Editor and click to create a stored procedure. Stored Procedure creation dialog automatically recognizes procedure body and declared parameters.

Tips:

Configure Editor Options

You can specify options for the look and behavior of the SQL Editor by using the Toad Options dialog.

To configure Editor options

  1. Select Tools | Options.
  2. To specify one of the following options, select the corresponding page in the Options dialog.

    Option Description

    Page in Options Dialog

    Display the tabs for the current connection only when using Tabbed windows

    Select Environment | Interface

    Change background color of the Editor Select Editor | General
    Use connection color as background color Select Editor | General
    Position Editor tab headers vertically Select Environment | Interface

    Set options to display line numbers, line modifications, and general text formatting

    Select Editor | General 

    Specify options to automatically replace typed text with the correct substitution text

    Select Editor | Auto-replace

    Customize code formatting options including headers and layout characteristics

    Select Editor | Formatter

 

of