Hi,
how can reset the identity column in Sql Server ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Apr 28, 2012, 11:30 PM
Hope this will help you.
Satyapriya NayakPosted Apr 28, 2012, 2:43 PM
Please refer the below link
http://www.codeproject.com/Tips/264381/How-to-RESET-identity-column-in-SQL-Server
Thanks
MuthuMari MPosted Apr 28, 2012, 12:55 PM
Using the DELETE/Truncate statement is not enough. The statement only deletes the data but not reset the identity column.
So how can we do it? First, wen need to delete the data from the table(truncate the table) and after execute the DBCC command with CHECKIDENT switch in order to reset the data
The following line resets the Identity value for the Customer table to 0 so that the next record added starts at 1.
DBCC CHECKIDENT('Customer', RESEED, 0)thanks
If this post is useful then mark it as "Accepted Answer"
brunda kPosted Apr 28, 2012, 9:11 AM
(
table_name
[, { NORESEED | { RESEED [, new_reseed_value ] } } ]
)
[ WITH NO_INFOMSGS ]
http://msdn.microsoft.com/en-us/library/ms176057.aspx
NIlesh PatelPosted Apr 28, 2012, 7:48 AM
It can not Possible to Reset Identity Column In Sql Server. But By using 'Truncate Table Tablename ' This Query It can Reset But Data Also Deleted.