Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 identity

Author  Topic 

mcm
Starting Member

6 Posts

Posted - 2008-07-22 : 10:38:50
hello

what does the identity keyword actually do?

tx

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-07-22 : 10:41:10
It is used in two ways.

1) When creating a column, you can make the column as an IDENTITY column.
2) When creating a table on the fly, you can make a column as an IDENTITY column.

The purpose of an IDENTITY column is the make the database provide a sequential number for you, so you do not have to figure out one for yourself.
And if you put a UNIQUE constraint on the same column, you guarantee that no number will be a duplicate.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-22 : 10:41:43
quote:
Originally posted by mcm

hello

what does the identity keyword actually do?

tx



Did you read it in sql server help file?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -