Checking and Changing Identity Seed using DBCC CHECKIDENT#
Checking and Changing Identity Seed using DBCC CHECKIDENT... I recently had to change the properties of a column that was the PK in a table with about 2 million rows. Within SQL Server Studio (SQL Server 2005), modifying the table directly, would generate a sql server timeout error, no doubt due to the large number of rows. In order to change the indentity seed, I had to use a built in stored proc.

For checking:
DBCC CHECKIDENT ('TableName', NORESEED)

For Altering:
DBCC CHECKIDENT ('TableName', RESEED, Your#)

I am posting this for my own reference because I had used this before and could not remeber the command and had a damn hard time finding it on Google.

10/23/2005 11:56:09 PM (Eastern Standard Time, UTC-05:00) #    Comments [0]  |  Trackback

 

All content © 2008, Xfernal
On this page
This site
Calendar
<December 2008>
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Archives
Sitemap
Blogroll OPML
Scott Schecter
Entropy Expounded
Venexus DotNetNuke Blog
Articles, Code Snippits, and News from the DNN frontline.
Disclaimer

Powered by: newtelligence dasBlog 1.8.5223.1

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: