IDENTITY Property (SQL Server Compact Edition)
Creates an identity column in a table. This property is used with the CREATE TABLE and ALTER TABLE statements.
Syntax
IDENTITY [ (seed,increment) ]
Arguments
- seed
The value that is used for the first row loaded into the table.
increment
The incremental value that is added to the identity value of the previous row that was loaded.Note
You must specify both the seed and increment, or neither. If neither is specified, the default is (1,1).
Remarks
In Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition), the IDENTITY property can be created only on a column of data type integer or bigint. A table can have only one IDENTITY column.
Example
This example creates a two-column table in which the first column is an IDENTITY column.
CREATE TABLE MyCustomers (CustID int IDENTITY (100,1) PRIMARY KEY, CompanyName nvarchar (50))
See Also
Reference
ALTER TABLE (SQL Server Compact Edition)
CREATE TABLE (SQL Server Compact Edition)