且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我们如何在sql的自动生成列中重新生成序列用户ID.

更新时间:2022-05-07 17:21:55

尝试以下操作:
1.将一列添加到表中,并使其标识为真,如下所示:
Try this:
1. Add a column to your table and make its identity true as shown below:
alter table Example
add NewColumn int identity(1,1)


2.然后从表中删除列emp_id .

3.用emp_id
重命名newcolumn
希望这行得通..


2. Then remove column emp_id from your table.
and
3. rename newcolumn with emp_id

Hope this works..