Is using MS SQL Identity good practice?

前端 未结 5 1001
囚心锁ツ
囚心锁ツ 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:59

    The question is always:

    What are the chances that you're realistically going to migrate from one database to another? If you're building a multi-db app it's a different story, but most apps don't ever get ported over to a new db midstream - especially when they start out with something as robust as SQL Server.

    The identity construct is excellent, and there's really very few reasons why you shouldn't use it. If you're interested, I wrote a blog article on some of the common myths surrounding identity values.

    The IDENTITY Property: A Much-Maligned Construct in SQL Server

提交回复
热议问题