HOW TO
Instructions provided describe how to insert a value into a Global ID or Globally Unique Identifier (GUID) column in an Enterprise geodatabase, versioned views using Structured Query Language (SQL) in Microsoft SQL Server.
Global ID and GUID data types store registry style strings consisting of 36 characters enclosed in curly brackets. These strings uniquely identify a feature or table row within a geodatabase and across geodatabases. This is how features are tracked in one-way and two-way geodatabase replication and used in relationships or in any application requiring globally unique identifiers.
In a relationship, if a Global ID field is the origin key, a GUID field must be the destination key. Add Global IDs to a feature class in ArcCatalog by right-clicking the feature class and clicking Add Global IDs. The geodatabase maintains these values automatically. Create the GUID field in ArcCatalog, and maintain its values.
When inserting a row into a versioned view with a Global ID column using SQL, provide a unique GUID value for the Global ID column. As described in the procedure below:
Note: For more information related to Global IDs, GUIDs, and Geodatabase Replication, refer to the ArcGIS Desktop Help in the Related Information section.Examples provided are specific to Microsoft SQL Server; steps are similar for other supported databases.
exec sde.create_version N'sde.default', N'parcels_42',2, 2, 'Parcels Version' -- parcels_42 is the name of the version to create and 'Parcels Version' is the description.
exec sde.set_current_version 'parcels_42'
exec sde.edit_version 'parcels_42', 1
Note: newid() is a built-in function in SQL Server to create new unique GUID.
insert into sde.parcels_evw (parcel_id,Globalid) values (87701578, newid())
exec sde.edit_version 'parcels_42', 2
Get help from ArcGIS experts
Download the Esri Support App