SQL转JSON
从 INSERT 语句中反解出 JSON 数据。
关于「SQL转JSON」
它属于「JSON 工具」分类:JSON 的格式化、结构变换与各种数据格式互转。
- 从 <code>INSERT INTO 表名 (列…) VALUES (值…);</code> 中反解出结构化数据。
- 同时支持<b>单条</b>与<b>批量</b>插入(一条语句多组 VALUES)。
- 正确处理值中包含的<b>括号、逗号与转义引号</b>,不会错误切分。
- <code>NULL</code> 会转成 JSON 的 null,纯数字会转成数值类型。
- 反引号、双引号、方括号三种标识符引用风格都能识别。
完全免费、无需注册;所有处理都在浏览器本地完成,文件不会上传到任何服务器。
相关关键词:SQL转JSON、JSON 工具、sql、反解、在线工具、免费
如何使用「SQL转JSON」
- 打开工具:打开「SQL转JSON」页面,无需注册、无需安装任何软件。
- 准备输入:准备好要处理的内容或文件:文本可直接粘贴,文件可拖入页面(本工具属于「JSON 工具」)。
- 填入内容:把内容粘贴进输入框,或把文件拖入页面;也可以点击「示例」先填入样例数据试一下。
- 设置选项并处理:按需调整页面上的选项,然后点击处理 / 转换 / 生成按钮。
- 获取结果:处理完全在浏览器本地完成,结果可直接复制或下载,文件不会上传到任何服务器。
常见问题
- 为什么提示未识别到 INSERT 语句?
- 解析要求语句明确列出列名,即 <code>INSERT INTO t (a, b) VALUES (...)</code> 这种形式,并且以分号结尾。省略列名的写法因为无法得知字段名,暂不支持。
- 能解析 SELECT 的查询结果吗?
- 不能。工具只识别 INSERT 语句。如果你有查询结果,建议先导出成 CSV,再用「CSV转JSON」处理。
- 日期时间会被转换吗?
- 日期会保持原始字符串形式,不做自动转换,以免时区和格式歧义导致数据失真。
SQL to JSON (English)
Reverse-engineer JSON data from INSERT statements.
Belongs to “JSON Tools”: Format, transform and convert JSON to and from various data formats.
- Reverse-engineers structured data from <code>INSERT INTO table (cols…) VALUES (vals…);</code>.
- Supports both <b>single</b> and <b>batch</b> inserts (one statement with multiple VALUES).
- Correctly handles <b>parentheses, commas and escaped quotes</b> inside values — no wrong splits.
- <code>NULL</code> becomes JSON null; bare numbers become numeric.
- Backtick, double-quote and bracket identifier quoting styles are all recognized.
Free, no sign-up; everything runs locally in your browser and files are never uploaded.
Keywords: SQL to JSON, JSON Tools, sql, reverse, online tool, free
How to use it
- Open the tool:Open the “SQL to JSON” page — no sign-up and nothing to install.
- Prepare the input:Prepare the content or file to process: paste text or drop a file onto the page (this tool belongs to “JSON Tools”).
- Provide the input:Paste your content into the input box or drop a file onto the page; you can also click “Sample” to try example data first.
- Adjust options and run:Adjust the options if needed, then click the process / convert / generate button.
- Get the result:Everything runs locally in your browser; copy or download the result — your files are never uploaded.
FAQ
- Why "no INSERT statement recognized"?
- Parsing requires explicit column names, i.e. <code>INSERT INTO t (a, b) VALUES (...)</code>, ending with a semicolon. Column-less syntax is unsupported because field names are unknown.
- Can it parse SELECT result sets?
- No — it only recognizes INSERT statements. For query results, export to CSV first and use "CSV to JSON".
- Are date/time values converted?
- Dates stay as raw strings with no auto-conversion, to avoid timezone/format ambiguity and data loss.
More tools in JSON Tools
- JSON Formatter/Minifier — Beautify, minify, validate and highlight JSON.
- Sort JSON Keys — Recursively sort object keys alphabetically to ease diffing.
- Flatten JSON — Flatten nested structures into a.b.c single-level keys.
- Unflatten JSON — Restore dotted-path objects into nested structures.
- JSON to CSV — Convert an array of objects into a downloadable CSV.
- CSV to JSON — Parse CSV text or files into a JSON array.
- JSON to Excel — Export an array of objects as an .xlsx workbook.
- Excel to JSON — Upload an Excel file and convert sheets to JSON.
- JSON to XML — Convert JSON structures into well-indented XML.
- XML to JSON — Parse an XML document into an equivalent JSON object.
- JSON to YAML — Convert JSON into more readable YAML.
- YAML to JSON — Parse YAML config into standard JSON.
- JSON to SQL — Generate INSERT statements and CREATE TABLE DDL from arrays.
- JSON to Base64 — Convert JSON to and from Base64 with UTF-8 support.
- JSON ⇄ Cookie — Convert between Cookie strings and JSON key-values.
- JSON Diff — Recursively compare two JSON documents, marking add/delete/change.