Example time Gotcha However, it appears that in SQL Server 2008, SET NOEXEC does not work exactly as documented.
You can modify the case of the SQL keywords and identifiers to upper case, lower case or keep them as-is.
This SQL beautifier is especially useful for SELECT statements, but can also handle INSERT, UPDATE and DELETE statements.
The appropriate message is displayed on the SAS log to indicate whether coding problems exist.
As illustrated in the example below, a VALIDATE statement is specified at the beginning of a SELECT statement to enable syntax checking.
You may need a full SQL Parser to do such a vendor-specific offline SQL syntax check.
Formats any SQL query with your desired indentation level, even if your SQL statement is invalid.
It was built to be agnostic of the database that is targeted and should support My SQL, Microsoft SQL Server, Oracle and other SQL ANSI databases.
If you want to check the validity of a TSQL statement programmatically, you can make use of the SET NOEXEC statement.
dont think there is any (easy) way to validate sql Sql syntax is complex and allows for alot of different ways to enter a statement.