Autonumbering and Identifier Columns

Creating and Maintaining Databases

Creating and Maintaining Databases

Autonumbering and Identifier Columns

For each table, a single identifier column can be created that contains system-generated sequential values that uniquely identify each row within the table. For example, an identifier column can generate unique customer receipt numbers for an application automatically as rows are inserted into the table. Identifier columns usually contain values unique within the table on which they are defined. This means that other tables containing identifier columns can contain the same identity values used by another table. However, this is usually not a problem because the identifier values are typically  used only within the context of a single table, and the identifier columns do not relate to other identifier columns in other tables.

A single, globally unique, identifier column can be created per table that contains values unique across all networked computers in the world. A column guaranteed to contain globally unique values is often useful when similar data from multiple database systems must be merged (for example, in a customer billing system with data located in various company subsidiaries around the world). When the data is merged into the central site for consolidation and reporting, using globally unique values prevents customers in different countries from having the same billing number or customer ID.

Microsoft® SQL Server™ 2000 uses globally unique identifier columns for merge replication to ensure that rows are uniquely identified across multiple copies of the table.

See Also

Creating and Modifying Identifier Columns

Merge Replication

NEWID

uniqueidentifier

Using Uniqueidentifier Data