How to convert CSV to SQL safely
- Paste CSV or open a local file. Confirm the detected delimiter, header choice, and parsed preview.
- Select the target database and give the destination table a deliberate name.
- Review every normalized column name, inferred type, and nullable result. Override types only when the destination schema requires it.
- Confirm whether blank fields or tokens such as
NULLshould become SQLNULL. A quoted empty string and a missing value are not universally the same thing. - Download the SQL, review it, and test it in an isolated database before production use.
Parsing and escaping rules
The parser accepts comma, tab, semicolon, or pipe delimiters; double-quoted fields; doubled "" quote escapes; and line breaks inside quoted fields. A quote inside an unquoted value, text after a closing quote, an unfinished quote, or a row with the wrong number of fields blocks generation with a physical line location.
Identifiers are quoted for the selected database. Text values escape apostrophes by doubling them; SQL Server Unicode text uses N'…'. The generator never inserts source text as raw SQL syntax. Numeric and Boolean literals are emitted unquoted only when the complete cell matches the inferred or selected type.
Conservative type inference
Columns can infer integer, decimal, Boolean, ISO date, ISO timestamp, or text. Mixed integers and decimals become decimal; other mixed types become text. Values with leading zeros such as 003 stay text because they are often identifiers. Empty or token-matched cells do not determine the type. Inferred CREATE TABLE types are portable starting points, not a substitute for domain knowledge, keys, indexes, constraints, precision choices, or an existing schema.
Database boundary
Generated SQL can modify a database if you execute it. This page never connects to a database, but you must still inspect destination names, column order, types, transaction behavior, permissions, duplicate-key behavior, encoding, time zones, decimal precision, and backups. Existing tables can reject or reinterpret values even when the SQL syntax is valid.
Frequently asked questions
Does ToolQuill upload or execute my CSV?
No. The file and pasted contents stay in the browser. The output is plain text for you to copy or download.
Why are table and column names always quoted?
Quoting prevents spaces, punctuation, Unicode, or reserved words from being mistaken for SQL syntax. Each database uses its own identifier delimiters.
Can this append to an existing table?
Yes: turn off CREATE TABLE and review the quoted table/column names against the real schema. The generator cannot verify that remote schema, constraints, triggers, or permissions.
Why is my numeric-looking code inferred as text?
Leading-zero values are deliberately preserved as text. Treating product, postal, account, or part codes as numbers can destroy meaningful zeros.
Browse text and data tools · Fixed-width to CSV parser · All ToolQuill tools