#publisher [tr?id=335401813750447&ev=PageView&noscript=1] How-To Geek (BUTTON) Subscribe * News * Features * Windows * Smart Home * Explore ____________________ Go * Windows * Mac * iPhone * Android * Smarthome * Office * Security * Linux * News * Features * Review Geek * LifeSavvy * About Us * Contact Us * Geek Talk X ____________________ Go Popular Searches * Windows 10 * Speed Up PC * Chromecast * Windows * Mac * iPhone * Android * Smarthome * Office * Security * Linux * News * Features * Review Geek * LifeSavvy * About Us * Contact Us * Geek Talk X The Best Tech Newsletter Anywhere Join 250,000 subscribers and get a daily digest of news, geek trivia, and our feature articles. ____________________ Go Skip to content Reset Identity Column Value in SQL Server [36x36xScreen-Shot-2018-08-27-at-1.40.32-AM.png.pagespeed.gp+jp+jw+pj+w s+js+rj+rp+rw+ri+cp+md.ic.z5TGA0rtd1.jpg] Lowell Heddings @lowellheddings March 7, 2007, 1:06pm EDT If you are using an identity column on your SQL Server tables, you can set the next insert value to whatever value you want. An example is if you wanted to start numbering your ID column at 1000 instead of 1. It would be wise to first check what the current identify value is. We can use this command to do so: DBCC CHECKIDENT (‘tablename’, NORESEED) For instance, if I wanted to check the next ID value of my orders table, I could use this command: DBCC CHECKIDENT (orders, NORESEED) To set the value of the next ID to be 1000, I can use this command: DBCC CHECKIDENT (orders, RESEED, 999) Note that the next value will be whatever you reseed with + 1, so in this case I set it to 999 so that the next value will be 1000. Another thing to note is that you may need to enclose the table name in single quotes or square brackets if you are referencing by a full path, or if your table name has spaces in it. (which it really shouldn’t) DBCC CHECKIDENT ( ‘databasename.dbo.orders’,RESEED, 999) READ NEXT * › What Does GG Mean, and How Do You Use It? * › How New Emoji Are Born (and How to Propose Your Own) * › How to Use Sparklines in Google Sheets * › How to Use the stat Command on Linux * › What Is “Project Connected Home Over IP” for Smart Homes? Lowell Heddings Lowell Heddings Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work. Read Full Bio » JOIN GEEK TALK ON FACEBOOK [INS: :INS] How-To Geek is where you turn when you want experts to explain technology. Since we launched in 2006, our articles have been read more than 1 billion times. Want to know more? How-To Geek Facebook Twitter LinkedIn The Best Tech Newsletter Anywhere ____________________ Sign Up * About Us * Contact Us * Join Our Team * Advertising * Privacy Policy * Terms of Use © 2020 LifeSavvy Media. All Rights Reserved How-To Geek x The Best Tech Newsletter Anywhere Join 250,000 subscribers and get a daily digest of news, comics, trivia, reviews, and more. ____________________ Yes, I Want the Best Newsletter [p?c1=2&c2=10055482&cv=2.0&cj=1] Quantcast