[/code language="sql"]
--drop and create a table
drop table t6
CREATE TABLE t6(id int IDENTITY);
INSERT t6 DEFAULT VALUES;
INSERT t6 DEFAULT VALUES;
INSERT t6 DEFAULT VALUES;
INSERT t6 DEFAULT VALUES;
INSERT t6 DEFAULT VALUES;
INSERT t6 DEFAULT VALUES;
--look at the result of our handiwork
select * from t6
select ident_current( 't6')
--delete two lines, and look again
delete t6 where id = 6
delete t6 where id = 5
select * from t6
--reset the seed, and look again
declare @intID int
select @intID = max(id) from t6
DBCC CHECKIDENT('t6', RESEED, @intID)
INSERT t6 DEFAULT VALUES;
select * from t6
[/code]