[英]Scheduling a job in SQL Server
I have a Leave_info
table in that there are 4 columns: 我有一个Leave_info
表,其中有4列:
empid, Cl, SL, LOP Empid,Cl,SL,LOP
The default value at the beginning of every year for CL,SL,LOP is 每年年初CL,SL,LOP的默认值为
12, 6, 0. 12、6、0。
This update has to be done automatically by the server on every year Jan 1st 12am. 服务器必须在每年的1月1日凌晨12点自动完成此更新。 How to do this? 这个怎么做?
If your server has SQL Server Agent
installed, you can create a job
and schedule it to run at 12:00am on the 1st of each year. 如果您的服务器安装了SQL Server Agent
,则可以创建job
并将其安排为每年的1月12:00 am运行。
Here's a quick how-to on creating a job
: http://technet.microsoft.com/en-us/library/ms190268.aspx 这是创建job
的快速方法: http : //technet.microsoft.com/zh-cn/library/ms190268.aspx
If you do not have SQL Server Agent
installed then you can write an application, compile it, and then set a Windows Scheduled Task
on the server to run your application based on your needed yearly schedule. 如果未安装SQL Server Agent
则可以编写应用程序,对其进行编译,然后在服务器上设置Windows Scheduled Task
以根据所需的年度计划运行应用程序。
( Or cron job in Linux environment if not MS SQL Server ) (如果不是MS SQL Server,则在Linux环境中执行cron作业)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.