99热九九这里只有精品10,99国内精品久久久久久久软件,久久久亚洲最大ⅹxxx,99久久99久久精品免费,亚洲午夜电影在线观看,四虎少妇做爰免费视频网站四,亚洲第一在线播放

首頁 服務 產品 文檔 關于

SQL Identity自增列清零重置方法

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