> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> SQLInsert 格式文档

# SQLInsert

| 输入 | 输出 | 别名 |
| - | - | - |
| ✗ | ✔ | |

<div id="description">
  ## 说明
</div>

以一系列 `INSERT INTO table (columns...) VALUES (...), (...) ...;` 语句的形式输出数据。

<div id="example-usage">
  ## 示例用法
</div>

示例：

```sql theme={null}
SELECT number AS x, number + 1 AS y, 'Hello' AS z FROM numbers(10) FORMAT SQLInsert SETTINGS output_format_sql_insert_max_batch_size = 2
```

```sql theme={null}
INSERT INTO table (x, y, z) VALUES (0, 1, 'Hello'), (1, 2, 'Hello');
INSERT INTO table (x, y, z) VALUES (2, 3, 'Hello'), (3, 4, 'Hello');
INSERT INTO table (x, y, z) VALUES (4, 5, 'Hello'), (5, 6, 'Hello');
INSERT INTO table (x, y, z) VALUES (6, 7, 'Hello'), (7, 8, 'Hello');
INSERT INTO table (x, y, z) VALUES (8, 9, 'Hello'), (9, 10, 'Hello');
```

要读取由此格式输出的数据，可以使用 [MySQLDump](/zh/reference/formats/MySQLDump) 输入格式。

<div id="format-settings">
  ## 格式设置
</div>

| 设置 | 说明 | 默认值 |
| - | - | - |
| [`output_format_sql_insert_max_batch_size`](/zh/reference/settings/formats/output-format#output_format_sql_insert_max_batch_size) | 单个 INSERT 语句中的最大行数。 | `65505` |
| [`output_format_sql_insert_table_name`](/zh/reference/settings/formats/output-format#output_format_sql_insert_table_name) | 输出的 INSERT 查询中的表名。 | `'table'` |
| [`output_format_sql_insert_include_column_names`](/zh/reference/settings/formats/output-format#output_format_sql_insert_include_column_names) | 在 INSERT 查询中包含列名。 | `true` |
| [`output_format_sql_insert_use_replace`](/zh/reference/settings/formats/output-format#output_format_sql_insert_use_replace) | 使用 REPLACE 语句而不是 INSERT。 | `false` |
| [`output_format_sql_insert_quote_names`](/zh/reference/settings/formats/output-format#output_format_sql_insert_quote_names) | 使用“\`”字符引用列名。 | `true` |
