K3日志定时备份

 K3日志超过5万条以后,每次用户登陆后,系统都会提示日志太多。但是日志又不能随意删除,所以需要做个数据库定时任务,定时把日志转移到备份表。

declare @dt datetime;;

SELECT @dt = getdate();

Insert into t_log_history 
select [FDate]
      ,[FUserID]
      ,[FFunctionID]
      ,[FStatement]
      ,[FDescription]
      ,[FMachineName]
      ,[FIPAddress] from t_log where fdate<@dt;
DELETE FROM t_log WHERE fdate<@dt;

原文地址:https://www.cnblogs.com/huangdashen/p/9099822.html