Are there any SQL Validators that can check syntax against multiple database servers?
For example, I might want to check whether a particular query will work against Oracle, MySQL and SQL Server.
I am more concerned about the SQL syntax than the actual schema being queried, so a tool that can catch major syntax errors, like detecting that the limit
clause is not supported in SQL Server and Oracle would be good enough.
EDIT:
Several answers have suggested checking syntax for a particular DBMS or for ANSI Standard.
What I am looking for a possibility of targeting a sort of union of features between two or more databases (say SQL Server and Oracle). I would like to be able to use any SQL feature that is supported by all of the DBMS I am targeting in a particular application.
I am not sure if it is worthwhile. I think it depends upon the number of non-ANSI features shared by several databases. If there are very few, then perhaps it will be better to target the ANSI standard.
Validate SQL Syntax * All fields above are mandatory. EverSQL Validator is a free online syntax checker for MySQL SQL statements. The validator will compile and validate SQL queries to report for syntax errors.
Check - The check is a way for you to check if you have written a legal SQL query. Arrow - This is the execute command button. This will send the query to the server and the server will write back the result to you. Square - This is the stop execution command.
I'm not aware of any that are that specific, these will check that the statements are valid ansi 92/99/2003...
http://developer.mimer.com/validator/index.htm
That will get you 99% of the way there (especially if are only doing CRUD operations)
maybe if you know which reserved words are used by which database you could roll your own simple checker.. see : How to find if a column name is a reserved keyword across various databases
(as already mentioned) If your goal is to create a database agnostic system think about using a third party tool e.g: entityspaces
From SQL Server point of view, instead of checking sql syntax against multiple database server you could check syntax "for compliance with the FIPS 127-2 standard. This is based on the ISO standard.".
Example:
SET FIPS_FLAGGER 'INTERMEDIATE'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With