亚洲视频在线网站,就爱操av,一级特黄aa大片免费播放小说,国产模特av私拍大尺度,777久久久精品一区二区三区,久久久久日本精品毛片蜜桃成熟时,av在线区

首頁 服務(wù) 產(chǎn)品 文檔 關(guān)于

SQL Identity自增列清零重置方法

1.使用DBCC控制臺(tái)命令:
dbcc checkident(表名,RESEED,0)
2.truncate table 也可將當(dāng)前標(biāo)識(shí)值清零
但當(dāng)有外鍵等約束時(shí),無法truncate表
可以先禁用外鍵約束來truncate表:
--禁用外鍵約束
exec sp_msforeachtable 'alter table ? nocheck constraint all'
--清空數(shù)據(jù)
truncate table 表名
--啟用外鍵約束
exec sp_msforeachtable 'alter table ? check constraint all'
常用 truncate table 進(jìn)行數(shù)據(jù)表內(nèi)數(shù)據(jù)的清空,同時(shí)將ID列重新開始計(jì)數(shù)!
truncate table 課程表
truncate table 學(xué)生表
truncate table 選課表