SQL Server Performance

Identity

Discussion in 'Getting Started' started by browndee, Apr 26, 2007.

  1. browndee New Member

    Please explain the meaning of the below Statement, especially identity(1,1):

    Declare @Temp_Tasks table (seq int identity (1,1), TaskId uniqueidentifier)
  2. ghemant Moderator

    Hi,
    This will create an Identity Column on SEQ column,the first is a value (here 1) and second parameter is a incremental value (which is again 1 ), that means every time you insert a record in this table seq no generated automatically by 1 increment value e.g. 1,2,3,4 and so on.

    Refer Identity() column in BOL for more.

    Regards

    Hemantgiri S. Goswami
    MS SQL Server MVP
    -------------------------
    "Humans don't have Caliber to PASS TIME , Time it self Pass or Fail Humans" - by Hemantgiri S. Goswami

    http://hemantgirisgoswami.blogspot.com
  3. FrankKalis Moderator

    IDENTITY is a system generated monotonically increasing number. It is common practice to add this property to a numeric column and make that column the PK of a table.

    --
    Frank Kalis
    Moderator
    Microsoft SQL Server MVP
    Webmaster:http://www.insidesql.de

Share This Page