Sql Server using DateTime as Primary Key

前端 未结 4 1951
被撕碎了的回忆
被撕碎了的回忆 2021-01-02 00:10

Hi my questions is similar to:

MySQL: Using DATETIME as primary key

But I\'m specifically interested in Sql Server and I want to approach the question practi

4条回答
  •  一生所求
    2021-01-02 00:26

    Yes you can, but it sounds like a very bad idea to me. If you are really worried about performance, you can use a sequential unique identifier, an auto-incrementing integer, or you can give the DateTime column its own clustered index (recommended).

提交回复
热议问题