Autocomplete Cache Is Lost or Not Populated When Switching VPN or Reconnecting to a Server

Autocomplete Cache Is Lost or Not Populated When Switching VPN or Reconnecting to a Server

Autocomplete suggestions for database objects, including tables, columns, and stored procedures, may stop appearing after switching a VPN connection or reconnecting to a SQL Server instance. In some cases, suggestions become available only after the cache is rebuilt; in others, autocomplete may remain incomplete until a manual refresh is performed.

Root Cause

SQL Complete builds the object cache incrementally. Initially, only basic metadata is loaded, while additional objects are fetched on demand as they are accessed.

The cache is persisted locally between sessions. However, if SQL Complete attempts to retrieve additional metadata while the connection to the server is unavailable (for example, during a VPN switch or a temporary network interruption), the requested objects cannot be loaded and therefore are not added to the cache. From the user's perspective, this may appear as if the cache has been reset or partially lost.

It is important to note that the cache is replaced only after a successful refresh operation. Therefore, an interrupted refresh process should not result in the loss of metadata that has already been loaded.

Workaround

To prevent the cache from being refreshed automatically, disable the corresponding options in SQL Complete:
  1. Open SQL Complete → Options → Suggestion → Refresh.
  2. Clear the following checkboxes:
    1. Automatically refresh local cache every
    2. Detect changes on a server before refreshing local cache
With these options disabled, the cache remains available throughout the current SSMS session and is no longer overwritten automatically. If the database schema changes, the cache can be refreshed manually by pressing Ctrl+R.

Info
Product Limitation
Persisting the complete object cache for each database across SSMS sessions is not currently supported. This functionality is planned for implementation in future versions of SQL Complete.