• To add what Gail says, you need to run the query once saving the data into a temp table, wait for time, and then run again to compute the delta. Alternatively, run a job that polls the table every, say, 10 minutes. Be careful that a spid can log out and new connections and get the same spid!

    (And on the top of my head, I don't know what happens when a connection is reused in connection pooling.)

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]