I would like to add an "ID" column whichwould be auto-increment .

  • I would like to add an "ID" column whichwould be auto-increment .All I want to do is take an existing table that already has values in the column that I want to change and add the identity

  • ALTER TABLE temp ADD

    test int NOT NULL IDENTITY (1, 1)

    GO

    This will add a column named test to the temp table. You will not specify any values for this column during inserts but it will start with the number 1 and increment for each record.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply