Unique Identifier Columns in SQL Server

The use of identity columns or unique identifier (GUID) columns in Micromine Geobank can be problematic. This is true for any column that is generated by the database, e.g. as the result of a trigger.

Unique Identifier Columns

Given a table like the following:

When attempting to insert a record into the table from a Micromine Geobank data view, you may get the following exception:

You can get around this by setting the Initialisation options for the unique identifier column on the Initialisation page of the Column Property Editor.

The NEWID function returns a GUID, thereby providing a value for the required column.

Identity Columns

The identity column does not need to be initialised with a value. However, when an identity column is used as a foreign key in a master-detail relationship between two tables,  upon inserting a new record in the detail table, the value of the column is not copied down automatically. This has to be done manually - again using the Initialisation properties.

For example, several tables are linked on the DESPATCH_ID column (which is an identity column). When a new record is inserted into one of these tables, the value of DESPATCH_ID in the table may not be copied down automatically. However, we can do this manually by setting the Initialisation properties for that column:

In a data view, an identity column or unique identifier column would normally be hidden to prevent the user from typing values into that field.