如何根据日期(每年)更改列值 [英] How to change column value based on date (every year)

查看:72
本文介绍了如何根据日期(每年)更改列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发休假管理系统,这是我的第一个网络应用程序。我在visual studio 2010中有一个LocalDB sql server,我需要每年更新一些列。



例如,我有SickLeave列(int),我需要此栏目将在特定日期(每年)更新值(15),根据其加入日期,日期将因员工而异。



我已经搜索了很多,在mySQL中有一些叫做预定事件的东西可以做类似的事情,但它对sql server不起作用。



所以任何人知道怎么做吗?我们将不胜感激。



提前致谢。

I am working on a leave management system, and this is my first web application. I have a LocalDB sql server in visual studio 2010 and I need some columns to be updated every year.

For example, I have SickLeave column (int), I need this column to be updated with the value (15) in a specific date (every year), the date will be different from one employee to another based on his joining date.

I have searched a lot, there is something called scheduled event in mySQL that can do something similar, but it doesn't work for sql server.

So anyone has an idea how to do it? Your help will be appreciated.

Thanks in advance.

推荐答案

您可以修改答案这个StackOverflow问题可以满足您的需求。

如何为每天运行的SQL查询安排作业? [ ^ ]
You can probably modify the answer in this StackOverflow question for your needs.
how to schedule a job for sql query to run daily?[^]


这篇关于如何根据日期(每年)更改列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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