What's the seed?

  • Comments posted to this topic are about the item What's the seed?

  • Nice question, thanks Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • Good question thanks Steve.

    ...

  • Steve, I found something interesting (in SQL Server 2014). If I repeat the inserts after the reseed and select all rows from the table, I get duplicate rows numbered 1,2,3,1,2,3. How is this possible? Shouldn't it be 1,2,3,4,5,6?

  • Cary Hower-563110 - Thursday, February 14, 2019 4:37 AM

    Steve, I found something interesting (in SQL Server 2014). If I repeat the inserts after the reseed and select all rows from the table, I get duplicate rows numbered 1,2,3,1,2,3. How is this possible? Shouldn't it be 1,2,3,4,5,6?

    This is quite correct. RESEED resets the starting value for IDENTITY.
    Given that the column is not defined as unique,duplicates will be encountered.

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • Thanks Stewart. I have always used identity columns as primary keys and never realized that it wasn't unique in and of itself.

  • If you create a primary key, then you do get uniqueness, but the identity property doesn't manage that. Common misconception

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply