How to store historical records in a history table in SQL Server

后端 未结 9 981
失恋的感觉
失恋的感觉 2020-11-28 21:24

I have 2 tables, Table-A and Table-A-History.

  • Table-A contains current data rows.
  • Table-A-History c
9条回答
  •  情歌与酒
    2020-11-28 21:41

    Even though it consumes more space, having the history table containing the most recent record as well will save you pain on writing reports and seeing how changes occurred and when. Something worth thinking about in my opinion.

    As far as performance, I would expect them to be identical. But, you certainly wouldn't want to delete the record (option 1's "move") from the non-hist table because you are using referential integrity between the two tables, right?

提交回复
热议问题