Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 如何编写语句以批量删除1000条_.net_Sql Server_Tsql - Fatal编程技术网

.net 如何编写语句以批量删除1000条

.net 如何编写语句以批量删除1000条,.net,sql-server,tsql,.net,Sql Server,Tsql,下面是需要重新编写的代码,以便成批删除1000个,因为这里的代码会导致我们的表膨胀 目标: 在作业内重新写入delete语句,以成批删除1000个 @command=N'exec system.dbo.sp_global_SQLExec_RunOnAllCompanies ''delete from alohaftplog where date < convert(varchar(15),getdate() -30,101)''', @command=N'exec system.dbo.

下面是需要重新编写的代码,以便成批删除1000个,因为这里的代码会导致我们的表膨胀

目标: 在作业内重新写入delete语句,以成批删除1000个

@command=N'exec system.dbo.sp_global_SQLExec_RunOnAllCompanies ''delete from alohaftplog where date < convert(varchar(15),getdate() -30,101)''',
@command=N'exec system.dbo.sp_global_SQLExec_RunOnAllCompanies''从alohaftplog中删除,其中日期
您可以在删除语句中添加前1000名:

delete TOP 1000 from alohaftplog where date < convert(varchar(15),getdate() -30,101)
从alohaftplog中删除前1000名,其中date
sp\u global\u SQLExec\u runonall companies的定义是什么?在表中的公司中运行的存储过程。