View Single Post
  #4 (permalink)  
Old 12-03-2008, 7:58 AM
cjard's Avatar
cjard cjard is offline
VB.NET Forum All-Mighty
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Apr 2006
Age: 65
Posts: 6,442
Reputation: 807
cjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond repute
Default

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
__________________
DW1 DW2 DW3 DW4 DNU PQ
Reply With Quote