【发布时间】:2013-06-25 07:37:18
【问题描述】:
不工作
ALTER TABLE ProductInProduct ALTER COLUMN Id KEY IDENTITY (1, 1);
检查图片
我有一个表 ProductInProduct 是希望它的 id 应该是唯一的..
【问题讨论】:
-
Not working 不是有效的 SQL Server 错误消息。顺便说一句:“unique 和 identity 是两个不同的概念。使列成为标识列并不一定使其唯一(也没有强制唯一性)
-
how to set auto increment after creating a table without any data loss? 的可能副本。我更喜欢这个,因为它展示了一种不需要大量数据移动的方法。
标签: sql sql-server sql-server-2008