【发布时间】:2019-10-02 18:34:42
【问题描述】:
下面是需要重写的代码,以便批量删除 1000 个,因为这里的代码会导致我们的表格膨胀。
目标: 重写job里面的delete语句,批量1000条删除
@command=N'exec system.dbo.sp_global_SQLExec_RunOnAllCompanies ''delete from alohaftplog where date < convert(varchar(15),getdate() -30,101)''',
【问题讨论】:
-
sp_global_SQLExec_RunOnAllCompanies的定义是什么? -
存储的过程通过表中的公司运行。
标签: .net sql-server tsql