Scope_Identity() 返回不正确的值已修复?

我一直在寻找答案,我想我会求助于 stackoverflow 社区.由于这个错误,我一直在避免在 sql server 和 nhibernate 中使用类型标识字段:http://connect.microsoft.com/SQLServer/feedback/details/328811/scope-identity-sometimes-returns-incorrect-value

I've been searching hi and low for an answer to this and figured I would turn to the stackoverflow community. I have been avoiding using type identity id fields fields within sql server and nhibernate due to this bug: http://connect.microsoft.com/SQLServer/feedback/details/328811/scope-identity-sometimes-returns-incorrect-value

但是,我刚刚注意到它被标记为已修复.

However, I just noticed that it was marked as fixed.

有人知道这是否适用于最近发布的 SQL 服务器服务包吗?我找不到答案是肯定的或否定的.

Does, anybody know if this applies to the recent SQL server service pack that was released? I can't find a yes or no to this.

推荐答案

我的建议是尝试查询并测试您的结果.对此有许多变通方法,例如 Output 子句和 run query not in parralel.

My suggestion would be to try the query and test your results. There are a number of work arounds on this such as Output clause and run query not in parralel.

有关此信息,请参阅 Microsoft KBhttp://support.microsoft.com/kb/2019779

See Microsoft KB on this http://support.microsoft.com/kb/2019779

还有一个帖子表明不确定是否在 2008 SP1 中修复,但可能在 2008 R2 中修复

Also a post on this that indicated not sure if fixed in 2008 SP1 but may be fixed in 2008 R2

http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/

相关文章