Is using MS SQL Identity good practice?

前端 未结 5 1004
囚心锁ツ
囚心锁ツ 2021-02-09 23:56

Is using MS SQL Identity good practice in enterprise applications? Isn\'t it make difficulties in creating business logic, and migrating database from one to another?

5条回答
  •  心在旅途
    2021-02-10 00:58

    Yes, they work very well and are reliable, and perform the best. One big benefit of using identity fields vs non, is they handle all of the complex concurrency issues of multiple callers attempting to reserve new id's. This may seem like something trivial to code but it's not.

    These links below offer some interesting information about identity fields and why you should use them whenever possible.

    1. DB: To use identity column or not?
    2. http://www.codeproject.com/KB/database/AgileWareNewGuid.aspx?display=Print
    3. http://www.sqlmag.com/Article/ArticleID/48165/sql_server_48165.html

提交回复
热议问题