Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 reset an AutoNumber field value

Author  Topic 

ITpassenger
Starting Member

6 Posts

Posted - 2011-08-09 : 00:51:15

How to reset an AutoNumber field value in SQL server 2005 ??

i get the steps in Access
but what about SQL server DB??

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-09 : 01:06:37
By reset, do you mean change the starting number? If so, check out DBCC CHECKIDENT in Books Online. If that isn't what you want, well please be more specific. Perhaps you are thinking about removing gaps.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

ITpassenger
Starting Member

6 Posts

Posted - 2011-08-09 : 01:15:49
Hi tkizer

i mean like this steps but for SQL server
http://support.microsoft.com/kb/812718
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-08-09 : 10:52:51
As Tara said, DBCC CHECKIDENT is what you want.

If you want to delete all the data and reset it, then TRUNCATE the table.
Go to Top of Page

ITpassenger
Starting Member

6 Posts

Posted - 2011-08-10 : 05:29:05
Thanks russell,
i used TRUNCATE and is worked
Go to Top of Page
   

- Advertisement -