Toolvito

Calculates on this device. File exports run online.

SQL Editor & Validator

Paste SQL to find mistakes such as a stray comma, a misspelled key word or an UPDATE without WHERE, each with its line and column. Format SQL so it is easy to read, or build a query from a simple form. For a full syntax check in the dialect of your database, use the box below.

Enter your values

Finds mistakes you can see in the text: quotes and brackets, commas, misspelled key words, = NULL, UPDATE or DELETE without WHERE, INSERT rows of the wrong length and JOIN without ON. The box below checks the full syntax for your database.

Your values

One or more statements, ended with ;. The SQL is checked in your browser and never run.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose the button below them.

Full syntax check for your database, or convert to another (sqlglot)

Full syntax check for your database (sqlglot), and convert to another

The SQL above (what you pasted, or the query you built) is parsed by sqlglot in the dialect you choose. Each statement that cannot be read is listed with the reason; the rest is written again for the database you choose. Nothing is run.

More options

The calculator above works on your device. When you run a task in this section, Toolvito receives the values and result you submit to make the file or run the check. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

How to check SQL

  1. Choose Check SQL for mistakes and paste your SQL, or open a .sql file.
  2. Press Check the SQL. Each problem is listed with its line and column, as an error, a warning or a note.
  3. For a full syntax check, choose your database in the box below and press Check the SQL there. The server reads the SQL with sqlglot and says exactly what it cannot parse.

What the page finds

  • Errors: a quote, quoted name or comment that is not closed; brackets that do not match; a comma right before FROM, WHERE, ORDER or a closing bracket, or two commas in a row; misspelled key words (SELCT, FORM, WEHRE); GROUP or ORDER without BY; INSERT rows with the wrong number of values; JOIN without ON or USING.
  • Warnings: = NULL or <> NULL, which is never true (use IS NULL); UPDATE or DELETE without WHERE, which changes every row; a statement that starts before the one before has its ;.
  • Notes: SELECT * and HAVING without GROUP BY.

How to build a query

  1. Choose Build a query from a form and the kind of statement: SELECT, INSERT, UPDATE or DELETE.
  2. Type the table, the columns and the conditions (=, <>, <, >, LIKE, IN, BETWEEN, IS NULL …).
  3. Choose your database: names that need quotes get them ("…" for PostgreSQL and SQLite, … for MySQL, […] for SQL Server), and the row limit is written as LIMIT or TOP.
  4. Copy or download the SQL. An UPDATE or DELETE without a condition is refused unless you tick that you mean every row.

Limits you should know

  • The page’s own check finds mistakes it can be sure of; it is not a full parser. The box below parses with sqlglot for 20 databases.
  • SQL is never run: names of tables and columns are not checked against your database.
  • Stored procedures (PL/SQL, T-SQL blocks) are checked only for quotes and brackets in the page.

Privacy

SQL is checked, formatted and built in your browser. Only when you use the box below is the SQL shown above sent to the Toolvito server, to be parsed there. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

Related tools