[實作筆記]查找與重建 Table 的索引值

查詢指定 Table 目前的索引值

DBCC CHECKIDENT (yourtable)

Example

1
2
3
4
USE AdventureWorks2012;  
GO
DBCC CHECKIDENT ('Person.AddressType');
GO DBCC CHECKIDENT (memberAccount)

重新建立你的索引值

DBCC CHECKIDENT (yourtable, reseed, new index)

1
2
3
4
USE AdventureWorks2012;  
GO
DBCC CHECKIDENT ('Person.AddressType', RESEED, 10);
GO

參考

(fin)