TSQL: Reset Table Identity Value with Reseed

The following example reseeds the identity value back to 1 for the table [schema]/[tablename]…this is useful for example after executing a truncate table where you need to reload the table from identity value 1 again :


DBCC CHECKIDENT ("[schema].[tablename]", reseed, 1)

About AussieBICG

Connect with me here https://au.linkedin.com/in/aussiebicg

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