如何在特定日期之后从sql server中删除记录 [英] how to delete record from sql server after specific date

查看:178
本文介绍了如何在特定日期之后从sql server中删除记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


实际上,我在ASP.Net中的GRIDVIEW中显示记录,而gridview的数据是通过使用SQL SERVER中的存储过程从SQL SERVER数据库中获取的.在单击记录的9天后从此gridview中获取,但是假设今天我单击了一条记录,并且在4天之后我还单击了同一记录,那么当我第二次单击同一记录时,该记录将在9天后删除吗?

Hi,
actually i am showing the records in the GRIDVIEW in ASP.Net and the data for gridview is coming from the SQL SERVER Database by using Store Procedure in SQL SERVER.now my question is that when i click on a record in gridview that record will delete from this gridview after the 9 days of clicking on the record but suppose if today i click on a record and after 4 days i also click on the same record than that record will delete after 9 days when i second time click on the same record?
if my application will not use on server for some days than in this case the same work will be done in this case?

推荐答案

在我看来,您需要编写sql过程,然后通过作业计划它以满足您的要求.
您可以在 http://msdn.microsoft.com/zh-CN上找到对SQL中的作业调度的良好参考.我们/library/ms191439.aspx [ ^ ]
也在 http://www.databasedesign-resource.com/sql-server-jobs.html [< ^ ]

希望这会有所帮助.
一切顺利.
In my opinion You will need to write a sql procedure and then schedule it through a job to meet your requirements.
You can find a good reference to Job scheduling in SQL at http://msdn.microsoft.com/en-us/library/ms191439.aspx[^]
also at http://www.databasedesign-resource.com/sql-server-jobs.html[^]

Hope this helps.
All the best.


从"table_name"中删除,其中"date_field"> ''2011年2月3日''
delete from ''table_name'' where ''date_field'' > ''2/3/2011''


这篇关于如何在特定日期之后从sql server中删除记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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