What is a query layer?

A query layer is a layer or stand-alone table that is defined by a SQL query. Query layers allow both spatial and nonspatial information stored in a DBMS to be easily integrated into GIS projects within ArcMap. Since query layers are using SQL to directly query database tables and views, spatial information used by a query layer is not required to be in a geodatabase.

When working in ArcMap, you create query layers by defining a SQL query. The query is then run against the tables and views in a database, and the result set is added to ArcMap as a layer or stand-alone table (depending on the query).

The query is executed every time the layer is displayed or used in ArcMap. This allows the latest information to be visible without making a copy or snapshot of the data and is especially useful when working with dynamic information that is frequently changing. The query layers functionality works with any of the DBMSs supported by ArcGIS.

Query layers allow ArcMap to integrate data from geodatabases as well as from DBMSs. Therefore, query layers can quickly integrate spatial and nonspatial information into GIS projects independently of where and how that information is stored.

A quick tour of working with Query Layers


8/2/2012