• Henrico Bekker (4/16/2012)


    got it wrong, as the correct answer wasn't listed.

    your syntax is wrong in, sequence wouldn't be created to start of with...no increment value, no 'AS'..etc.

    When I look at BOL I see the following:

    CREATE SEQUENCE [schema_name . ] sequence_name

    [ AS [ built_in_integer_type | user-defined_integer_type ] ]

    [ START WITH <constant> ]

    [ INCREMENT BY <constant> ]

    [ { MINVALUE [ <constant> ] } | { NO MINVALUE } ]

    [ { MAXVALUE [ <constant> ] } | { NO MAXVALUE } ]

    [ CYCLE | { NO CYCLE } ]

    [ { CACHE [ <constant> ] } | { NO CACHE } ]

    [ ; ]

    This means that everything is optional except the first line. MSDN also lists every default value for every line.

    edit: Example E in the MSDN article is exactly the same as the QotD.

    Anyway, awesome question. Really like the SQL Server 2012 questions!

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