Using Virtual Tables for File Content Queries

Accessing and Changing Relational Data

Accessing and Changing Relational Data

Using Virtual Tables for File Content Queries

Every SQL query must have at least one defined table specified, which means the number and types of columns is either known in advance or specified as part of the query. A relational database usually contains a number of predefined tables and the meta data about the columns of these tables is stored in a schema.

The collection of files in a file system, however, does not generally have such a predefined structure. The properties of a file are perhaps similar to columns, but there is no deterministic set of properties for files. A file itself may be similar to a row, but files are usually not grouped into a homogeneous collection akin to the rows in a table. Thus, the table concept is unclear, SELECT * is meaningless, and both the rows and the columns are unbounded. Another way of looking at this is that a file system effectively has a universal schema consisting of every possible file property, both already known and as yet unknown.

Microsoft® Indexing Service solves this problem by providing the SCOPE function which defines the set of rows that makes up a virtual table and provides file properties that substitute for columns.