Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个具有标识属性的列,并且我想指定它的最大值。
例如:
CREATE TABLE tbl ( ID int PRIMARY KEY identity(1,1) )
我想指定 20000 作为 ID 的最大值。
alter table tbl add constraint CHK_TBL_MAX_ID check (id <= 2000)
SQL Fiddle 的示例。