• OCTom (8/16/2010)


    Perhaps Microsoft should change it so that a PK or unique constraint must accompany an identity column? Like you say, it doesn't make sense to have it this way and is a potential problem.

    I don't see that happening. It could potentially break existing code that relies on identity values not being unique (why? don't ask me - people do the craziest things in SQL Server). And if MS would ban every option that you can use to shoot yourself in the foot, there wouldn't be a lot left...


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/