ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / SchemaBuilder Class / Rename Method
Indicates the object to be renamed.
The new name of the object.
Example

In This Topic
    Rename Method (SchemaBuilder)
    In This Topic
    Enqueue the rename operation on the object with the name referred to by the Description.
    Syntax
    Public Function Rename( _
       ByVal description As Description, _
       ByVal newName As String _
    ) As Token

    Parameters

    description
    Indicates the object to be renamed.
    newName
    The new name of the object.

    Return Value

    The Token for the object to be renamed.
    Exceptions
    ExceptionDescription

    Rename does not support description.

    -or-

    The new name is invalid.

    -or-

    The total path length for the renamed description must be less than 252 characters.

    The new name is invalid.
    description is null.
    Example
    Renaming a FeatureDataset
    // Renaming a FeatureDataset from 'Parcel_Information' to 'Parcel_Information_With_Tax_Jurisdiction'
    
    string originalDatasetName = "Parcel_Information";
    string datasetRenameAs = "Parcel_Information_With_Tax_Jurisdiction";
    
    FeatureDatasetDefinition originalDatasetDefinition = 
      geodatabase.GetDefinition<FeatureDatasetDefinition>(originalDatasetName);
    FeatureDatasetDescription originalFeatureDatasetDescription = 
      new FeatureDatasetDescription(originalDatasetDefinition);
    
    SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
    
    // Rename the existing FeatureDataset, 'Parcel_Information' to 'Parcel_Information_With_Tax_Jurisdiction'
    schemaBuilder.Rename(originalFeatureDatasetDescription, datasetRenameAs);
    schemaBuilder.Build();
    Renaming a Table
    //Renaming a table from 'Original_Table' to 'Renamed_Table'
    
    string tableToBeRenamed = "Original_Table";
    string tableRenameAs = "Renamed_Table";
    
    TableDefinition tableDefinition = geodatabase.GetDefinition<TableDefinition>(tableToBeRenamed);
    
    SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
    
    // Table rename 
    schemaBuilder.Rename(new TableDescription(tableDefinition), tableRenameAs);
    schemaBuilder.Build();
    
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also