How can I create an autoincrement-field with SQL? Have I to use triggers? Has anybody a code-example for that.
Thank's a lot, Peter
Creating an autoincrement-field
To create autoincrement field you should use the IDENTITY option for relevant field. You can use the following code:
Code: Select all
CREATE TABLE TableName(
FieldName int IDENTITY(1,1) NOT NULL PRIMARY KEY)