如何运行SQL Server 2008上的周期性过程 [英] How to run periodic processes on SQL Server 2008

查看:125
本文介绍了如何运行SQL Server 2008上的周期性过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了这显示当前在线/离线用户一个很简单的聊天室般的ASP.NET应用程序:

I've built a very simple chatroom-like ASP.NET application which displays current Online/Offline users:

我有一个表作为时间戳的日期时间列。用户每次导致回发或获取类似事件,我更新时间戳。我想,在服务器上,建立某种形式的,我可以用它来检查多久用户一直无所作为因为我知道他们最后一次活跃的周期过程。一旦他们已被视为无效(几分钟后让说),我想设置另一列的值设置为它们标记为脱机。

I have a Table with a DateTime column used as a TimeStamp. Every time a user causes a Postback or similar Get event, I update the TimeStamp. I want to, on the server, create a periodic process of some sort that I can use to check how long a user has been inactive given that I know the last time they were active. Once they have been deemed inactive (after a few minutes lets say), I want to set the value of another column to mark them as "Offline".

任何建议将是AP preciated。

Any suggestions would be appreciated.

推荐答案

您可以创建一个SQL Server代理作业定期运行。

You could create a Sql Server Agent Job that runs periodically.

<一个href=\"http://msdn.microsoft.com/en-us/library/ms187910.aspx\">http://msdn.microsoft.com/en-us/library/ms187910.aspx

<一个href=\"http://msdn.microsoft.com/en-us/library/ms186273.aspx\">http://msdn.microsoft.com/en-us/library/ms186273.aspx

这篇关于如何运行SQL Server 2008上的周期性过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆