ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for 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

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Add Global IDs

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Adds global IDs to a list of geodatabase feature classes, tables, and/or feature datasets.

Usage

  • GlobalIDs uniquely identify a feature or table row within a geodatabase and across geodatabases.

  • GlobalIDs are required for two-way and one-way replication.

Syntax

AddGlobalIDs_management (in_datasets)
ParameterExplanationData Type
in_datasets
[in_dataset,...]

A list of geodatabase classes, tables, and/or feature datasets to which global IDs will be added.

Layer; Table View; Dataset

Code sample

AddGlobalIDs Example (Python Window)

The following Python Window script demonstrates how to use the AddGlobalIDs function in the Python window.

import arcpy
from arcpy import env

env.workspace = "C:/data/MySDEdata.sde" 

arcpy.AddGlobalIDs_management("GDB1.Heather.Roads")
AddGlobalIDs Example 2 (stand-alone Python script)

The following Python script demonstrates how to use the AddGlobalIDs function with an SDE feature class.

# Name: AddGlobalIDs_Example2.py
# Description: Add globalIDs to a feature class. The feature class is in an SDE workspace.

# Import system modules
import arcpy
from arcpy import env

# Set workspace
env.workspace = "C:/Data/MySDEdata.sde"

# Set local variables
in_dataset = "GDB1.Heather.Roads"

# Execute AddGlobalIDs
arcpy.AddGlobalIDs_management(in_dataset)
AddGlobalIDs Example 3 (stand-alone Python script)

The following Python script demonstrates how to use the AddGlobalIDs function with multiple SDE feature classes.

# Name: AddGlobalIDs_Example2.py
# Description: Add globalIDs to a list of datasets. Both feature classes are in the same ArcSDE workspace.

# Import system modules
import arcpy
from arcpy import env

# Set workspace
env.workspace = "C:/Data/MySDEdata.sde"

# Set local variables
in_dataset1 = "GDB1.Heather.Roads"
in_dataset2 = "GDB1.Heather.Streets"

# Execute AddGlobalIDs
arcpy.AddGlobalIDs_management([in_dataset1, in_dataset2])

Environments

  • Current Workspace
  • Scratch Workspace

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Distributed Geodatabase toolset
  • Working with geodatabase replicas
  • ArcGIS field data types
  • Preparing data for replication
  • Replica creation and versioning

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal