How to Reset Identity column in SQL Server

You might find the need to reset the identitity column count after deleting all records form a table or for any other purpose. The following code does just that!

DBCC CHECKIDENT('tablename', RESEED, 0)

Advertisements
Tagged

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: