Auto-Numbering 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 usually used only within the context of a single table; 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 that is 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™ uses globally unique identifier columns for merge replication to ensure that rows are uniquely identified across multiple copies of the table.

SQL Server uses the IDENTITY and ROWGUIDCOL properties to implement identifier columns.

See Also
Creating and Modifying Identifier Columns uniqueidentifier
Merge Replication Using Uniqueidentifier Data
NEWID  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.