Currently on SQL Server 2008/R2. I just read here that "set rowcount" is being deprecated in some post 2012 release: http://technet.microsoft.com/en-us/library/ms188774.aspx
We have some legacy code that uses it presumably to delete small chunks of data and to minimize locking in our nightly "Data Purge" job.
Without rowcount, I would have to use "top xxx" instead?
set rowcount 1000 /* Only delete this number of rows at a time */; declare @short_time datetime2 = DATEADD(week,-1,SYSUTCDATETIME()); SET @TotalRowCount = 0 while ( select COUNT(1) from FlightAudit with (nolock) ) > @min_row_count begin delete FlightAudit where CreatedUTC < @short_time; SET @SaveRowCount = @@ROWCOUNT SET @TotalRowCount = @TotalRowCount + @SaveRowCount if @SaveRowCount=0 break; print 'delete from FuelerCertificationAudit...' + convert(varchar(10),@SaveRowCount) + ' Time=' + dbo.DateOrNullToChar(getdate()) end print 'Total deleted from FlightAudit...' + convert(varchar(10),@TotalRowCount) + ' Time=' + dbo.DateOrNullToChar(getdate())