Is This Content Helpful?
We're glad to know this article was helpful.
Instructions provided describe how to insert a value into a Global ID or Globally Unique Identifier (GUID) column in an ArcSDE multiversion view using Structured Query Language (SQL) for 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 ArcCatalog 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 multiversion view with a Global ID column using SQL, provide a unique GUID value for the Global ID column. As described in the procedure below:
For more information related to Global IDs, GUIDs, and Geodatabase Replication, refer to the ArcGIS Desktop Help installed with ArcGIS Desktop or the link available in Related Information.
sdetable -o create_mv_view -T parcels_mv -t parcels -i 5176 -u user1 -p ***** -D <DataBase_Name> -s <Machine_name>
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
insert into sde.parcels_mv (parcel_id,Globalid) values (87701578, newid())
newid() is a built-in function in SQL server to create new unique GUID.
exec sde.edit_version 'parcels_42', 2