What is the best way to store historical data in SQL Server 2005/2008?

后端 未结 8 943
刺人心
刺人心 2021-02-12 10:55

My simplified and contrived example is the following:-

Lets say that I want to measure and store the temperature (and other values) of all the worlds\' towns on a daily

相关标签:
8条回答
  • 2021-02-12 11:26

    Another alternative could be to go for one table for all data and have a view for the current temperature. This will not help performance but could well aid readability/maintainability. You could even go for an indexed view to improve performance if you have the appropriate version of sql .

    0 讨论(0)
  • 2021-02-12 11:34

    If you store all in one table how are you going to make a relational database.

    Example:

    id--------------GUID----PK

    record_id-------GUID

    every time a new record will be inserted the [id] will change but [record_id] will remain same. Now if you have to link it with address table how are you going to do that?

    0 讨论(0)
提交回复
热议问题