What is seed and reseed in SQL Server?

9470 pts.
Tags:
SQL Server administration
What is seeding and reseeding in SQL Server? How to use it? Where is it used? What is the purpose?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hello,

The term seed refers to the internal value SQL Server uses to generate the next value in the sequence. By default, an identity column’s first value is 1 and each new value increments by one (1, 2, 3, 4, and so on).

You can control the column’s first and subsequent values, by specifying those values when you create the column. For instance, you might want to begin with a purchase order number of 1001 rather than 1.

Once the table’s in production you can reset, or reseed the column. In other words, you can change the column’s seed value at any time. For instance, you might reseed a column after deleting records or moving data to an archive table.

The good news is that seeding and reseeding an identity column is easy and relatively safe, if you do it correctly. It’s common to seed a new table or to reseed a production, but empty table. However, as a general rule, it’s not a great idea to reseed an identity column in a table that contains data without some serious checks and balances.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Denny Cherry
    Check out my SQL Server blog "SQL Server with Mr Denny" for more SQL Server information.
    66,360 pointsBadges:
    report
  • Jaideep Khanduja
    Thanks Tpinky for the reply, i was wondering if the seed value can be assigned a value zero.
    9,470 pointsBadges:
    report
  • Jaideep Khanduja
    Thnx MrDenny, that link was really helpful.
    9,470 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following