ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Data Namespace / Database Class / GetQueryDescription Method / GetQueryDescription(String) Method
The name of a valid single (i.e., standalone) table. The name can be unqualified or fully qualified. Regardless of whether it is unqualified or fully qualified, it must match one of the "tableNames" returned from the method GetTableNames.
Example

In This Topic
    GetQueryDescription(String) Method
    In This Topic
    Gets the QueryDescription object associated with the single (i.e., standalone) table specified by tableName in the currently opened database. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public QueryDescription GetQueryDescription( 
       string tableName
    )
    Public Overloads Function GetQueryDescription( _
       ByVal tableName As String _
    ) As QueryDescription

    Parameters

    tableName
    The name of a valid single (i.e., standalone) table. The name can be unqualified or fully qualified. Regardless of whether it is unqualified or fully qualified, it must match one of the "tableNames" returned from the method GetTableNames.

    Return Value

    The QueryDescription object that fully describes how the underlying database table should be represented as a Table or FeatureClass if it is a spatial table.
    Exceptions
    ExceptionDescription
    tableName does not currently exist in the database.
    A database-related exception has occurred.
    Remarks
    A QueryDescription object fully describes how a single database table or one or more database tables (specified by a valid SQL SELECT statement) should be represented as a Table or FeatureClass if the table is spatially enabled. Essentially, there are two flavors of QueryDescription. The first is created by this method. Given a table name (fully qualified or unqualified), it encapsulates all the important properties that describe the underlying single table (i.e., QueryDescription.IsQueryLayer returns false). The second flavor is created by GetQueryDescription(String,String). Given a valid SQL SELECT statement and a query layer name, it encapsulates all the important properties that describe the underlying query layer that is created from one or more tables (i.e., QueryDescription.IsQueryLayer returns true).
    Example
    Create Default QueryDescription for a Database table and obtain the ArcGIS.Core.Data.Table for the QueryDescription
    public async Task DefaultQueryDescription()
    {
      await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
      {
        DatabaseConnectionProperties databaseConnectionProperties = new DatabaseConnectionProperties(EnterpriseDatabaseType.SQLServer)
        {
          AuthenticationMode = AuthenticationMode.DBMS,
          Instance = "instance",
          Database = "database",
          User = "user",
          Password = "password"
        };
    
        using (Database database = new Database(databaseConnectionProperties))
        {
          QueryDescription queryDescription = database.GetQueryDescription("CUSTOMERS");
    
          using (Table table = database.OpenTable(queryDescription))
          {
            //use table
          }
        }
      });
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also