Database objects usage and other information about the currently loaded SQL query are instantly available through the QueryBuilder.QueryStatistics set of collections.
Used database objects: QueryBuilder.QueryStatistics.UsedDatabaseObjects collection.Each item of this collection has a link to the MetadataObject object to retrieve detailed information about this database object. Please note that this link might be set to null if such object can not be found in the Metadata Container.
Used database object fields: QueryBuilder.QueryStatistics.UsedDatabaseObjectColumns collection.Each item of this collection has a name and type of the field. It also has links to the MetadataField and MetadataObject objects to retrieve detailed information about this field and the database object to which it belongs. The Selected property indicates if this field is used in some of the output columns in the query.Please note that this collection does not contain fields that were used in the query without table alias prefix. This because it is impossible to determine the correspondence of this field to a table uniquely.
Output query columns: QueryBuilder.QueryStatistics.OutputColumns collection.This collection lists output columns of the query. Each item of this collection has the Expression and ExpressionAlias properties to retrieve SQL expression, and it's alias (if defined). If SQL expression is a simple database object field, additional information for it is available: field type, object name, links to MetadataField and MetadataObject objects, etc.