myLittleTools Community Forum

Welcome Guest Search | Active Topics | Members | Log In | Register

can you reset an identity column? Options · View
topper
Posted: Thursday, March 27, 2008 7:28:14 PM
Rank: Newbie
Groups: Member

Joined: 3/24/2008
Posts: 1
Points: 0
The identity column in my db (w/ 1&1) is also my primary key column. I have been testing code, but would like to now 'start from scratch.' Which, to me, means having new records start with 1. What is the best way to do this?

(I know it is an unnecessary step, it's just my Obsessive Compulsion sneaking out.)

TIA

Topper
elian
Posted: Friday, March 28, 2008 10:25:42 AM

Rank: Administration
Groups: Administration

Joined: 9/11/2006
Posts: 605
Points: 649
Location: Enghien Les Bains, France
Try to execute the following T-SQL script:

Code:
DBCC CHECKIDENT (yourTableName, RESEED, 1)


Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Theme created by myLittleTools
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.