当前位置: 代码迷 >> Sql Server >> 请问用SQL 脚本动态更改约束为Identity的列的种子
  详细解决方案

请问用SQL 脚本动态更改约束为Identity的列的种子

热度:8   发布时间:2016-04-27 15:29:55.0
请教用SQL 脚本动态更改约束为Identity的列的种子
大家好,
  请教个SQL Server的问题。可否用SQL 脚本动态更改约束为Identity的列的种子。例如 
Create Table Test(id int identity(1,1),name varchar(20))
创建该表后,我想用脚本更改id列的种子为10,怎么写?
使用Alter table test alter column id int identity(10,1) 
提示错误

谢谢


------解决方案--------------------
dbcc checkident(Test,reseed,10)
  相关解决方案