DBCC CHECKIDENT

  • Comments posted to this topic are about the item DBCC CHECKIDENT

    Microsoft Certified Master: SQL Server 2008
    MVP - Data Platform (2013 - ...)
    my blog: http://www.sqlmaster.de (german only!)

  • Surely the first reseed statement fails because of the use of 'RESEED' as a quoted string and not a keyword? The second reseed statement demonstrates its correct use.

    Regards, Jon Summers

  • This looks very similar to the question about a week ago... So a nice easy way to end a friday. 🙂

  • Jon Summers (1/3/2014)


    Surely the first reseed statement fails because of the use of 'RESEED' as a quoted string and not a keyword?

    No, either is allowed. Try it and see!

  • nice and easy, thanks for sharing

  • I figured a half-hour of research on this question was more than enough. I accept my fail. At least I didn't cheat! 😀

    And since I've never reset an identity value in 20 years, I feel okay not knowing this. 😉

    ron

    -----
    a haiku...

    NULL is not zero
    NULL is not an empty string
    NULL is the unknown

  • Michael Riemer (1/3/2014)


    This looks very similar to the question about a week ago... So a nice easy way to end a friday. 🙂

    +1 BTW, as written the code given should error. Wouldn't it be better to add an IF EXISTS ... to the first statement?

    {fixed typo}

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • ronmoses (1/3/2014)


    I figured a half-hour of research on this question was more than enough. I accept my fail. At least I didn't cheat! 😀

    And since I've never reset an identity value in 20 years, I feel okay not knowing this. 😉

    ron

    I don't recall doing it for anything other than development, or for a permanent temp table used for, say, importing EDI transactions, etc.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • Michael Riemer (1/3/2014)


    This looks very similar to the question about a week ago... So a nice easy way to end a friday. 🙂

    Unfortunately - yes 🙁

    I saw the mentioned QOTD after I had sent my question app. 1 week before!

    I would have expected that my question would not be posted short after the first one 🙂

    Happy new year to all...

    Microsoft Certified Master: SQL Server 2008
    MVP - Data Platform (2013 - ...)
    my blog: http://www.sqlmaster.de (german only!)

  • Thanks for an easy one, Uwe!

  • I have only ever used the reseed option in dev. However, I had used it recently enough to get this one right! 😀 Thanks for the question Uwe.

  • That`s similar to the previous CHECKIDENT question last week, but any way nice question.

    Thanks.

  • easy as -- answered about a week ago

    Hope this helps...

    Ford Fairlane
    Rock and Roll Detective

  • Nice question, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • ronmoses (1/3/2014)


    And since I've never reset an identity value in 20 years, I feel okay not knowing this. 😉

    ron

    Since transactional replication worked in standard edition of SQL 2000 while log shipping and other cleverer backup methods didn't (so implied increased licence costs for enterprise edition) and MS agreed with the interpretation of licensing terms that I didn't have to pay a SQL Server licence fee for the replica (because it was a standby copy) I used replication to provide a recovery copy. Testing recovery required resetting identity values, since the identity property had to be marked "not for replication", so I did a lot of resets for that purpose. I also did some for real when hardware problems entailed disaster recovery and forced it on me. So I made very sure that I and anyone else who might find themselves looking after recovery knew how identity reset worked.

    I guess, Ron, that either you were in a situation where money was easier so you could use other recovery methods, or you didn't have contractual very short term recovery times.

    Tom

Viewing 15 posts - 1 through 15 (of 16 total)

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