📅  最后修改于: 2022-03-11 15:05:11.685000             🧑  作者: Mango
-- Delete Record From table
DELETE FROM tbl_emp
WHERE id >= 4 ;
DECLARE @NewSeed NUMERIC(10)
-- Get the Last Value from the Table from where
-- You want to restore the Identity Column Value
SELECT @NewSeed = MAX(id)
FROM tbl_emp ;
-- RESEED the IDENTITY column Value
DBCC CHECKIDENT (tbl_emp, RESEED, @NewSeed)