如何自动更新sqlserver中的表 [英] How to automatically update a table in sqlserver

查看:97
本文介绍了如何自动更新sqlserver中的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Web应用程序。在我的数据库中,我想基于此更新自动更新。我正在创建库管理员。预订可供选择。如果有人不来这本书得到很长一段时间。状态表自动更改为取消。此外,邮件有时也会自动发送给特定的学生。在这种情况下,即使应用程序未运行,也必须自动执行该过程。哪一个是该案例的最佳解决方案。触发器还是其他什么?

在此先感谢..

I m working with web application. In my database, I want to update automatically updated based on that. I m creating library managent. There are an option for book reservation. If somebody not come for get the book long period. The table of the status is automatically changed to ''cancel''. And also a mail is automatically send to particualar students sometimes. In that case even the application is not running that process are automatically should have to be done. Which one is best solutions for that case. Triggers or anything else?
Thanks in advance..

推荐答案

您可以编写一个Windows服务或控制台应用程序,它将为您完成。应用程序会定期(您将设置间隔)根据您的逻辑更新该表。在控制台应用程序中,您可以在Windows任务计划程序的帮助下运行它。我更喜欢Console应用程序(与Windows任务调度程序一起运行),因为它更容易开发/维护。
You can write a windows service or Console Application which will do it for you. The application periodically(you will set the interval) update that table based on your logic. In console application you can run it with the help of Windows Task Scheduler. I prefer Console app(running with Windows task scheduler) over Windows service development only because it is easier to develop/maintain.






您可以使用 SQL服务器代理作业,这将允许您在每个指定的时间间隔后定期执行某些sql语句,换句话说,这将有助于以预定的方式执行sql语句。



请参阅下面的MSDN文章了解更多关于 SQL JOBS

MSDN实施工作 [ ^ ]

管理工作步骤 [ ^ ]



希望它有所帮助。
Hi,

you can make use of SQL server Agent Jobs, which will allow you to execute certain sql statements regularly after every specified interval, in other terms, this will help to execute sql statements in the scheduled manner.

refer below MSDN article for more on SQL JOBS.
MSDN-Implement Jobs[^]
Manage Job Steps[^]

hope it helps.


请参考b elow links ..



自定义计划程序 - SQL Server Reporting Services [ ^ ]



SQL Server代理的调度程序GUI [ ^ ]
Please refer below links..

Custom Scheduler - SQL Server Reporting Services[^]

A scheduler GUI for SQL Server Agent[^]


这篇关于如何自动更新sqlserver中的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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