Auto-increment primary key in SQL tables

前端 未结 6 1183
执念已碎
执念已碎 2020-12-02 16:54

Using Sql Express Management Studio 2008 GUI (not with coding), how can I make a primary key auto-incremented?

Let me explain: there is a table which has a column na

6条回答
  •  Happy的楠姐
    2020-12-02 16:58

    I think there is a way to do it at definition stage like this

    create table employee( id int identity, name varchar(50), primary key(id) ).. I am trying to see if there is a way to alter an existing table and make the column as Identity which does not look possible theoretically (as the existing values might need modification)

提交回复
热议问题