tag:blogger.com,1999:blog-4402664127960334547.post6314408471412877299..comments2024-03-24T10:38:58.256-05:00Comments on Nebraska SQL from @DBA_ANDY: T-SQL Tuesday #98 – Take Small Bites!@DBA_ANDYhttp://www.blogger.com/profile/09130139756284009675noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-4402664127960334547.post-32713870755121429012018-01-11T04:21:34.989-06:002018-01-11T04:21:34.989-06:00You write that running the check to see if rows qu...You write that running the check to see if rows qualify would be more expensive then just letting it run. However, why not add IF @@ROWCOUNT = 0 BREAK within the loop so that it stops as soon as it doesn't find any more rows to delete?Hugo Kornelishttps://sqlserverfast.com/noreply@blogger.com