i set id as identity(1,1) column,i entered about 10 columns,i deleted the data.
after if we are entering data id starts at 11.but i need to start from 1.
can anyone says this............
plz urgent?
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.
Sanjeeb LenkaPosted Aug 28, 2013, 5:55 AM
delete will not reset the identity so truncate the data.
sql query to truncate:
Truncate Table Tablename
Rosi Sreenivasa ReddyPosted Aug 28, 2013, 6:31 AM
your logic is working but it is starting number as 2 .
DBCC CHECKIDENT('YourTableName', RESEED, 1) instead of 1 we have to set as 0 it is perfectly working.......................
Iftikar HussainPosted Aug 28, 2013, 5:54 AM
After deleting you need to reset the identity value like this
DBCC CHECKIDENT('YourTableName', RESEED, 1)
Regards,
Iftikar