IDENTITY (1, 1) : IDENTITY « Sequence « SQL Server / T-SQL






IDENTITY (1, 1)

1>
2> create table Players (
3>    Id int IDENTITY (1, 1) NOT NULL ,
4>    myGroup nvarchar  (10)
5> )
6> GO
1>
2> INSERT INTO Players(myGroup) VALUES ("g1")
3> GO

(1 rows affected)
1>
2> select * from Players
3> GO
Id          myGroup
----------- ----------
          1 g1

(1 rows affected)
1>
2> drop table Players
3> GO
1>

           
       








Related examples in the same category

1.Identity starting with -1000000
2.SQL Server chooses the highest number as its current seed for a positive increment value or the lowest for a negative increment value
3.SQL Server does not allow explicit values to be inserted into it
4.Now you explicitly enter a value for Identity column
5.Using Identity during data insert
6.Using IDENTITY value
7.Get current IDENTITY value
8.Seed value was negative and the increment was positive
9.Created with an IDENTITY property that is set to start at 1,000,000 and decrement by 100 for every row added
10.IDENTITY [ (seed , increment ) ]
11.IDENTITY as PRIMARY KEY