SQL Prompt - 5.0
Learning SQL Prompt - 5.0
Inserting suggestions into your code
SQL Prompt provides SQL code auto-completion using the suggestions box. The suggestions box pops up to display items based on what you type in your query editor. For example, when you type SELECT * FROM, the suggestions box displays a list of tables first, then views, and further down the list, owners, databases, functions, and so on.

The suggestions box is displayed automatically when you type the first character of a keyword or identifier. As you type, the suggestions are filtered to match the typed characters:

To insert the currently highlighted suggestion, press the Tab or Enter key, or any of the defined insertion keys. You can customize which keys insert suggestions. See Setting main behavior options.
Closing the suggestions box
To close the suggestions box without inserting anything, press the Esc key. If nothing is selected in the suggestions box, you can also press the Return or Enter key to close it.
You can also click anywhere in your query window to close the suggestions box.
Order of suggestions
The order in which suggestions are listed depends on the context of your query. For example:
- After typing
USE, databases are listed at the top of the suggestions box. - After typing
SELECT * FROM, tables are listed at the top of the suggestions box, followed by views, schemas and then database names. - In a
CREATE TABLEstatement, after typing a column name, data types are listed at the top of the suggestions box.
Viewing all columns after a SELECT statement
After typing SELECT, SQL Prompt does not by default list all the possible columns from all tables. If you want to see all column names after typing SELECT:
- From the SQL Prompt menu, click Options.
- Go to the Suggestions > Types of suggestion page.
- Select List all database columns after a SELECT statement.
When you type SELECT, all column names will now be displayed in the suggestions box, listed alphabetically:

Only displaying the suggestions box manually
To turn off the automatic display of the suggestions box:
- On the SQL Prompt menu, select Options.
- On the Main > Behaviour page (displayed by default when you first display the SQL Prompt Options dialog box), clear the Automatically trigger suggestions check box.
When automatic display of the suggestions box is turned off, you can press Ctrl + Space bar at any time to display it manually. The type of suggestions displayed will depend on where in the query you display the suggestions box.
Using categories
The suggestions box displays items grouped by category. Categories are a way of organizing suggestions so you can find the item you require more easily:

Only the categories that contain suggestions are available to select.
To switch between categories, click the All Suggestions drop-down or press Ctrl + Up arrow or Ctrl + Down arrow.
The following categories are shown:
|
Tables lists tables from the current database. |
|
Views lists views from the current database |
|
Columns lists column names, with their data types and associated table names (or table aliases). Primary key You can also use the column picker to insert columns. |
|
Functions lists user-defined functions in the current database, and built-in functions. |
|
Stored Procedures lists stored procedures from the current database. |
|
Snippets lists shortcuts for inserting pre-defined SQL fragments or statements. For more information about snippets, see Inserting snippets. |
|
Other Suggestions lists keywords, data types, and objects such as users and roles. |
Object types
You may see the following types of object or suggestion listed in Other Suggestions:
|
DML triggers |
|
Rules |
|
Users |
|
Defaults |
|
Roles |
|
User defined types |
|
Functions |
|
Full text catalogs |
|
System variables |
|
Join suggestions |
|
Linked server objects |
|
|
For SQL Server 2005 and 2008:
|
Assemblies |
|
Queues |
|
Asymmetric keys |
|
Routes |
|
Certificates |
|
Schemas |
|
Contracts |
|
Services |
|
DDL Triggers |
|
Service bindings |
|
Event notifications |
|
Symmetric keys |
|
Message types |
|
Synonyms |
|
Partition functions |
|
XML schema collections |
|
Partition schemes |
|
|
Displaying schema (owner) names
You can display schema (owner) names in the suggestions box by clicking the right arrow
in the bottom left corner of the suggestions box.

The suggestions box is autmomatically widened to allow space for the schema names, shown in grey to the left of the suggestions:

To hide the list of schema (owner) names, click the left arrow
Note: The arrows only affect how object names are displayed in the suggestions box. The schema (owner) name is only inserted into your code when Qualify object names with owner name is selected on the Inserted Code > Qualification options page.
Changing the size of the suggestions box
You can resize the suggestions box by dragging the resize handle
. The new size is remembered the next time the suggestions box is displayed.
The size of the suggestions box is remembered between sessions in SSMS and Visual Studio.
Moving through the list of suggestions
You can move through the list of items in the suggestions box by pressing:
- Up / Down arrow keys to move up or down the list one item at a time
If you are at the top of the list, pressing the UP arrow key takes you to the bottom of the list; if you are at the bottom of the list, pressing the Down arrow key takes you to the top of the list.
- Page Up or Page Down to move up or down the list one page at a time
- Ctrl + Page Up or Ctrl + Page Down to move up or down the list one page at a time
Changing how suggestions are inserted
When you select an item from the suggestions box, SQL Prompt inserts the suggestion according to the options you have set in the Inserted code pages of the Options dialog box:

For example, you can specify how ALTER and INSERT statements are inserted, and whether object names are qualified. For more information, see Customizing inserted code.
Encrypted objects
SQL Prompt can automatically decrypt encrypted objects to show their creation script in the object definition box. (Available in SQL Prompt Pro Edition only)
If you do not have permission to decrypt objects, you can still view them in the suggestions box and insert them into your query.
By default, SQL Prompt will decrypt encrypted objects. To turn this option off:
- On the SQL Prompt menu, select Options.
- Go to the Suggestions > Types of suggestion page.
- Turn off Decrypt encrypted objects.
Expanding SELECT * to insert all columns
When you use a * wildcard in your query, you can expand it to explicitly list all the columns in the table or view.
Press Tab after the * wildcard to insert all the columns. The columns are formatted based on the settings in the Format pages in the Options dialog box.
Was this article helpful?
SQL Prompt
- SSMS failed to load SQL Prompt add-in 80070002
- No SQL Prompt menu appears in Query Analyzer
- SQL Prompt is showing an old version of my stored procedure (version 3)
- Removing menu items after uninstalling SQL Prompt and SQL Refactor
- A newly-created table exists, but it is not visible in the candidate list (version 3)
- Configuring permissions for SQL Prompt
- Using Intellisense or auto complete with a VS Web project (version 3.5)
- Uninstalling the Visual Studio 2005 add-in
- Unable to cast object of type 'System.DBNull' to type 'System.String' (version 3)
- Suggestions to improve performance for pre-formatted SQL (version 3.9)
- Changing the location of the settings, cache files and snippets folders
- Saving SQL Prompt options (version 3)
- SQL 2008 installation fails with Express Tools rule (version 3.8)
- Add-in failing to load into SQL Server Management Studio on Vista
- Removing SQL Server Management Studio Integration after uninstallation
- Layout SQL Error
- Downgrading to SQL prompt 3.9 from 4.0
- Candidate suggestions being displayed slowly
- SQL Prompt is not showing all linked servers
- Log files
- Refreshing the cache
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Prompt
- Activating your products
- Activating your products
- Getting help offline
- Customizing SQL Prompt to write SQL code more efficiently
- SQL Prompt 3.xx - reducing memory usage to improve performance
- Using SQL Prompt 4: tips for SQL Prompt 3 users
- SQL Prompt release notes - version 4.xx
- Release notes - version 5.xx
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Using SQL Prompt
Speeding up your queries