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 Chriss Miller 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
Joined
Nov 22, 2002
Messages
75
Location
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.
 
also, you can take a cool at:
DBCC CHECKIDENT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top