Autoincremental field in mssql

alfonso

Guppy
How can I create a field that fill automatically with a number incremental: 1 for first record, 2 for second, etc...? It exist in Access 2000 but I don't know to do it in mssql

Thanks
 
its called a incrament field or instance..

you need to set the field type to int or big int or small int

then in the details section it says increment by 1 and one of the value above or below that .. that says replicate no repeats (or something like that).
 
In mssql you need to set the indentity property of an integer column. The seed and increment are 1 by default. In Enterprise manager go into the table designer and the options are available.

If you are creating tables via an SQL client, the syntax for the column is
[Column Name] [int] IDENTITY (1, 1) NOT NULL ,

Cheers.
 
thats the field.. i knew what it was, but couldn't remeber the name.

i knew where it was also ..lol
 
Back
Top