Blog from Saravanan Arumugam

Let us talk about Technologies

Identity column Reseeding


I just came up with a need to reseed one of the tables I filled and deleted for testing purpose. (Reseeding is a process of making the table’s identity column start counting from a specified number for upcoming inserts)

Following command helped me achieve it.

DBCC CheckIdent ( myTable, Reseed, 1 )

Complete syntax of this command is

DBCC CHECKIDENT 
( ‘
table_name 
     [ 
, { NORESEED 
            | { RESEED [ , new_reseed_value ] } 
        } 
    ] 
)

References:  

DBCC CHECKIDENT

How do I… Reseed a SQL Server identity column?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: