Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2005, 10:51 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reseeding the identity

I have a table in a development db that has had data added to it and cleared from it several times. As a result, my primary key value is getting very large. Is there any way to reset the PK value back to the increment seed value without dropping the table and recreating it?

Thanks in advance for your comments.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old March 10th, 2005, 11:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

DBCC CHECKIDENT (<<tablename>>, RESEED, newvalue)
 
Old March 10th, 2005, 12:06 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much!

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.





Similar Threads
Thread Thread Starter Forum Replies Last Post
@@IDENTITY use... neo_jakey Classic ASP Professional 1 May 3rd, 2008 06:47 AM
User Identity stonesbg ASP.NET 2.0 Basics 1 February 9th, 2007 11:14 AM
@@IDENTITY Problem datagram Pro VB.NET 2002/2003 2 May 19th, 2005 01:34 PM
what does identity do amruthhr SQL Server 2000 2 January 6th, 2005 09:45 AM
Identity soccers_guy10 SQL Server 2000 3 September 2nd, 2003 07:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.