如何将身份添加到存在列 [英] how to add identity into exist column
本文介绍了如何将身份添加到存在列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将identity(1,1)添加到表的现有列中
how to add identity(1,1) into existing column in a table
推荐答案
AFAIK,您无法将IDENTITY
属性添加到现有列.
但是,您可以在表中添加新的IDENTITY
列:
AFAIK, you cannot add theIDENTITY
property to an existing column.
However, you can add a newIDENTITY
column to the table:
ALTER TABLE Users ADD UserID int NOT NULL IDENTITY(1,1)
我相信,只要没有重复的值,就可以在设计视图中编辑表格以具有此功能.但是,在事实之后添加内容似乎很奇怪?
You can edit a table in the design view to have that, so long as there''s no repeating values, I believe. However, it seems like an odd thing to add after the fact ?
这篇关于如何将身份添加到存在列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文