Coffee. Bilious substance. Good man.
Right.. Yep.. dumping it out once every five minutes is possible. I'd leave it in the db though, and every 5 minutes run:
SELECT * INTO myTableNow FROM myTable;
SELECT * FROM myTableNow
MINUS
SELECT * FROM myTable5minsAgo;
DROP TABLE myTable5minsAgo;
RENAME TABLE myTableNow TO myTable5minsAgo;
Note MINUS is Oracle's syntax. Something similar should be possible in SQLServer. If it won't do MINUS, then do:
Now LEFT JOIN 5mins ON Now.PK = 5Mins.PK WHERE 5mins.PK IS NULL
|