Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Temporal data and implications

Author  Topic 

SergioM
Posting Yak Master

170 Posts

Posted - 2014-10-27 : 09:35:13
I'm working with a temporal database of inventory which is updated daily. It looks something like this:

TableID ProductID InventoryValue DateAdded DateExpired


The DateAdded field is placed when the row is inserted & each time new information is evaluated, it is considered against this row. DateExpired is finally set when a new row comes to replace it with a change in information. That part works.

The part that doesn't work is that often, my distributors will omit inventory as a way of specifying a 0 quantity value. So If I had 100 rows & now I have 95, this means that 5 are now out of stock. Considering the way that my db is set up, it's difficult to identify whether no change was made or if I did not receive the inventory value. How would you set it up such that this is a consideration?

-Sergio
I use Microsoft SQL 2008

SergioM
Posting Yak Master

170 Posts

Posted - 2014-10-27 : 09:42:41
Please disregard the post. I decided to add one more field (DateUpdated) which will be overwritten each time it is evaluated, even if the data does not change. This will give me the chance to age out inventory that has not been evaluated in n period of time. I'm concerned that performance will suffer, but I don't think it will be substantial & also don't see a way around it.

-Sergio
I use Microsoft SQL 2008
Go to Top of Page
   

- Advertisement -