Nov 27, 2012

Identity Value Reset in SQL Server

11/27/2012 11:03:00 PM



--DBCC CHECKIDENT (yourtable, reseed, 34) Reset table using identity Value

 create table Reset_identity(ino int IDENTITY(1,1),name varchar(20))

  insert into Reset_identity(name) Values('Munish')
 
  select * from Reset_identity
 
  Result
  ino name
   1  Munish
   2  Munish
  
 
  DBCC CHECKIDENT ('Northwind.dbo.Reset_identity', RESEED, 10000);
 
  insert into Reset_identity(name) Values('Munish') -2 Rows inserted.
 
  select * from Reset_identity
 
  Result
  ino name
    1 Munish
      2     Munish
      3     Munish
      10001 Munish
      10002 munish

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

Recent Posts
Popular Articles

 

© 2013 MUNISH ORACLE DBA& .Net Developer. All rights resevered. Designed by Templateism

Back To Top