personal reference

Reseeding SQL Server-s identity column

This post is for my personal reference since I need this once in a while and I always forget how it's done. This is usually needed when you want to "reset" some table and you can't truncate it because of foreign key constraints.

  1. DBCC CHECKIDENT (myTable, reseed, 0)
  2.  
  3. /* instead of 0, you can put other number */

Powered by Drupal, an open source content management system