SQL自动清除数据
2018-08-10 本文已影响16人
肉肉要次肉
很多时候我们数据库中存入了大量的数据,例如每过几秒获取定位,这些数据库会造成很大压力,那么就会用到时隔多久清除掉这些数据。
一、打开SQL Sever Management Studio,找到SQL Server 代理

二、输入作业名称

三、点击步骤,新建

四、输入步骤名称,选择数据库,输入清理数据的sql语句

五、高级里面,成功时要执行的操作,选择“退出报告成功的作业”。

六、点击计划-->新建,输入计划名称、执行频率、时间


七、创建成功后,回到SQL Server代理界面,就能看到我们的作业“清理日志”右键属性里面可查看上一次的执行情况。
