Sequences I

  • TomThomson

    SSC Guru

    Points: 104773

    Nice question. It's good to see some SQL 2012 stuff now and again.

    I saw 0, 1, min(int), min(bigint) presented as options and decided I would have to find it in BoL; obviously if it had been a methematician who designed it I could forget about 1, but 0 was maybe possible (although far from optimal) and the thing would probably have type-flexibility (to cater for very long sequences when needed at the same time as allowing small numbers when vl sequences weren't needed) but that flexibility meant that the choice of which type would be default wasn't really constrained beyond the requirement for an integer type. So I had to find it in BoL instead of being able to guess the answer by applying common sense, which meant I did some useful reading again, which in turn meant that I thought it was a good question.

    Tom

  • Andre Guerreiro

    SSCertifiable

    Points: 7319

    I chose "1" as the default start value because I thought it would have the same behaviour of the IDENTITY property which defaults to "start with 1, increment 1". Seems I must study more closely this welcome new feature.

    That means one less problem converting code to/from Oracle. 🙂

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • andy mack

    Old Hand

    Points: 314

    Nice question. Got it wrong and learned something in the process 🙂 And sequences will be SQL 2012 exam questions so this is a great help.

  • Britt Cluff

    SSCertifiable

    Points: 5083

    Good question on a new feature. Thanks for submitting.

    http://brittcluff.blogspot.com/

  • Hardy21

    SSCrazy Eights

    Points: 9708

    Britt Cluff (4/23/2012)


    Good question on a new feature. Thanks for submitting.

    +1

    Thanks

  • demonfox

    SSCertifiable

    Points: 6289

    I don't have 2012 yet , I went through msdn

    http://msdn.microsoft.com/en-us/library/ff878091.aspx

    I thought the answer would be min(bigint)+1 ; and that wasn't listed ; didn't understand the defaults ..

    guess need to dig out more..

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • Dineshbabu

    Hall of Fame

    Points: 3220

    Before answering referred BOL many times, so i got it correct..

    --
    Dineshbabu
    Desire to learn new things..

Viewing 7 posts - 31 through 37 (of 37 total)

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