HiLo or identity?

时光怂恿深爱的人放手 提交于 2019-12-04 13:21:41

If your application is only going to use one database, I'd go with an identity/sequence.

The only really compelling reason to go with HiLo that I've seen is when you could have two disconnected instances of your application that people can work on simultaneously and you need to reconcile the differences at some point

Ex. You are working on a content management system where people could be working on two different servers at different locations but the two need to be sync'd at some point

If you're using SQL Server 2005/2008 with a large table (> 1 million rows), you may want to consider this, which links to this. There's an issue with scope_identity() and @@identity under certain circumstances.

Of course, designing around a current implementation issue isn't always the wisest decision.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!