Using the object definition box and object tooltips
Published 11 February 2013
SQL Prompt displays object definitions in an object definition box. For example, when you select a table in the suggestions box, the object definition box pops up to show the creation script for that table, and a summary of the object.
- For tables and views, the Summary tab shows the column names and data types.
- For stored procedures and functions, the Summary tab displays parameters and their data types, and for functions the data type that is returned.
- For snippets, the snippet code is shown on the Script tab. The Summary tab is not available for snippets.
- For temporary tables, CTEs and table valued variables, only the Summary tab is available.
To resize the object definition box, drag the resize handle at the bottom left or right corner.
Showing or hiding the object definition box
When you first install SQL Prompt, the object definition box will always be displayed for any suitable object selected in the suggestions box. To turn it off, so that it isn't displayed automatically:
- On the SQL Prompt menu, select Options.
- On the Main > Behavior page of the SQL Prompt Options dialog box (this page is the first page displayed by default), turn off Display object definitions.
You can also increase the time lag before the object definition box is displayed. This may be useful if you don't want it to appear when you are typing code quickly, but you do want to see definitions for certain tables after a slight pause:
Enter the time in milliseconds. 500 milliseconds is the default time.
Copying object definitions
You can copy the information in the object definition box to the clipboard:
- To copy all the information, ensure that there is no text selected, and click Copy.
- To copy part of the information, select the required text, and click Copy.
Using object definition tooltips
When you move the mouse pointer over an object in your query, SQL Prompt displays a tooltip containing the fully qualified object name:
The tooltip also displays the MS_Description extended property for the object, in this case a brief explanation of the table's contents.
If the object name is underlined, you can click it to display the object definition box for the object:
For functions, the tooltip displays the possible parameters for that function.
Using tooltips for more help on system functions and parameters
Move the mouse pointer over a system (built-in) function to display an interactive tooltip. You can click on the tooltip to access the SQL Server online help for that function:
You can move the mouse over the function parameters to display a tooltip specifically listing the valid parameters for this function:
As you enter the parameters, the next expected parameter is highlighted in blue.
Click either type of tooltip to read more about the current function in Books Online:
Showing or hiding tooltips
When you first install SQL Prompt, tooltips are enabled by default. To turn them off:
- On the SQL Prompt menu, select Options.
- On the Main > Behavior page of the SQL Prompt Options dialog box (this page is the first page displayed by default), turn off Objects or Parameters under Tooltips.
Tooltips are displayed for these objects:
- tables
- views
- stored procedures
- databases
- data types
- snippets
- triggers
- local variables (type)
- local parameters (type)
- columns (table name and type)
- built-in functions (function signature)
- user-defined functions (function signature)
Viewing tooltips for aliases
SQL Prompt displays a tooltip when you have created an alias for a table or view. Aliases are identified by the icon in the tooltip:
You can click the tooltip to view the summary of columns in that table or view. Aliases for views are also identified as "Table" in the object tooltip.
Viewing column dependencies
You can use SQL Prompt to view a list of objects that reference a column; this can be useful when you want to modify an object.
To view column dependencies:
- In a SQL Server Management Studio query window, move the mouse pointer over a column in your query.SQL Prompt displays a tooltip containing the fully qualified column name:
- Click the tooltip to display the column definition box:
All objects that reference the selected column are listed.