Require INSERT Column Lists

Help ID: query-runner.insert-column-lists

Require INSERT column lists makes Query Pilot treat bare INSERT table VALUES (...) statements as syntax-check failures.

This protects scripts from silent column-order mistakes. SQL Server allows inserts without target column names, but those scripts can break or corrupt intent when a table gets a new column, a nullable column moves, or the reader has to guess which value belongs to which column.

When enabled, the syntax checker also catches obvious shape mismatches:

  • INSERT dbo.Table VALUES (...) fails because no target columns are listed.
  • INSERT dbo.Table (A, B) VALUES (1) fails because the column and value counts differ.
  • INSERT dbo.Table (A, B) SELECT Col1 FROM dbo.Source fails when the direct SELECT projection count differs.

For policy issues, right-click in the editor and choose Resolve INSERT policy. Query Pilot can add a missing column list, add a NULL placeholder when the source side is short, or add a /* TODO: column */ placeholder when the target column list is short.

Query Pilot does not try to count dynamic SQL, EXEC insert sources, or SELECT * insert sources because those shapes are not deterministic from the visible script alone.

Example:

INSERT dbo.Customer
(
    CustomerName,
    IsActive
)
VALUES
(
    N'',
    1
);

Related: Query Pilot syntax, Query Pilot objects.

Documentation revision: 572139AFE4318E74