Negative Primary Keys

前端 未结 9 2058
青春惊慌失措
青春惊慌失措 2020-12-10 11:25

Are there any repercussions using Negative Primary Keys for tables (Identity Increment -1, Identity Seed -1 in SQL Server 2005)?

The reason for this is we\'re creati

9条回答
  •  旧巷少年郎
    2020-12-10 11:36

    Another option is to prefix the legacy keys with a string like "OLD_". The ony problem is your key field will be non-numeric.

    If you have to have numeric keys, you could introduce a "legacy" indicator column, and the primary key would be a combination of the numeric ID and the legacy indicator (hopefully, that combination should be unique).

提交回复
热议问题