The SQL Filter Element places a raw SQL Statement directly in the Filter as a Filter Element. This is a very powerful and flexible feature that enables a database developer to code an advanced filter criteria that perhaps does not exist using the standard Filter Element. Think of this Filter Element as a hook for customization.
The SQL statement used must return a column with the name, ObjectID, and can not include a Common Table Expression.
The SQL Statement can be tested using the Test button and a sampling of the results will be displayed in the grid to the right. If there’s a problem with the SQL statement, the error returned by SQL Server will be displayed in the System Memo area below the SQL statement.
To aid in debugging and correcting any accidental errors, if a SQL Statement executes correctly, it is copied to the Last Known Good SQL tab.
The purpose of the SQL Filter Element is to select objects for the Filter, and not to do execute other nefarious SQL commands such as Drop or Delete. To prevent any damage, the SQL Statement is sanitized against SQL Injection.