Query Specifications

Query specifications define requirements for items such as maximum number of tables in a "union" query.

Item Requirement Notes

Maximum number of tables participating in a query, for a query without a union, or for each side of a union in a query

64

Maximum of 50 user tables, including result tables, tables referenced by views (the view itself is not counted) correlations and self-joins; maximum of 46 worktables

Maximum number of tables in a “union” query

256

Includes up to 50 user tables and 14 worktables on every side of the union, for a maximum of 256 tables across all sides of the union

Maximum number of databases participating in one transaction

Unlimited

Includes database where transaction began, all databases changed during transaction, and tempdb, if it is used for results or worktables

Practical number of databases participating in one query

16

Includes each occurrence of each database queried and tempdb, if it is used for results or worktables

Maximum number of tables with referential integrity constraints for a query

192

Number of items in an in clause. Unlimited No hardcoded limit, but potentially limited by free procedure cache.