Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset Identity value

Status
Not open for further replies.

omarmtz

Programmer
Nov 22, 2002
75
MX
I have the following:

create table a (
col1 int identity,
col2 varchar)

insert into a values ("test1") --> col1 = 1
insert into a values ("test2") --> col1 = 2
insert into a values ("test3") --> col1 = 3

but when i do a delete from a, and insert a new value, the identity value continues (col1 = 4)... i want to reset the value, but not using DROP!
Is there a function or method to reset the identity value??
 
If you do: 'truncate [tablename]' then the identity column will be reset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top