每天自动更新数据库列值 [英] update database column value everyday automatically

查看:133
本文介绍了每天自动更新数据库列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我按下开始按钮然后每天更新数据库列值时,当我按下停止按钮时,数据库值无法更新。我如何通过asp.net使用c sharp从代码后面解决这个问题而不加载页面。数据库值将自动更新。

when i press a start button then update database column value everyday and when i press stop button then database value can not update. how i solve this by asp.net using c sharp from code behind without loading page. Database value will update automatically .

推荐答案

一种方法是为SQL Server代理创建一个作业,该作业将按照所需的时间间隔进行更新,并且您的代码将控制该作业是否启用。



要创建一份工作,请查看创建工作 [ ^ ]并切换启用状态,请参阅 sp_update_job(Transact-SQL) [ ^ ]



但是,请记住,通常不建议在数据库中存储计算值。
One way is to create a job for SQL Server agent which would do the update on desired interval and your code would control if the job is enabled or not.

To create a job, have a look at Create a Job[^] and to toggle the enabled state, see sp_update_job (Transact-SQL)[^]

However, keep in mind that storing calculated values in the database is often not recommended.


你好,



如果你想更新SQL服务器中的列,那么我建议你使用SQL Jobs,它将在特定时间每天运行并执行上述查询或存储过程。

在SQL 2012中创建新作业 [ ^ ]



希望这个是你需要的。

谢谢
Hello,

If you want to update column in SQL server, then I would recommend you to use SQL Jobs, which would run daily at specific time and perform the query mentioned or the Stored Procedures.
Create New Jobs In SQL 2012[^]

Hope this is what you require.
Thanks


这篇关于每天自动更新数据库列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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