declare @onecount intset @onecount=10000while 1=1begin delete top(@onecount) from ysh where date<'2016-06-21'; IF (@@rowcount<@onecount) BREAK; print getdate()end