Click here to Skip to main content
15,914,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.

i have created a Table in Sqlserver 2008r2 as below:

Table=Country(CountryId (Int,not null,Unique Index) ,CountryName (NvarChar))

I had inserted data into this table , but i decided to delete them , now when i want to reinsert data into the table , it has memorized it's previous Indexes and
CountryId starts from (for example 14), while i want to start it from number 1.
what shall i do?
Posted

1 solution

I guess you don't have access to google ? I typed your question in to google and got this:

DBCC CHECKIDENT ('mytablename', RESEED, new identity value)

In other words

DBCC CHECKIDENT ('Country', RESEED, 1)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900