|
-
Feb 8th, 2005, 10:55 AM
#1
reset Identity field
Is there a SQL command or something i can do on SQL Server 2000 to reset an ID field to its starting number in a table that has no records?
I know I can just delete the ID field and redd it, but I am wondering if there is a way to do this without removing and readding the field.
-
Feb 8th, 2005, 11:16 AM
#2
Re: reset Identity field
Two ways
Execute a Truncate Table command or DBCC CheckIdent command.
DBCC CHECKIDENT - Checks the current identity value for the specified table and, if needed, corrects the identity value.
Code:
Syntax
DBCC CHECKIDENT
( 'table_name'
[ , { NORESEED
| { RESEED [ , new_reseed_value ] }
}
]
)
-
Feb 8th, 2005, 11:59 AM
#3
Re: reset Identity field
thanks. I used Truncate Table to do it.. I am just working on a conversion and we have to do lots of test imports... so I don't want the autonumbers getting too high..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|