$devtoolkit.sh/examples/sql/insert-batch

Format a Batch SQL INSERT

Batch INSERT statements with multiple value rows are common in seed files, test fixtures, and data migration scripts. Unformatted, they become a single long line that is impossible to review. The formatter breaks each row onto its own line with consistent alignment so changes in code review are clear. Use this before committing SQL migration files.

Example
INSERT INTO products (id, name, price, category_id, in_stock) VALUES
(1, 'Wireless Keyboard', 79.99, 3, true),
(2, 'USB-C Hub', 49.99, 3, true),
(3, 'Monitor Stand', 34.99, 4, false),
(4, 'Desk Lamp', 28.99, 4, true),
(5, 'Webcam 1080p', 89.99, 3, true);
[ open in SQL Formatter → ]

FAQ

Is a batch INSERT faster than individual INSERTs?
Yes. A single INSERT with multiple value rows is significantly faster than separate INSERT statements because it reduces network round-trips and transaction overhead.
How many rows can I insert in one statement?
Most databases support thousands of rows per batch INSERT, but very large batches may hit packet size limits. Split into batches of 500–1000 rows for safety.
What is the difference between INSERT and UPSERT?
INSERT adds new rows and fails if a key already exists. UPSERT (INSERT ... ON CONFLICT or REPLACE INTO) inserts new rows or updates existing rows when a constraint is violated.

Related Examples

/examples/sql/insert-batchv1.0.0