We are developing a real-time web application in Asp.Net 4.5 that has a few charts.
We also have a SQL Server 2008 with a table that feeds the charts.
The charts should be refreshed if any record inserted has X minutes is found. Where X are the minutes that have passed after a record was created. For example, if X = 20 min, we would check if any record is 20 minutes old in this way getdate() - table.CreationDate = 20 minutes.
We already tried with SqlDependency
but it has some limitations like no computed columns are allowed, so we cannot do something like
SELECT id,
CASE WHEN DATEDIFF(mi, table.CreationDate, getdate()) = 20 THEN 1
ELSE 0
END Send
FROM table
How can we make this done?