title: Reset all Identites to 1
body: <p>i have written code for reset all table's Identity to 1 but in some tables identity does not reset to 1 otherwise and will reset to 0 or 2 or other numeric
  this is  my code </p>
  
  <pre><code>    declare @Count int 
      declare @C int 
      declare @Str varchar(20)
      set @C=1
      set @Count=(select  COUNT(*) TABLE_NAME from INFORMATION_SCHEMA.TABLES )
      while @C&lt;@Count
      BEGIN
          with Records AS(select row_number() over(order by TABLE_NAME) as 'row1', *  
                      from INFORMATION_SCHEMA.TABLES)
          select  @Str=   TABLE_NAME from records
          where row1=@C
          set @C=@C+1
          DBCC CHECKIDENT (@Str , reseed, 0)
      END 
  </code></pre>