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

如何使用T-SQL语句将标识列设为否?
表名;mytable
列名;ID,   标识;是,   标识种子;1,   标识增量;1

如何使用T-SQL语句将标识列ID的标识设为否?


------解决方案--------------------
----允许对系统表进行更新
exec sp_configure 'allow updates ',1
reconfigure with override
GO

----查看标识列
select * from syscolumns where id = object_id( 'tablename ') and colstat = 1
----取消标识列标记
update syscolumns set colstat = 0 where id = object_id( 'tablename ') and colstat = 1
GO

----禁止对系统表进行更新
exec sp_configure 'allow updates ',0
reconfigure with override
GO