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.

InstallInsightsLayer runs the embedded SQL scripts to create all AI Insights objects in the connected database. The operation is idempotent — re-running is safe and creates only what is missing. It also removes any legacy or non-active AIInsights tables left over from older schema versions.

Parameters

InstallInsightsLayer takes no parameters.

What gets installed

Running InstallInsightsLayer creates or verifies all of the following database objects:
  • AIInsights schema — container schema for all insight layer objects
  • AIInsights.SchemaInsights — primary insight cache table (one row per database object)
  • AIInsights.InsightHistory — archive table for soft-deleted insight rows
  • AIInsights.DdlChangeWatermark — single-row table tracking the last-processed DDL audit ID
  • dbo.DDL_AuditLog — event capture table populated by the DDL trigger
  • DDL_Audit database trigger — database-level DDL trigger that records schema changes to dbo.DDL_AuditLog
Installing the DDL_Audit trigger requires the ALTER ANY DATABASE DDL TRIGGER permission, which is granted to ddl_admin and sysadmin roles. Without this permission, the schema tables are created successfully but the trigger installation will fail. You can still use the insights cache — fingerprint-based invalidation will be used as a fallback during RefreshInsights.

Returns

success
boolean
required
true when all objects were installed without error; false if installation failed.
data
object
Present when success is true. Contains an installed marker and a confirmation message.
error
string
Present only when success is false. Contains the error or exception message.
InstallInsightsLayer requires USE_INSIGHTS_LAYER to be enabled (the default). If USE_INSIGHTS_LAYER is explicitly set to false, 0, off, or disabled, the tool returns an error without modifying the database.
After installation, call InsightsCheck to verify that all objects are present. For existing databases, follow up with RebuildBaselineInsights to warm the cache with auto-mechanical baselines for all user tables.

Build docs developers (and LLMs) love