日期:2014-05-18  浏览次数:20352 次

请教用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)