Regarding Clearing Auto Increment Value For Sql Table Variable [duplicate]
Possible Duplicates:
How can I reseed an identity column in a T-SQL table variable? Is there anyway to reset the identity of a Table Variable?
Please go through the below sample and clarify my Question ?
Declare @temp table (sno int identity, myname varchar(30))
insert into @temp开发者_如何学JAVA (myname) values ('Ravi')
insert into @temp (myname) values ('visu')
insert into @temp (myname) values ('pranesh')
delete from @temp
insert into @temp (myname) values ('Ravi')
select * from @temp
I am inserting 3 values in @temp table which has auto increment. And later deleting the Value. Immediately adding another value. In this the Auto increment value id jumped to 4. I need to clear the auto increment value with out using dbcc statement.
Can anyone help me ? Your suggestions are highly appreciated. Thank You.
You cannot insert explicit values into an identity column for table variable
精彩评论