• Richard Warr (5/11/2011)


    A question that enables most people to get the correct answer after some careful thought is by no means "too simple". Especially as over 1/3 of respondants have got it wrong.

    For me this was close to a "Goldilocks" question. For some it's too hard, for others too soft, but for many, it's just right.

    I got it wrong... only because of two things.

    1. I've spent the past several weeks going through hundreds of tables with structures like

    CREATE TABLE staff(

    STAFFID INT IDENTITY(1,1) NOT NULL,

    STAFFNAME VARCHAR(100))

    CREATE UNIQUE CLUSTERED INDEX UCI_PK ON staff(STAFFID)

    At that point, just call the bloody thing a primary key.

    So I see INT IDENTITY(1,1) and these days I assume PRIMARY KEY is stuck on the end of it.

    Then I misread the answer that said it was a violation of the IDENTITY constraint. Which I know isn't a constraint... I was just rushed because I have a meeting in 10 min. 🙂

    Oops.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]