简体   繁体   English

在SQL Server自动递增列中自定义起始ID

[英]Customize starting id in SQL Server auto-increment column

I have to start my auto-increment column of my table in SQL Server from 1000. In default it starts from 1. Now I have to customize that. 我必须从1000开始在SQL Server中创建我的表的自动增量列。默认情况下,它从1开始。现在我必须对其进行自定义。

Is that possible?? 那可能吗??

I think in create table the syntax is 我认为在创建表的语法是

column_name data_type identity(startingValue(seed), increment)

so that in your case it's 所以在你的情况下

create table table_name ( id int identity(1000 , 1) )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM