• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

set index to 1

i deleted all the rows of my table

but the 'id' auto increment column is still at the same number

I want it to start at 1 again
0
rgb192
Asked:
rgb192
1 Solution
 
radcaesarCommented:
DBCC CHECKIDENT('Table1', RESEED, 0)
0
 
8080_DiverCommented:
And, next time, try using TRUNCATE TABLE yourtablename if you can.

TRUNCATE not only removes all the rows but it also does it faster and it resets the Identity column's seed so that it starts at 1.
0
 
rgb192Author Commented:
thanks
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now