SQL Prompt - 4.0
Learning SQL Prompt - 4.0
Managing connections and memory
SQL Prompt will automatically connect to other databases specified in your query. For example:

In this example, SQL Prompt loads objects from the Northwind database as soon as you type the database name and then continue with your query. For large databases, you may have to wait a few seconds while SQL Prompt loads the objects.
If you do not have permissions to connect to that database, then a message is displayed:

Click Details to see more information about the connection error:

Once you close this message, you can continue to write your query, but no suggestions from that database will appear in the suggestions box.
Note: this message may also be displayed for reasons other than permissions issues, for example, when SQL Prompt doesn't have enough memory to store the objects for this database.
Connecting to different databases in the same session
If you connect to a number of different databases during the same session, SQL Prompt will load all the objects for each database as required, without unloading any of the previously stored objects. This means that you can go back to previous queries and continue to see suggestions for any database to which you have previously connected.
Refreshing suggestions when a database schema changes
If you are writing a query on a database while someone else is making changes to the structure of that database, the suggestions offered by SQL Prompt may become out of date.
For example, if someone has added several tables to the database while you have been connected to that database, these tables will not appear in the suggestions box.
To reload the database objects, on the SQL Prompt 4 menu, select Refresh Suggestions or press Ctrl + Shift + D. Any changes to the database structure will now be reflected in the suggestions box.
You should also refresh suggestions when you have created a new object in the current query, and executed that block of code. For example, if you create a table NewObject and execute the statement, then continue to write the query, the NewObject table will not appear in the suggestions box until you refresh the suggestions.
Notes:
- Refreshing suggestions applies only to the database to which you are currently connected.
- SQL Prompt automatically refreshes a database's objects when you close down your query editor application, then re-open it and re-connect to that database.
Managing the SQL Prompt memory
SQL Prompt loads database objects into its memory whenever you connect to a database in SQL Server Management Studio or Visual Studio, in order to display suggestions from that database. For databases with large schemas, a progress dialog may be displayed while SQL Prompt loads the objects into memory:

If you connect to several databases with large schemas, this may eventually result in SQL Prompt running out of memory. In this case, a warning message will be displayed.
If this message is displayed, you can clear the SQL Prompt memory by clicking Unload All Databases. SQL Prompt will load each database's objects as required.
If you close the message, you can continue to write your query, but no objects from that database will appear in the suggestions box.
Clearing the SQL Prompt memory
To clear the SQL Prompt memory at any time, close your editor application. This unloads all objects from all databases from memory.
Connecting to a linked server
Linked server objects for the current instance are displayed in the suggestions box:

When you select a linked server, SQL Prompt 4 attempts to connect automatically to that server, using the mapped credentials for that linked server object.
- If you have permissions to connect to the server, suggestions from that server will be loaded into SQL Prompt's memory.
- If you do not have permissions to connect to that server, a message is displayed. Click Close to continue writing your query; no suggestions from the linked server will appear in the suggestions box.
To stop SQL Prompt attempting to connect to linked servers:
- On the SQL Prompt 4 menu, select Options.
- Go to the Suggestions > Types of suggestions page.
- Turn off Enable linked server support.
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

Inserting suggestions
Managing SQL Prompt behavior