DBCC CHECKIDENT

  • Uwe Ricken

    Hall of Fame

    Points: 3097

    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!)

  • Jon Summers

    Mr or Mrs. 500

    Points: 579

    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

  • Michael Riemer

    SSCarpal Tunnel

    Points: 4795

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

  • Toreador

    SSChampion

    Points: 11225

    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!

  • twin.devil

    SSC-Insane

    Points: 22208

    nice and easy, thanks for sharing

  • ronmoses@gmail.com

    SSCarpal Tunnel

    Points: 4480

    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

  • Thomas Abraham

    SSChampion

    Points: 10761

    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

  • Thomas Abraham

    SSChampion

    Points: 10761

    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

  • Uwe Ricken

    Hall of Fame

    Points: 3097

    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!)

  • Revenant

    SSC-Forever

    Points: 42467

    Thanks for an easy one, Uwe!

  • Ken Wymore

    SSCoach

    Points: 16354

    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.

  • Hany Helmy

    SSChampion

    Points: 13321

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

    Thanks.

  • Ford Fairlane

    SSCertifiable

    Points: 7664

    easy as -- answered about a week ago

    Hope this helps...

    Ford Fairlane
    Rock and Roll Detective

  • Koen Verbeeck

    SSC Guru

    Points: 258907

    Nice question, thanks.

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

  • TomThomson

    SSC Guru

    Points: 104763

    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