Answer: Yes, we can reset the identity column
use the
dbcc checkident statement
example:
create table sales
(sno int identity(100,1),
sname varchar(10))
insert sales values('usb')
insert sales values('kbd')
select * from sales
sno sname
100 usb will be the output.
101 kbd
Now run this command.
dbcc checkident('sales',reseed,50)
the seed value will be reset to 50
Asked In: Many Interviews |
Alert Moderator