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
 Identity set , how to reset record no

Author  Topic 

shanmugaraj
Posting Yak Master

219 Posts

Posted - 2006-03-28 : 01:02:35

i have a table with the following fiels ,
Column Name DataType
Sno int Identity = Yes , Identity Speed =1 , Identity Increament =1
name char

Now i entered data and coneected to database, worked.Now after cheking all the data entered with the form , now i have to send the table to client place.
The problem is , the sno column has the value which i entered last. now if i delete all records , then also the record no doesnot become 0.
what i have to do, to set the sno column to 1 again.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-28 : 01:05:28
Instead of deleting the table, truncate it

Truncate table tableName

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

shanmugaraj
Posting Yak Master

219 Posts

Posted - 2006-03-28 : 01:20:02
Mr.Madhivanan,

Yea !!!!!!! IT WORKS
Thanks a Lot for replying me the answer.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-28 : 01:42:53
Well. Also look for DBCC CHECKIDENT in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -