Some notes on software development... RSS 2.0
# Wednesday, 26 November 2014

Quick code snippet for SQL Server batch deletion:

-- Delete in batches of 5000 DECLARE @rowcount INT = 1, @batchsize INT = 5000 WHILE (@rowcount != 0) BEGIN DELETE TOP (@batchsize) SomeBigTable SELECT @rowcount = @@ROWCOUNT END

There is an excellent article over at using different chunking techniques with performance metrics:

Wednesday, 26 November 2014 10:56:31 (GMT Standard Time, UTC+00:00)  #    -
SQL Server

Sign In
Total Posts: 116
This Year: 0
This Month: 0
This Week: 0
Comments: 36
About the author/Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2019
Hadrian Phillips

All Content © 2019, Hadrian Phillips
DasBlog theme 'Business' created by Christoph De Baene (delarou)