Anyone know of any temporal (http://en.wikipedia.org/wiki/Temporal_database) extensions to SQL Server?
Temporal tables (also known as system-versioned temporal tables) are a database feature that brings built-in support for providing information about data stored in the table at any point in time, rather than only the data that is correct at the current moment in time.
Temporal tables are considered as one of the critical features used to audit SQL Server data. The two period columns which are of datetime2 data type, SysStartTime and SysEndTime define the current and historical data for every row of the table. It defines the validity of the data.
I know this is an old question, but the usual solution in SQL Server is to create a "Date Dimension" database that you can join in your query. A DateDim is basically just a list of dates, but it includes columns like fiscal quarter and calendar quarter number, first/last day of that month, etc.: stuff that's difficult or time consuming to calculate on the fly but is easy to pull from a joined table.
If you search "sql date dimension" you'll find some code that will generate the table for you, though you'll need to tweak it to fit your needs. They tend to run day-by-day, but if you need hourly tracking you'll need to alter the code accordingly, for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With