Business Intelligence Blogs

View blogs by industry experts on topics such as SSAS, SSIS, SSRS, Power BI, Performance Tuning, Azure, Big Data and much more! You can also sign up to post your own business intelligence blog.

Reset Identity Column in SQL

  • 10 August 2011
  • Author: BradSchacht
  • Number of views: 5161
  • 0 Comments

I'll be honest, I am partially writing this because I always forget how to reset the identity column on a table and I want to be able to just pull up my blog and look it up. Yet again today I had to do this and I couldn't remember the exact syntax, so here it is. The next record is going to be the seed value plus 1, or in the case of this example I will use zero so the first record is 1. That will make my O.C.D. happy to see my table starting with a key value of 1!

DBCC CHECKIDENT('', RESEED, )

DBCC CHECKIDENT('DimGeography', RESEED, 0)

Print
Tags:
Rate this article:
No rating
BradSchacht

BradSchachtBradSchacht

Other posts by BradSchacht

Please login or register to post comments.