删除超过一周的数据的触发器 [英] Trigger that removes data older than one week

查看:81
本文介绍了删除超过一周的数据的触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想在SQL服务器中创建触发器,删除超过一周的记录。

我有约会对象表中的字段,在此表中插入记录后,应在一周后自动从表中删除。我希望触发器为它创建触发器。

所以请帮助我如何创建在一段时间间隔后触发的触发器。



谢谢。

Hi,

I want to create trigger in SQL server that removes record which are older than one week.
I have date field in table, after inserting record in this table, it should automatically removed from table after one week. I want trigger to create trigger for that.
So help me how to create such trigger that fires after some time interval.

Thanks.

推荐答案

试试这个,



http://bit.ly/12ge1xh [ ^ ]


您没有提供很多细节。所以,我的回答是......从这里开始:

CREATE TRIGGER(T-SQL) [ ^ ]

DML触发器 [ ^ ]

DDL触发器 [ ^ ]

登录触发器 [ ^ ]
You did not provide to many details. So, my answer is... start here:
CREATE TRIGGER (T-SQL)[^]
DML Triggers[^]
DDL Triggers[^]
LOGON Triggers[^]


这篇关于删除超过一周的数据的触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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