SQLFLAGGER function [Miscellaneous]

Returns the conformity of a given SQL statement to a specified standard.

Syntax
SQLFLAGGER( sql-standard-string, sql-statement-string )
Parameters
  • sql-standard-string   The standard level against which to test compliance. Possible values are the same as for the sql_flagger_error_level database option:

    • SQL:2003/Core   Test for conformance to core SQL/2003 syntax.

    • SQL:2003/Package   Test for conformance to full SQL/2003 syntax.

    • SQL:1999/Core   Test for conformance to core SQL/1999 syntax.

    • SQL:1999/Package   Test for conformance to full SQL/1999 syntax.

    • SQL:1992/Entry   Test for conformance to entry-level SQL/1992 syntax.

    • SQL:1992/Intermediate   Test for conformance to intermediate-level SQL/1992 syntax.

    • SQL:1992/Full   Test for conformance to full-SQL/1992 syntax.

    • Ultralite   Test for conformance to UltraLite.

  • sql-statement-string   The SQL statement to check for conformance.

See also
Standards and compatibility
  • SQL/2003   Vendor extension.

Example

The following statement shows an example of the message that is returned when a disallowed extension is found:

SELECT SQLFLAGGER( 
   'SQL:2003/Package', 'SELECT top 1 dummy_col FROM sys.dummy ORDER BY dummy_col' );

This statement returns the message '0AW03 Disallowed language extension detected in syntax near 'top' on line 1'.

The following statement returns '00000' because it does not contain any disallowed extensions:

SELECT SQLFLAGGER( 'SQL:2003/Package', 'SELECT dummy_col FROM sys.dummy' );