From 02b6cd1c1c3c9fcc340f6902f7d20a28965cbdf0 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Fri, 13 Nov 2026 02:46:42 +0700 Subject: [PATCH 1/2] docs(customization): results kept per run, Teradata agent and BT/ET rules, insert_rows status_message --- customization/data-settings.mdx | 10 +++++++++- databases/mssql.mdx | 2 +- developers/mcp-tools.mdx | 9 +++++---- features/query-results.mdx | 4 ++-- features/sql-editor.mdx | 2 +- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/customization/data-settings.mdx b/customization/data-settings.mdx index 58cb938..b52bb19 100644 --- a/customization/data-settings.mdx +++ b/customization/data-settings.mdx @@ -1,6 +1,6 @@ --- title: Data Settings -description: Data grid font, copy format, pagination, query result cap, JSON viewer, and query history +description: Data grid font, copy format, pagination, query result cap, results kept per run, JSON viewer, and query history --- Browsing a table pages 1,000 rows at a time, and a query that returns more than 10,000 rows stops there. Both numbers, and the rest of what the grid does before you touch anything, are on **Settings > Data**. @@ -62,6 +62,14 @@ Tables with more estimated rows than the threshold show an approximate count ins The cap limits the rows read back, not the statement: your SQL reaches the server exactly as you typed it, and a query carrying its own `LIMIT` is untouched. What a capped result offers instead is in [Query Results](/features/query-results#the-row-cap). +## Multiple Results + +| Setting | Default | Options | +|---------|---------|---------| +| Results kept per run | No limit | No limit; 10; 20; 50; 100; 200; 500; 1,000 | + +A run that returns more results with rows keeps only the newest ones, and each of them reads, for example, "150 earlier results were dropped." under the grid. The statements that return no rows share one result and never count, and pinned results always stay. A change leaves the results on screen as they are. On SQL Server one batch, with its `GO 5` repeats, keeps at most its last 100 result sets whatever the setting. + ## JSON Viewer | Setting | Default | Options | diff --git a/databases/mssql.mdx b/databases/mssql.mdx index 5ffc11a..f47848d 100644 --- a/databases/mssql.mdx +++ b/databases/mssql.mdx @@ -119,7 +119,7 @@ SELECT * FROM serialnew WHERE [S/N] = @sn; SELECT * FROM serial_existed WHERE sn_code = @sn; ``` -Every result set a batch returns opens in its own result tab. In a batch of plain queries each tab is named after its query; a procedure call, a loop or an `IF` numbers them **Result 1**, **Result 2** instead. `PRINT` output and messages up to severity 10 appear in the **Output** view. +Every result set a batch returns opens in its own result tab, up to the batch's last 100. In a batch of plain queries each tab is named after its query; a procedure call, a loop or an `IF` numbers them **Result 1**, **Result 2** instead. `PRINT` output and messages up to severity 10 appear in the **Output** view. - Give `CREATE PROCEDURE`, `CREATE VIEW`, `CREATE FUNCTION`, `CREATE TRIGGER` and `CREATE SCHEMA` a batch of their own. The server refuses each of them after another statement in the same batch. - `GO 5` runs the batch before it five times. diff --git a/developers/mcp-tools.mdx b/developers/mcp-tools.mdx index ef2468b..3ed870a 100644 --- a/developers/mcp-tools.mdx +++ b/developers/mcp-tools.mdx @@ -184,10 +184,11 @@ The top-level fields describe the first result set, with `rows_affected` countin A statement runs on the user's own session, inside any transaction it holds. `execute_query`, `confirm_destructive_operation` and [`insert_rows`](#writing-data) follow these rules about it: - A statement that starts a transaction while one is open is refused, with or without Manual Commit. -- While a transaction is open on PostgreSQL or CockroachDB, the statement runs inside `SAVEPOINT tablepro_agent`. A failure rolls back to the savepoint and leaves the user's transaction usable. On Redshift and DuckDB, where a failure would abort it, the statement is refused. +- While a transaction is open on PostgreSQL or CockroachDB, the statement runs inside `SAVEPOINT tablepro_agent`. A failure rolls back to the savepoint and leaves the user's transaction usable. On Redshift, DuckDB and Teradata, where a failure would abort it, the statement is refused. - With [Manual Commit](/features/sql-editor#manual-commit) on, a write stays pending until the user commits it in TablePro. It opens a transaction, or joins the one already open, and `status_message` says the change is pending. A write the connection cannot hold is refused. -- With Manual Commit on, a statement that starts, ends or could hide transaction control is refused: `BEGIN`, `COMMIT`, `ROLLBACK`, `SAVEPOINT`, `RELEASE`, a procedure call, dynamic SQL, and on SQL Server a transaction keyword anywhere in the batch. +- With Manual Commit on, a statement that starts, ends or could hide transaction control is refused: `BEGIN`, `COMMIT`, `ROLLBACK`, `SAVEPOINT`, `RELEASE`, a procedure call, dynamic SQL, `BT` and `ET` on Teradata, and on SQL Server a transaction keyword anywhere in the batch. - When the open transaction ended while the statement ran, `status_message` says so. +- On Teradata, a write that leaves a transaction open, as every change in an ANSI session does, gets a `status_message` saying so. The statements after it are refused until it is committed or rolled back. - An `insert_rows` call of several rows that joins an open transaction on PostgreSQL, CockroachDB, MySQL, MariaDB, SQLite, SQL Server or Oracle runs inside a savepoint, so a row that fails takes back the rows before it. A batch that raises an error fails the call with the server's message and line number. The batches after it do not run, and the error says what stays applied. On a connection with [masking rules](#masking-rules), the whole message is withheld. @@ -204,11 +205,11 @@ Formats are `csv`, `json` and `sql`; pass exactly one of `query` or `tables[]`. | Tool | Arguments | Returns | |------|-----------|---------| -| `insert_rows` | `connection_id`, `table`, `columns`, `rows` (`database`, `schema`) | `table`, `rows_submitted`, `rows_affected` | +| `insert_rows` | `connection_id`, `table`, `columns`, `rows` (`database`, `schema`) | `table`, `rows_submitted`, `rows_affected` (`status_message`) | | `confirm_destructive_operation` | `connection_id`, `query` (`timeout_seconds`, `database`, `schema`) | A result set, plus `result_sets[]` for a SQL Server script | | `transaction_control` | `connection_id`, `action` (`database`, `schema`) | `status`, the action that completed, and `connection_id` | -`insert_rows` binds parameters. Its confirmation shows the values that will be written, and the approved values run in the named database and schema. Each row is an array with one value per column, and a call carries at most 1,000 rows. The [transaction rules](#execute_query) of `execute_query` apply: under Manual Commit the rows stay pending until the user commits them in TablePro. The reply has no `status_message` to say so. +`insert_rows` binds parameters. Its confirmation shows the values that will be written, and the approved values run in the named database and schema. Each row is an array with one value per column, and a call carries at most 1,000 rows. The [transaction rules](#execute_query) of `execute_query` apply: under Manual Commit the rows stay pending until the user commits them in TablePro, and `status_message` says so. `confirm_destructive_operation` runs one destructive statement, or a SQL Server script containing a destructive statement. This includes `DROP`, `TRUNCATE`, `ALTER … DROP`, and `DELETE` without `WHERE`. Other statements are rejected; use `execute_query` for those. The user approves it first, through your elicitation prompt if your client supports elicitation, otherwise through TablePro's own dialog on their Mac. diff --git a/features/query-results.mdx b/features/query-results.mdx index cd864af..ce21377 100644 --- a/features/query-results.mdx +++ b/features/query-results.mdx @@ -5,7 +5,7 @@ description: Choosing between results, pinning, the row cap, and what a failed o import RowCap from "/snippets/row-cap.mdx"; -Every statement you run gets its own result. The next run reuses an unpinned one rather than adding to the pile, so a result survives only as long as you leave it unpinned. +Every statement you run gets its own result. The next run reuses an unpinned one rather than adding to the pile, so a result survives only as long as you leave it unpinned. A run keeps every result that returns rows unless **Results kept per run** in [Data Settings](/customization/data-settings#multiple-results) sets a limit. Three SELECT statements in the editor over genre, artist and album result tabs, with the genre rows in the grid @@ -94,7 +94,7 @@ When the cap trims a result the status bar reads **Showing N rows** and offers * ## Statements that return no rows -INSERT, UPDATE, DELETE and DDL show a success view with the affected row count and the execution time. +INSERT, UPDATE, DELETE and DDL show a success view with the affected row count and the execution time. Two or more of them in one run share one result, named after how many there were, with the row counts and times added up. ## Server output diff --git a/features/sql-editor.mdx b/features/sql-editor.mdx index 82b8204..76e19d9 100644 --- a/features/sql-editor.mdx +++ b/features/sql-editor.mdx @@ -47,7 +47,7 @@ A SQL Server script runs a batch at a time instead, cut at its `GO` lines, so a |---|---|---| | Ordinary statements | A transaction TablePro opens and commits | Everything rolls back | | Ordinary statements, with [Manual Commit](#manual-commit) on | A transaction TablePro opens and leaves open for you to commit | Everything rolls back | -| One that manages its own: `BEGIN`, `START TRANSACTION`, `XA START`, `SET autocommit`, `SAVEPOINT` on SQLite, `SET TRANSACTION` on Oracle | The script's own transaction | The transaction it left open is rolled back | +| One that manages its own: `BEGIN`, `START TRANSACTION`, `XA START`, `SET autocommit`, `SAVEPOINT` on SQLite, `SET TRANSACTION` on Oracle, `BT` on Teradata | The script's own transaction | The transaction it left open is rolled back | | One holding a [statement a transaction cannot hold](#statements-a-transaction-cannot-hold) | No transaction | Each statement that ran stays applied, and the banner counts them | | A script on SQL Server | No transaction, unless the script opens one with `BEGIN TRAN` | What ran stays applied, and a transaction the script left open is reported | | Anything, on a connection that already has a transaction open | That transaction | The transaction stays open and the message says so | From 42520eede8c98cd07cf5d94018570b21eea0902c Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Fri, 13 Nov 2026 02:48:06 +0700 Subject: [PATCH 2/2] docs(customization): a SQL Server batch keeps at most 100 result sets --- customization/data-settings.mdx | 2 +- databases/mssql.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/customization/data-settings.mdx b/customization/data-settings.mdx index b52bb19..513c41c 100644 --- a/customization/data-settings.mdx +++ b/customization/data-settings.mdx @@ -68,7 +68,7 @@ The cap limits the rows read back, not the statement: your SQL reaches the serve |---------|---------|---------| | Results kept per run | No limit | No limit; 10; 20; 50; 100; 200; 500; 1,000 | -A run that returns more results with rows keeps only the newest ones, and each of them reads, for example, "150 earlier results were dropped." under the grid. The statements that return no rows share one result and never count, and pinned results always stay. A change leaves the results on screen as they are. On SQL Server one batch, with its `GO 5` repeats, keeps at most its last 100 result sets whatever the setting. +A run that returns more results with rows keeps only the newest ones, and each of them reads, for example, "150 earlier results were dropped." under the grid. The statements that return no rows share one result and never count, and pinned results always stay. A change leaves the results on screen as they are. On SQL Server one batch keeps at most 100 result sets whatever the setting: the first 100 when it returns more, the last 100 across its `GO 5` repeats. ## JSON Viewer diff --git a/databases/mssql.mdx b/databases/mssql.mdx index f47848d..b347ae2 100644 --- a/databases/mssql.mdx +++ b/databases/mssql.mdx @@ -119,7 +119,7 @@ SELECT * FROM serialnew WHERE [S/N] = @sn; SELECT * FROM serial_existed WHERE sn_code = @sn; ``` -Every result set a batch returns opens in its own result tab, up to the batch's last 100. In a batch of plain queries each tab is named after its query; a procedure call, a loop or an `IF` numbers them **Result 1**, **Result 2** instead. `PRINT` output and messages up to severity 10 appear in the **Output** view. +Every result set a batch returns opens in its own result tab, up to 100 per batch. In a batch of plain queries each tab is named after its query; a procedure call, a loop or an `IF` numbers them **Result 1**, **Result 2** instead. `PRINT` output and messages up to severity 10 appear in the **Output** view. - Give `CREATE PROCEDURE`, `CREATE VIEW`, `CREATE FUNCTION`, `CREATE TRIGGER` and `CREATE SCHEMA` a batch of their own. The server refuses each of them after another statement in the same batch. - `GO 5` runs the batch before it five times.