ArcGIS Server Banner

Keyset tables in a geodatabase in SQL Server

Keyset tables in a geodatabase in SQL Server

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback
A keyset table is used to store a list of selected rows when an ArcGIS Desktop client executes a geodatabase relationship query that joins tables using attributes that are type integer, number, date, or string.

As discussed in Log file configuration options, log file tables store the OBJECTIDs of the selected features. Keyset tables are used to accommodate relationships using attributes other than the OBJECTID.

One keyset table is created per connection per session when there are more than 99 rows in the source set in the database query.

Keyset tables in ArcCatalog and ArcMap

You will not see keyset tables in ArcCatalog or ArcMap. However, you will cause a keyset table to be created and populated when you select more than 99 records in a feature class involved in a relationship class in ArcMap, then open the attribute table and use the Related Tables list in the Options menu to retrieve the related table. You will also cause a keyset table to be created if you edit.

Keyset tables in a SQL Server DBMS

No keyset tables are present in the geodatabase until one of two things happen:

When either of these two things happens, the keyset table is created as a global temporary table. In the first case, the keyset table is created and populated. In the second case, the keyset table is merely created but not populated until a qualifying selection set is made.

The keyset table name includes the name of the schema of the user who caused the keyset table to be created and the process identification number of the user's session. The format is as follows:

<user_schema>.##keyset_<process_id>_sde

The keyset tables store a keyset ID number for each qualifying selection set and values for the field on which the relationship between the feature classes is based.

Because it is a temporary table, the keyset table is deleted when the user disconnects from the database.

The following is a keyset table for a selection made between the related tables LATERALS and CONTRACTORS. In this case, the LONG_VAL field would be populated and contain the values of the CONTRACTOR_ID field on which the relationship class between LATERALS and CONTRACTORS is based.

Keyset table and its associated business tables in SQL Server

<user_schema>.##keyset_<process_id>_sde

The following is the definition for a keyset table in SQL Server:


Field name Field type Description
KEYSET_ID int Identifier for the keyset selection

LONG_VAL int Value of the field on which the relationship class is based, if that field is a number field

Nulls allowed
STR_VAL nvarchar(256) Value of the field on which the relationship class is based, if that field is a string field

Nulls allowed
DBL_VAL float Value of the field on which the relationship class is based, if that field is a floating-point number field

Nulls allowed
DATE_VAL datetime Value of the field on which the relationship class is based, if that field is a datetime field

Nulls allowed

Keyset tables in an XML document

Keyset tables do not get stored in an XML document because they are temporary tables.

See Also

  • Relationships between datasets in a geodatabase in SQL Server