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
 General SQL Server Forums
 New to SQL Server Programming
 reset the primary key number to 1

Author  Topic 

cwtriguns2002
Constraint Violating Yak Guru

272 Posts

Posted - 2007-10-04 : 23:00:23
Hi all... how to reset the primary key to 1?

thanks
Ron

RON
________________________________________________________________________________________________
"I won't last a day without SQL"




khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-10-04 : 23:07:58
see http://www.sqlteam.com/article/understanding-identity-columns


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

cwtriguns2002
Constraint Violating Yak Guru

272 Posts

Posted - 2007-10-04 : 23:33:47
Hi KH, thanks for the link...but i can't find anywhere how to reset the primary key to 1.

thanks,
Ron

RON
________________________________________________________________________________________________
"I won't last a day without SQL"




Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-10-04 : 23:40:32
look under "Deleting rows from a table with an Identity Column"
quote:

To reset the identity seed you need to use a DBCC command. . . . .



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -