Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
elic05
Yak Posting Veteran
62 Posts |
Posted - 2010-11-23 : 12:53:00
|
is their a waythat i can tell the db to check a specific field in a tableat set intervalsi want it to run a check every 2 minutesto check for users that their rows were not updated for two minutesi what these users to be removed from the table |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
X002548
Not Just a Number
15586 Posts |
|
TimSman
Posting Yak Master
127 Posts |
Posted - 2010-11-23 : 12:59:40
|
2 minutes? Better make the bathroom breaks real quick. |
|
|
elic05
Yak Posting Veteran
62 Posts |
Posted - 2010-11-23 : 14:19:31
|
I will explain.i build a chat room its built by flash/actionscript that connects the server throuth aspx/vb.neteveryone that connects to the room with a username is listed in the users tablesince the server cant talk to the clienti have a function on the client (flash object) that sends a request to the server to get datathe data:a. new messagesb. new usersc. users that left the roomon every user request i update in the users table the time of the last requestthe request is made every 2 secondsif a user use the logout buttoni can inform the server (using actionscript) to remove him from the users tablebut if he just closes the browserthe server cant know that this user is no longer connectedunless the server checks from time to time to see if some user dont request data anymoretherefore i have a field in the users table that is updated on every request by the time of the last requestand i want the server to check from time to time (lets say every 2 minutes) what was the last time of request of every userif their was no request for the last minutesthe user is not connected he closed the browser. |
|
|
X002548
Not Just a Number
15586 Posts |
|
elic05
Yak Posting Veteran
62 Posts |
Posted - 2010-11-23 : 17:29:23
|
i store the last request time of the user |
|
|
X002548
Not Just a Number
15586 Posts |
|
elic05
Yak Posting Veteran
62 Posts |
Posted - 2010-11-23 : 17:42:02
|
I cant see my database in the SSMS (i dont know why)i have there 3 fieldstable Name: usersuserName, nvarchar(20)lastRequestTime, time(7)lastMsgId, int |
|
|
|
|
|