19
The number of tables including the derived tables in the query exceeded the limit of %ld tables.
The combined number of tables and derived tables (see “How SQL-derived tables work” below) in the query is too high.
Reduce the number of tables, including derived tables, specified in the query that encounters the error.
A SQL-derived table is defined by one or more tables through the evaluation of a query expression. A SQL derived table is used in the query expression in which it is defined and exists only for the duration of the query. It is not described in system catalogs or stored on disk.
How SQL-derived tables work A SQL-derived table is created with a derived table expression consisting of a nested select statement, as in the following example, which returns a list of cities in the publishers table of the pubs2 database:
select city from (select city from publishers) cities
For example, the SQL-derived table from the subquery above is named cities and has one column titled city. The SQL-derived table is defined by the nested select statement and persists only for the duration of the query, which returns the following output:
city -------------- Boston Washington Berkeley
A more complete explanation of derived tables, and their syntax and use, can be found in the chapter “SQL Derived Tables” in the Transact SQL User’s Guide.
Version 12.5.1 and later