ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • ArcGIS Pro
  • ArcMap
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • ArcGIS Pro
  • ArcMap
Esri
English
  • English
  • Deutsch
  • Español
  • Français
  • 日本語
  • Русский
  • 简体中文
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions
  • Map
  • Work with layers
  • Managing layers
  • Adding and working with query layers
  • Back to Top
  • Adding layers to a map
  • Working with group layers
  • Adding x,y coordinate data as a layer
  • Changing a layer's drawing order
  • Working with basemap layers
  • Setting layer properties
  • Displaying layers at certain scales
  • Displaying a subset of features in a layer
  • Repairing broken data links
  • Renaming a layer
  • Viewing metadata from the Table of Contents
  • Saving layers and layer packages
  • Adding and working with query layers

    • Query layers
    • Database and client configurations for query layers
    • Create a query layer
    • Unique identifier fields
    • Modify a query layer
    • Export a query layer

    Modify a query layer

    ArcMap 10.8
    |
    Help archive
    ArcGIS Desktop is in mature support and will be retired March 1, 2026. There are no plans for future releases of ArcGIS Desktop, and it is recommended that you migrate to ArcGIS Pro. See Migrate from ArcMap to ArcGIS Pro for more information.

    After you add a query layer to the map, you can alter the SQL query and other properties of the layer. To do this, open the Edit Query Layer dialog box from the Layer Properties dialog box.

    When you add a spatial table stored in a database to the map, it creates a query layer with default properties as determined by the first row in the table. These properties may not be ideal, however. For example, a spatial table can have multiple geometry types for a single spatial attribute. A spatial table containing a collection of cities can be modeled in the database as both a point and a polygon geometry type. Feature layers in ArcGIS can only have a single geometry type, so the first row in the table provides the default geometry type property. In this example, if the first row in the spatial table containing cities data returns a point geometry, the cities query layer will only display point features. If you would prefer to view the polygon features that are stored in the cities table, modify the query layer properties on the Edit Query Layer dialog box and change the geometry type to polygon.

    Other properties, such as a query layer's dimensionality, spatial reference, SRID, and unique identifier field, are also determined by the first row returned from the spatial table. Similar to the geometry type, you can access these properties in the advanced options pane of the Edit Query Layer dialog box and modify them.

    When you change the dimensionality of the query layer, the geometry field value of the displayed features are modified to match that change.

    For example, for a layer defined with x-, y-, z-, and m-dimensionality in the database, if you edit the query layer and uncheck the Coordinates include M values and Coordinates include Z values options in the advanced options, all the features in the layer will display only the x- and y-values. Alternatively, if you edit the query layer and check the Coordinates include M values and Coordinates include Z values options, all the features will display x-, y-, z-, and m-values. If you check those options and a feature does not contain a z- or m-value in the database, those values will appear as null in the query layer.

    When you change the spatial reference or SRID of the query layer in the advanced options of the Edit Query Layer dialog box, the features displayed in ArcMap are filtered based on that spatial reference or SRID value.

    Follow these steps to alter the definition and properties of a query layer:

    1. In the table of contents, right-click the query layer whose query you want to modify.
    2. Click Properties to open the Layer Properties dialog box.
    3. Click the Source tab.
    4. Click Change Query.

      The Edit Query Layer dialog box appears.

    5. If you want to change the SQL statement that defines the query layer, modify the query in the Query text box.

      See Building a query expression for more information on writing an SQL query in ArcGIS.

    6. Click Validate to make sure that the query expression is correct.
    7. If you want to modify the unique identifier or any of the spatial properties of the query layer, such as its dimensionality, SRID, spatial reference, or geometry type, click the Show advanced options check box and click Next.

      See Create a query layer for more information on advanced options.

    8. Click Finish to close the dialog box.
    9. On the Layer Properties dialog box, click OK to display the new result set for the query layer and close the dialog box.

    Related topics

    • Create a query layer

    ArcGIS Desktop

    • Home
    • ArcGIS Pro
    • ArcMap
    • Documentation
    • Support

    ArcGIS

    • ArcGIS Online
    • ArcGIS Desktop
    • ArcGIS Enterprise
    • ArcGIS
    • ArcGIS Developer
    • ArcGIS Solutions
    • ArcGIS Marketplace

    About Esri

    • About Us
    • Careers
    • Esri Blog
    • User Conference
    • Developer Summit
    Esri
    Tell us what you think.
    Copyright © 2021 Esri. | Privacy | Legal