Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/A-Point-Systems-ltd/ms-sql-mcp/llms.txt

Use this file to discover all available pages before exploring further.

RefreshInsights triggers the DDL change processing pipeline immediately — the same logic the background InsightDdlProcessingQueue service runs automatically on a schedule. Call it to force reconciliation after a batch of schema changes, or once at the start of an investigation session to ensure the cache reflects the current database state.

Parameters

RefreshInsights takes no parameters.

What it does

Running RefreshInsights executes the following steps in order:
  1. Reads new DDL audit rows — queries dbo.DDL_AuditLog for rows with an ID greater than the current DdlChangeWatermark value.
  2. Archives affected insights — for each object that appears in the new DDL log rows, moves the current AIInsights.SchemaInsights row to AIInsights.InsightHistory and marks the live row as stale.
  3. Falls back to fingerprint scanning — when no new DDL audit rows are pending (e.g. the trigger was not installed), performs a fingerprint-based scan to detect objects whose schema has changed since their insight was last authored.
  4. Rebuilds auto-mechanical baselines — when INSIGHTS_AUTOPOPULATE is enabled, creates new auto-mechanical baseline rows for any objects whose insights were just archived.
  5. Advances the watermark — updates AIInsights.DdlChangeWatermark to the highest processed audit ID so the same rows are not processed again.
  6. Returns recent insight summaries — includes a snapshot of recently-updated insight rows in the response.

Returns

success
boolean
required
true when the pipeline ran without an unhandled exception; false on error.
data
object
Present when success is true. Contains a summary of the refresh run.
error
string
Present only when success is false. Contains the exception message.
RefreshInsights requires USE_INSIGHTS_LAYER to be enabled (the default). When the layer is disabled, the tool returns an error indicating the layer is off.
RefreshInsights is not idempotent — each call advances the DDL processing watermark and may archive insight rows. Calling it multiple times in quick succession is safe but redundant; the second call will find no new DDL rows and perform only a fingerprint scan.
Call RefreshInsights once at the start of an investigation session to synchronise the cache, then proceed with DescribeTable, GetInsight, or ListInsights. This avoids acting on stale insight data from before a recent migration.

Build docs developers (and LLMs) love