SQL Prompt 10

Using the object definition box and object tooltips

SQL Prompt shows 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 shown for any suitable object selected in the suggestions box. To turn it off, so that it isn't shown automatically:

  1. On the SQL Prompt menu, select Options.
  2. On the Suggestions > Behavior page of the SQL Prompt Options dialog box (this page is the first page displayed by default), turn off Display object definitions.
If you turn off the object definition box, you can still view the object creation script for any object in your script by moving the mouse pointer over the object name to show a tooltip. Click the tooltip to display the object definition.

Copying object definitions

You can copy information in the object definition box to the clipboard by selecting text and pressing Ctrl + C.

Using object definition tooltips

When you move the mouse pointer over an object in your query, SQL Prompt shows a tooltip containing the fully qualified object name:

The tooltip also shows 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 shows 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:

  1. On the SQL Prompt menu, select Options.
  2. On the Main > Behavior page of the SQL Prompt Options dialog box (this page is the first page shown by default), turn off Objects or Parameters under Tooltips.

Tooltips are shown 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 shows 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:

  1. In a query window, move the mouse pointer over a column in your query. SQL Prompt shows a tooltip containing the fully qualified column name:
  2. Click the tooltip to display the column definition box:

    All objects that reference the selected column are listed.

Didn't find what you were looking for?