| Author |
Topic  |
|
|
elic05
Yak Posting Veteran
62 Posts |
Posted - 11/23/2010 : 12:53:00
|
is their a way that i can tell the db to check a specific field in a table at set intervals
i want it to run a check every 2 minutes to check for users that their rows were not updated for two minutes i what these users to be removed from the table
|
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
TimSman
Posting Yak Master
USA
127 Posts |
Posted - 11/23/2010 : 12:59:40
|
| 2 minutes? Better make the bathroom breaks real quick. |
 |
|
|
elic05
Yak Posting Veteran
62 Posts |
Posted - 11/23/2010 : 14:19:31
|
I will explain.
i build a chat room its built by flash/actionscript that connects the server throuth aspx/vb.net
everyone that connects to the room with a username is listed in the users table since the server cant talk to the client i have a function on the client (flash object) that sends a request to the server to get data the data: a. new messages b. new users c. users that left the room on every user request i update in the users table the time of the last request the request is made every 2 seconds
if a user use the logout button i can inform the server (using actionscript) to remove him from the users table but if he just closes the browser the server cant know that this user is no longer connected unless the server checks from time to time to see if some user dont request data anymore
therefore i have a field in the users table that is updated on every request by the time of the last request
and i want the server to check from time to time (lets say every 2 minutes) what was the last time of request of every user if their was no request for the last minutes the user is not connected he closed the browser.
|
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
elic05
Yak Posting Veteran
62 Posts |
Posted - 11/23/2010 : 17:29:23
|
i store the last request time of the user
|
Edited by - elic05 on 11/23/2010 17:35:19 |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
elic05
Yak Posting Veteran
62 Posts |
Posted - 11/23/2010 : 17:42:02
|
I cant see my database in the SSMS (i dont know why)
i have there 3 fields
table Name: users userName, nvarchar(20) lastRequestTime, time(7) lastMsgId, int
|
 |
|
| |
Topic  |
|