Learn more about Toad for SQL Server Find solutions and downloads at the |
Toad for SQL Server 6.6 |
Toad Views give you a convenient way to save and reuse SQL queries. In addition to saving your queries in Toad like SQL Recall, Toad Views allow you to more-easily work with, customize, and organize your queries. Use Toad Views to save long and complex SQL to use as a starting point for querying. Or create your own "personal" database views to query against. This can be especially useful if you can't create your own views in the database itself. In addition, you can use Toad Views to save queries to reuse on different databases, such as on a development and a production database.
You can select a SQL query from the Editor, the Query Builder, or the SQL Recall pane and save it as a Toad View. The views are stored in Toad and accessed through the Toad Views manager. You can use the Toad Views manager to organize your views into folders, to create new views, and to modify current views.
To open the Toad Views manager
» | Select View | Toad Views. |
- Select a Toad View to display the view's SQL statement and the connection information.
To save SQL as a Toad View
Do one of the following:
Enter a name for the Toad View.
Note: To open the Toad Views manager after saving, select the Open Toad View Manger option.
To create a Toad View from the Toad Views manager
To use a Toad View
» | In the Toad Views Manager, do one of the following: |
- To add a Toad View to the Editor, double-click the view.
- To add a Toad View to a Query Builder, drag the view to the Query Builder Diagram window.
Note: If the active window is not an Editor, double-clicking a view in the Toad Views manager opens a new Editor window containing the view.
Tip: Unlike code snippets, Toad Views contents are not pasted in the Editor. Toad View name in the curly brackets is replaced with view contents only during script execution. That means you can update Toad View any time without affecting script in the Editor.
Toad Views and bind variables
Toad Views are different than normal views in that Toad Views can contain bind variables. If you execute a Toad View that contains a bind variable, Toad will prompt you for a value.
Note: Toad allows you to store values for bind variables. Click in the Toad Views toolbar to open the Bind Variable dialog where you can manage your variable/value combinations. See Using Bind Variables for more information.
Consideration | Description |
Using aliases in Toad Views | If you use an alias name in a Toad View, you cannot use the same alias name in the parent query. |
Tips: