• nigel. (4/19/2010)


    Hugo,

    Thanks for the input.

    Which would you say is correct, the implementation as it stands or BOL?

    Hi Nigel,

    Tough question. We can't really look in the minds of the developers who originally wrote the feature, so we can only speculate.

    And frankly, I see little reason to do an INSERT with an IDENTITY, and then first do another INSERT before testing SCOPE_IDENTITY, so I really would not mind much if Microsoft decides to change the docs, not the implementation. Given the similarlty to @@IDENTITY pointed out elsewhere in this discussion, that might very well even be the originally intended behaviour.


    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/