sqlserver存储过程间隔一定时间执行一次通常怎么写》

2025-04-02 09:02:57
推荐回答(2个)
回答1:

你这个要用到 SQL SERVER 的作业计划,可以定时执行SQL

回答2:

删除原有的记录

delete a from Daily a inner join dbo.GetChildNode(@DeptId) b on a.DeptId=b.Did where Date between @SDate and @EDate --and (DeptId in (select Did from GetChildNode(@DeptId)) or DeptId is null)
delete a from Daily a where Date between @SDate and @EDate and DeptId is null